Diff to HTML by rtfpessoa

{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcess → generated/artifacts/PluginSkeleton-OutOfProcess}/OutOfProcess.cpp RENAMED
@@ -18,14 +18,19 @@
18
18
  */
19
19
 
20
20
  #include "OutOfProcess.h"
21
- #include <interfaces/json/JBrowser.h>
21
+ #include <N/json/JWebBrowser.h>
22
+ #include <N/json/JWebBrowserExt.h>
23
+ #include <N/json/JBrowserResources.h>
24
+ #include <N/json/JBrowserSecurity.h>
25
+ #include <N/json/JBrowserScripting.h>
26
+ #include <N/json/JBrowserCookieJar.h>
22
27
 
23
28
  namespace Thunder {
24
29
  namespace Plugin {
25
30
 
26
31
  namespace {
27
32
 
28
- static Metadata<OutOfProcess>metadata(
33
+ static Metadata<OutOfProcess> metadata(
29
34
  // Version
30
35
  1, 0, 0,
31
36
  // Preconditions
@@ -78,11 +83,14 @@ namespace Plugin {
78
83
  if (_implBrowserCookieJar == nullptr) {
79
84
  message = _T("Failed to acquire IBrowserCookieJar interface.");
80
85
  } else {
86
+ _implBrowser->Register(&_notification);
87
+ _implWebBrowser->Register(&_notification);
81
88
  Exchange::JWebBrowser::Register(*this, _implWebBrowser);
82
89
  Exchange::JWebBrowserExt::Register(*this, _implWebBrowserExt);
83
90
  Exchange::JBrowserResources::Register(*this, _implBrowserResources);
84
91
  Exchange::JBrowserSecurity::Register(*this, _implBrowserSecurity);
85
92
  Exchange::JBrowserScripting::Register(*this, _implBrowserScripting);
93
+ _implBrowserCookieJar->Register(&_notification);
86
94
  Exchange::JBrowserCookieJar::Register(*this, _implBrowserCookieJar);
87
95
  }
88
96
  }
@@ -106,6 +114,7 @@ namespace Plugin {
106
114
 
107
115
  if (_implWebBrowser != nullptr) {
108
116
  Exchange::JWebBrowser::Unregister(*this);
117
+ _implWebBrowser->Unregister(&_notification);
109
118
  _implWebBrowser->Release();
110
119
  _implWebBrowser = nullptr;
111
120
  }
@@ -136,9 +145,11 @@ namespace Plugin {
136
145
 
137
146
  if (_implBrowserCookieJar != nullptr) {
138
147
  Exchange::JBrowserCookieJar::Unregister(*this);
148
+ _implBrowserCookieJar->Unregister(&_notification);
139
149
  _implBrowserCookieJar->Release();
140
150
  _implBrowserCookieJar = nullptr;
141
151
  }
152
+ _implBrowser->Unregister(&_notification);
142
153
 
143
154
  RPC::IRemoteConnection* connection(service->RemoteConnection(_connectionId));
144
155
  VARIABLE_IS_NOT_USED uint32_t result = _implBrowser->Release();
@@ -182,6 +193,23 @@ namespace Plugin {
182
193
  revokedInterface->Release();
183
194
  }
184
195
  }
196
+
197
+ if (interfaceId == Exchange::IWebBrowser::INotification::ID) {
198
+ auto* revokedInterface = remote->QueryInterface<Exchange::IWebBrowser::INotification>();
199
+ if (revokedInterface) {
200
+ _implWebBrowser->Unregister(revokedInterface);
201
+ revokedInterface->Release();
202
+ }
203
+ }
204
+
205
+ if (interfaceId == Exchange::IBrowserCookieJar::INotification::ID) {
206
+ auto* revokedInterface = remote->QueryInterface<Exchange::IBrowserCookieJar::INotification>();
207
+ if (revokedInterface) {
208
+ _implBrowserCookieJar->Unregister(revokedInterface);
209
+ revokedInterface->Release();
210
+ }
211
+ }
212
+
185
213
  }
186
214
 
187
215
  } // Plugin
{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcess → generated/artifacts/PluginSkeleton-OutOfProcess}/OutOfProcess.h RENAMED
@@ -20,8 +20,9 @@
20
20
  #pragma once
21
21
 
22
22
  #include "Module.h"
23
- #include <interfaces/IBrowser.h>
24
- #include <interfaces/json/JBrowser.h>
23
+ #include <N/IBrowser.h>
24
+ #include <N/json/JWebBrowser.h>
25
+ #include <N/json/JBrowserCookieJar.h>
25
26
 
26
27
  namespace Thunder {
27
28
  namespace Plugin {
@@ -50,7 +51,8 @@ namespace Plugin {
50
51
  }
51
52
 
52
53
  ~OutOfProcess() override = default;
53
- class Notification : public RPC::IRemoteConnection::INotification, public PluginHost::IShell::ICOMLink::INotification, public Exchange::IBrowser::INotification {
54
+ private:
55
+ class Notification : public RPC::IRemoteConnection::INotification, public PluginHost::IShell::ICOMLink::INotification, public Exchange::IBrowser::INotification, public Exchange::IWebBrowser::INotification, public Exchange::IBrowserCookieJar::INotification {
54
56
  public:
55
57
  Notification(const Notification&) = delete;
56
58
  Notification& operator=(const Notification&) = delete;
@@ -62,6 +64,8 @@ namespace Plugin {
62
64
  : RPC::IRemoteConnection::INotification()
63
65
  , PluginHost::IShell::ICOMLink::INotification()
64
66
  , Exchange::IBrowser::INotification()
67
+ , Exchange::IWebBrowser::INotification()
68
+ , Exchange::IBrowserCookieJar::INotification()
65
69
  , _parent(parent)
66
70
  {
67
71
  }
@@ -80,21 +84,44 @@ namespace Plugin {
80
84
  _parent.Dangling(remote, interfaceId);
81
85
  }
82
86
  void LoadFinished(const string& URL) override {
83
- Exchange::JBrowser::Event::LoadFinished(_parent, URL);
87
+ // Intentionally left blank (non-@event notification).
84
88
  }
85
89
  void URLChanged(const string& URL) override {
86
- Exchange::JBrowser::Event::URLChanged(_parent, URL);
90
+ // Intentionally left blank (non-@event notification).
87
91
  }
88
92
  void Hidden(const bool hidden) override {
89
- Exchange::JBrowser::Event::Hidden(_parent, hidden);
93
+ // Intentionally left blank (non-@event notification).
90
94
  }
91
95
  void Closure() override {
92
- Exchange::JBrowser::Event::Closure(_parent);
96
+ // Intentionally left blank (non-@event notification).
97
+ }
98
+ void LoadFinished(const string& URL, const int32_t httpstatus) override {
99
+ Exchange::JWebBrowser::Event::LoadFinished(_parent, URL, httpstatus);
100
+ }
101
+ void LoadFailed(const string& URL) override {
102
+ Exchange::JWebBrowser::Event::LoadFailed(_parent, URL);
103
+ }
104
+ void URLChange(const string& URL, const bool loaded) override {
105
+ Exchange::JWebBrowser::Event::URLChange(_parent, URL, loaded);
106
+ }
107
+ void VisibilityChange(const bool hidden) override {
108
+ Exchange::JWebBrowser::Event::VisibilityChange(_parent, hidden);
109
+ }
110
+ void PageClosure() override {
111
+ Exchange::JWebBrowser::Event::PageClosure(_parent);
112
+ }
113
+ void BridgeQuery(const string& message) override {
114
+ Exchange::JWebBrowser::Event::BridgeQuery(_parent, message);
115
+ }
116
+ void CookieJarChanged() override {
117
+ Exchange::JBrowserCookieJar::Event::CookieJarChanged(_parent);
93
118
  }
94
119
  BEGIN_INTERFACE_MAP(Notification)
95
120
  INTERFACE_ENTRY(RPC::IRemoteConnection::INotification)
96
121
  INTERFACE_ENTRY(PluginHost::IShell::ICOMLink::INotification)
97
122
  INTERFACE_ENTRY(Exchange::IBrowser::INotification)
123
+ INTERFACE_ENTRY(Exchange::IWebBrowser::INotification)
124
+ INTERFACE_ENTRY(Exchange::IBrowserCookieJar::INotification)
98
125
  END_INTERFACE_MAP
99
126
  private:
100
127
  OutOfProcess& _parent;
{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcess → generated/artifacts/PluginSkeleton-OutOfProcess}/OutOfProcessImplementation.cpp RENAMED
@@ -18,7 +18,7 @@
18
18
  */
19
19
 
20
20
  #include "Module.h"
21
- #include <interfaces/IBrowser.h>
21
+ #include <N/IBrowser.h>
22
22
 
23
23
  namespace Thunder {
24
24
  namespace Plugin {
@@ -40,6 +40,8 @@ namespace Plugin {
40
40
  , Exchange::IBrowserCookieJar()
41
41
  , _adminLock()
42
42
  , _browserNotification()
43
+ , _webbrowserNotification()
44
+ , _browsercookiejarNotification()
43
45
  {
44
46
  }
45
47
  ~OutOfProcessImplementation() override = default;
@@ -56,10 +58,12 @@ namespace Plugin {
56
58
  INTERFACE_ENTRY(Exchange::IBrowserCookieJar)
57
59
  END_INTERFACE_MAP
58
60
 
61
+ // Type aliases copied from interface headers
62
+ using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;
63
+
59
64
  // IBrowser methods
60
65
 
61
66
  void Register(Exchange::IBrowser::INotification* notification) override {
62
-
63
67
  ASSERT(notification != nullptr);
64
68
 
65
69
  _adminLock.Lock();
@@ -72,11 +76,9 @@ namespace Plugin {
72
76
  }
73
77
 
74
78
  _adminLock.Unlock();
75
-
76
79
  }
77
80
 
78
81
  void Unregister(const Exchange::IBrowser::INotification* notification) override {
79
-
80
82
  ASSERT(notification != nullptr);
81
83
 
82
84
  _adminLock.Lock();
@@ -88,15 +90,13 @@ namespace Plugin {
88
90
  notification->Release();
89
91
  }
90
92
  _adminLock.Unlock();
91
-
92
93
  }
93
94
 
94
95
  void SetURL(const string& /* URL */) override {
95
- return Core::ERROR_NONE;
96
96
  }
97
97
 
98
98
  string GetURL() const override {
99
- return Core::ERROR_NONE;
99
+ return string();
100
100
  }
101
101
 
102
102
  uint32_t GetFPS() const override {
@@ -104,41 +104,37 @@ namespace Plugin {
104
104
  }
105
105
 
106
106
  void Hide(const bool /* hidden */) override {
107
- return Core::ERROR_NONE;
108
107
  }
109
108
 
110
109
  // IWebBrowser methods
111
110
 
112
- void LoadFinished(const string& /* URL */, const int32_t /* httpstatus */) override {
113
- return Core::ERROR_NONE;
114
- }
115
-
116
- void LoadFailed(const string& /* URL */) override {
117
- return Core::ERROR_NONE;
118
- }
111
+ void Register(Exchange::IWebBrowser::INotification* notification) override {
112
+ ASSERT(notification != nullptr);
119
113
 
120
- void URLChange(const string& /* URL */, const bool /* loaded */) override {
121
- return Core::ERROR_NONE;
122
- }
114
+ _adminLock.Lock();
115
+ auto item = std::find(_webbrowserNotification.begin(), _webbrowserNotification.end(), notification);
116
+ ASSERT(item == _webbrowserNotification.end());
123
117
 
124
- void VisibilityChange(const bool /* hidden */) override {
125
- return Core::ERROR_NONE;
126
- }
118
+ if (item == _webbrowserNotification.end()) {
119
+ notification->AddRef();
120
+ _webbrowserNotification.push_back(notification);
121
+ }
127
122
 
128
- void PageClosure() override {
129
- return Core::ERROR_NONE;
123
+ _adminLock.Unlock();
130
124
  }
131
125
 
132
- void BridgeQuery(const string& /* message */) override {
133
- return Core::ERROR_NONE;
134
- }
126
+ void Unregister(const Exchange::IWebBrowser::INotification* notification) override {
127
+ ASSERT(notification != nullptr);
135
128
 
136
- void Register(INotification* /* sink */) override {
137
- return Core::ERROR_NONE;
138
- }
129
+ _adminLock.Lock();
130
+ auto item = std::find(_webbrowserNotification.begin(), _webbrowserNotification.end(), notification);
131
+ ASSERT(item != _webbrowserNotification.end());
139
132
 
140
- void Unregister(INotification* /* sink */) override {
141
- return Core::ERROR_NONE;
133
+ if (item != _webbrowserNotification.end()) {
134
+ _webbrowserNotification.erase(item);
135
+ notification->Release();
136
+ }
137
+ _adminLock.Unlock();
142
138
  }
143
139
 
144
140
  uint32_t URL(string& /* url */ /* @out */) const override {
@@ -279,16 +275,33 @@ namespace Plugin {
279
275
 
280
276
  // IBrowserCookieJar methods
281
277
 
282
- void CookieJarChanged() override {
283
- return Core::ERROR_NONE;
284
- }
278
+ void Register(Exchange::IBrowserCookieJar::INotification* notification) override {
279
+ ASSERT(notification != nullptr);
285
280
 
286
- void Register(INotification* /* sink */) override {
287
- return Core::ERROR_NONE;
281
+ _adminLock.Lock();
282
+ auto item = std::find(_browsercookiejarNotification.begin(), _browsercookiejarNotification.end(), notification);
283
+ ASSERT(item == _browsercookiejarNotification.end());
284
+
285
+ if (item == _browsercookiejarNotification.end()) {
286
+ notification->AddRef();
287
+ _browsercookiejarNotification.push_back(notification);
288
+ }
289
+
290
+ _adminLock.Unlock();
288
291
  }
289
292
 
290
- void Unregister(INotification* /* sink */) override {
291
- return Core::ERROR_NONE;
293
+ void Unregister(const Exchange::IBrowserCookieJar::INotification* notification) override {
294
+ ASSERT(notification != nullptr);
295
+
296
+ _adminLock.Lock();
297
+ auto item = std::find(_browsercookiejarNotification.begin(), _browsercookiejarNotification.end(), notification);
298
+ ASSERT(item != _browsercookiejarNotification.end());
299
+
300
+ if (item != _browsercookiejarNotification.end()) {
301
+ _browsercookiejarNotification.erase(item);
302
+ notification->Release();
303
+ }
304
+ _adminLock.Unlock();
292
305
  }
293
306
 
294
307
  uint32_t CookieJar(Config& /* cookieJarInfo */ /* @out */) const override {
@@ -298,8 +311,11 @@ namespace Plugin {
298
311
  uint32_t CookieJar(const Config& /* cookieJarInfo */) override {
299
312
  return Core::ERROR_NONE;
300
313
  }
314
+
301
315
  private:
302
316
  using BrowserNotificationContainer = std::vector<Exchange::IBrowser::INotification*>;
317
+ using WebBrowserNotificationContainer = std::vector<Exchange::IWebBrowser::INotification*>;
318
+ using BrowserCookieJarNotificationContainer = std::vector<Exchange::IBrowserCookieJar::INotification*>;
303
319
 
304
320
  void NotifyLoadFinished(const string& URL) const {
305
321
  _adminLock.Lock();
@@ -333,8 +349,66 @@ namespace Plugin {
333
349
  _adminLock.Unlock();
334
350
  }
335
351
 
352
+ void NotifyLoadFinished(const string& URL, const int32_t httpstatus) const {
353
+ _adminLock.Lock();
354
+ for (auto* notification : _webbrowserNotification) {
355
+ notification->LoadFinished(URL, httpstatus);
356
+ }
357
+ _adminLock.Unlock();
358
+ }
359
+
360
+ void NotifyLoadFailed(const string& URL) const {
361
+ _adminLock.Lock();
362
+ for (auto* notification : _webbrowserNotification) {
363
+ notification->LoadFailed(URL);
364
+ }
365
+ _adminLock.Unlock();
366
+ }
367
+
368
+ void NotifyURLChange(const string& URL, const bool loaded) const {
369
+ _adminLock.Lock();
370
+ for (auto* notification : _webbrowserNotification) {
371
+ notification->URLChange(URL, loaded);
372
+ }
373
+ _adminLock.Unlock();
374
+ }
375
+
376
+ void NotifyVisibilityChange(const bool hidden) const {
377
+ _adminLock.Lock();
378
+ for (auto* notification : _webbrowserNotification) {
379
+ notification->VisibilityChange(hidden);
380
+ }
381
+ _adminLock.Unlock();
382
+ }
383
+
384
+ void NotifyPageClosure() const {
385
+ _adminLock.Lock();
386
+ for (auto* notification : _webbrowserNotification) {
387
+ notification->PageClosure();
388
+ }
389
+ _adminLock.Unlock();
390
+ }
391
+
392
+ void NotifyBridgeQuery(const string& message) const {
393
+ _adminLock.Lock();
394
+ for (auto* notification : _webbrowserNotification) {
395
+ notification->BridgeQuery(message);
396
+ }
397
+ _adminLock.Unlock();
398
+ }
399
+
400
+ void NotifyCookieJarChanged() const {
401
+ _adminLock.Lock();
402
+ for (auto* notification : _browsercookiejarNotification) {
403
+ notification->CookieJarChanged();
404
+ }
405
+ _adminLock.Unlock();
406
+ }
407
+
336
408
  mutable Core::CriticalSection _adminLock;
337
409
  BrowserNotificationContainer _browserNotification;
410
+ WebBrowserNotificationContainer _webbrowserNotification;
411
+ BrowserCookieJarNotificationContainer _browsercookiejarNotification;
338
412
  };
339
413
 
340
414
  SERVICE_REGISTRATION(OutOfProcessImplementation, 1, 0)