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
@@ -16,18 +16,23 @@
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
18
  */
19
19
 
20
20
  #include "OutOfProcess.h"
21
- #include <interfaces/json/JBrowser.h>
21
+ #include <interfaces/json/JWebBrowser.h>
22
+ #include <interfaces/json/JWebBrowserExt.h>
23
+ #include <interfaces/json/JBrowserResources.h>
24
+ #include <interfaces/json/JBrowserSecurity.h>
25
+ #include <interfaces/json/JBrowserScripting.h>
26
+ #include <interfaces/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
32
37
  {},
33
38
  // Terminations
@@ -76,15 +81,18 @@ namespace Plugin {
76
81
  } else {
77
82
  _implBrowserCookieJar = _implBrowser->QueryInterface<Exchange::IBrowserCookieJar>();
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
  }
89
97
  }
90
98
  }
@@ -104,10 +112,11 @@ namespace Plugin {
104
112
 
105
113
  if (_implBrowser != nullptr) {
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
  }
112
121
 
113
122
  if (_implWebBrowserExt != nullptr) {
@@ -134,13 +143,15 @@ namespace Plugin {
134
143
  _implBrowserScripting = nullptr;
135
144
  }
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();
145
156
  _implBrowser = nullptr;
146
157
 
@@ -176,13 +187,30 @@ namespace Plugin {
176
187
  ASSERT(remote != nullptr);
177
188
 
178
189
  if (interfaceId == Exchange::IBrowser::INotification::ID) {
179
190
  auto* revokedInterface = remote->QueryInterface<Exchange::IBrowser::INotification>();
180
191
  if (revokedInterface) {
181
- _implBrowser->Unregister(revokedInterface);
192
+ _implBrowser->Unregister(const_cast<Exchange::IBrowser::INotification*>(revokedInterface));
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(const_cast<Exchange::IWebBrowser::INotification*>(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(const_cast<Exchange::IBrowserCookieJar::INotification*>(revokedInterface));
209
+ revokedInterface->Release();
210
+ }
211
+ }
212
+
185
213
  }
186
214
 
187
215
  } // Plugin
188
216
  } // Thunder
{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcess → generated/artifacts/PluginSkeleton-OutOfProcess}/OutOfProcess.h RENAMED
@@ -19,11 +19,12 @@
19
19
 
20
20
  #pragma once
21
21
 
22
22
  #include "Module.h"
23
23
  #include <interfaces/IBrowser.h>
24
- #include <interfaces/json/JBrowser.h>
24
+ #include <interfaces/json/JWebBrowser.h>
25
+ #include <interfaces/json/JBrowserCookieJar.h>
25
26
 
26
27
  namespace Thunder {
27
28
  namespace Plugin {
28
29
 
29
30
  class OutOfProcess : public PluginHost::IPlugin, public PluginHost::JSONRPC {
@@ -48,11 +49,12 @@ namespace Plugin {
48
49
  , _notification(*this)
49
50
  {
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;
57
59
  Notification(Notification&&) = delete;
58
60
  Notification& operator=(Notification&&) = delete;
@@ -60,10 +62,12 @@ namespace Plugin {
60
62
 
61
63
  explicit Notification(OutOfProcess& parent)
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
  }
68
72
 
69
73
  ~Notification() override = default;
@@ -77,26 +81,45 @@ namespace Plugin {
77
81
  }
78
82
 
79
83
  void Dangling(const Core::IUnknown* remote, const uint32_t interfaceId) override {
80
84
  _parent.Dangling(remote, interfaceId);
81
85
  }
82
- void LoadFinished(const string& URL) override {
83
- Exchange::JBrowser::Event::LoadFinished(_parent, URL);
86
+ void LoadFinished(const string& /* URL */) override {
84
87
  }
85
- void URLChanged(const string& URL) override {
86
- Exchange::JBrowser::Event::URLChanged(_parent, URL);
88
+ void URLChanged(const string& /* URL */) override {
87
89
  }
88
- void Hidden(const bool hidden) override {
89
- Exchange::JBrowser::Event::Hidden(_parent, hidden);
90
+ void Hidden(const bool /* hidden */) override {
90
91
  }
91
92
  void Closure() override {
92
- Exchange::JBrowser::Event::Closure(_parent);
93
+ }
94
+ void LoadFinished(const string& URL, const int32_t httpstatus) override {
95
+ Exchange::JWebBrowser::Event::LoadFinished(_parent, URL, httpstatus);
96
+ }
97
+ void LoadFailed(const string& URL) override {
98
+ Exchange::JWebBrowser::Event::LoadFailed(_parent, URL);
99
+ }
100
+ void URLChange(const string& URL, const bool loaded) override {
101
+ Exchange::JWebBrowser::Event::URLChange(_parent, URL, loaded);
102
+ }
103
+ void VisibilityChange(const bool hidden) override {
104
+ Exchange::JWebBrowser::Event::VisibilityChange(_parent, hidden);
105
+ }
106
+ void PageClosure() override {
107
+ Exchange::JWebBrowser::Event::PageClosure(_parent);
108
+ }
109
+ void BridgeQuery(const string& message) override {
110
+ Exchange::JWebBrowser::Event::BridgeQuery(_parent, message);
111
+ }
112
+ void CookieJarChanged() override {
113
+ Exchange::JBrowserCookieJar::Event::CookieJarChanged(_parent);
93
114
  }
94
115
  BEGIN_INTERFACE_MAP(Notification)
95
116
  INTERFACE_ENTRY(RPC::IRemoteConnection::INotification)
96
117
  INTERFACE_ENTRY(PluginHost::IShell::ICOMLink::INotification)
97
118
  INTERFACE_ENTRY(Exchange::IBrowser::INotification)
119
+ INTERFACE_ENTRY(Exchange::IWebBrowser::INotification)
120
+ INTERFACE_ENTRY(Exchange::IBrowserCookieJar::INotification)
98
121
  END_INTERFACE_MAP
99
122
  private:
100
123
  OutOfProcess& _parent;
101
124
  };
102
125
  public:
{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcess → generated/artifacts/PluginSkeleton-OutOfProcess}/OutOfProcessImplementation.cpp RENAMED
@@ -38,10 +38,12 @@ namespace Plugin {
38
38
  , Exchange::IBrowserSecurity()
39
39
  , Exchange::IBrowserScripting()
40
40
  , Exchange::IBrowserCookieJar()
41
41
  , _adminLock()
42
42
  , _browserNotification()
43
+ , _webbrowserNotification()
44
+ , _browsercookiejarNotification()
43
45
  {
44
46
  }
45
47
  ~OutOfProcessImplementation() override = default;
46
48
 
47
49
  public:
@@ -54,14 +56,16 @@ namespace Plugin {
54
56
  INTERFACE_ENTRY(Exchange::IBrowserSecurity)
55
57
  INTERFACE_ENTRY(Exchange::IBrowserScripting)
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();
66
70
  auto item = std::find(_browserNotification.begin(), _browserNotification.end(), notification);
67
71
  ASSERT(item == _browserNotification.end());
@@ -70,15 +74,13 @@ namespace Plugin {
70
74
  notification->AddRef();
71
75
  _browserNotification.push_back(notification);
72
76
  }
73
77
 
74
78
  _adminLock.Unlock();
75
-
76
79
  }
77
80
 
78
- void Unregister(const Exchange::IBrowser::INotification* notification) override {
79
-
81
+ void Unregister(Exchange::IBrowser::INotification* notification) override {
80
82
  ASSERT(notification != nullptr);
81
83
 
82
84
  _adminLock.Lock();
83
85
  auto item = std::find(_browserNotification.begin(), _browserNotification.end(), notification);
84
86
  ASSERT(item != _browserNotification.end());
@@ -86,61 +88,55 @@ namespace Plugin {
86
88
  if (item != _browserNotification.end()) {
87
89
  _browserNotification.erase(item);
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 {
103
103
  return Core::ERROR_NONE;
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(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 {
145
141
  return Core::ERROR_NONE;
146
142
  }
@@ -277,66 +273,112 @@ namespace Plugin {
277
273
  return Core::ERROR_NONE;
278
274
  }
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(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 {
295
308
  return Core::ERROR_NONE;
296
309
  }
297
310
 
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*>;
319
+
320
+ void NotifyLoadFinished(const string& URL, const int32_t httpstatus) const {
321
+ _adminLock.Lock();
322
+ for (auto* notification : _webbrowserNotification) {
323
+ notification->LoadFinished(URL, httpstatus);
324
+ }
325
+ _adminLock.Unlock();
326
+ }
327
+
328
+ void NotifyLoadFailed(const string& URL) const {
329
+ _adminLock.Lock();
330
+ for (auto* notification : _webbrowserNotification) {
331
+ notification->LoadFailed(URL);
332
+ }
333
+ _adminLock.Unlock();
334
+ }
335
+
336
+ void NotifyURLChange(const string& URL, const bool loaded) const {
337
+ _adminLock.Lock();
338
+ for (auto* notification : _webbrowserNotification) {
339
+ notification->URLChange(URL, loaded);
340
+ }
341
+ _adminLock.Unlock();
342
+ }
303
343
 
304
- void NotifyLoadFinished(const string& URL) const {
344
+ void NotifyVisibilityChange(const bool hidden) const {
305
345
  _adminLock.Lock();
306
- for (auto* notification : _browserNotification) {
307
- notification->LoadFinished(URL);
346
+ for (auto* notification : _webbrowserNotification) {
347
+ notification->VisibilityChange(hidden);
308
348
  }
309
349
  _adminLock.Unlock();
310
350
  }
311
351
 
312
- void NotifyURLChanged(const string& URL) const {
352
+ void NotifyPageClosure() const {
313
353
  _adminLock.Lock();
314
- for (auto* notification : _browserNotification) {
315
- notification->URLChanged(URL);
354
+ for (auto* notification : _webbrowserNotification) {
355
+ notification->PageClosure();
316
356
  }
317
357
  _adminLock.Unlock();
318
358
  }
319
359
 
320
- void NotifyHidden(const bool hidden) const {
360
+ void NotifyBridgeQuery(const string& message) const {
321
361
  _adminLock.Lock();
322
- for (auto* notification : _browserNotification) {
323
- notification->Hidden(hidden);
362
+ for (auto* notification : _webbrowserNotification) {
363
+ notification->BridgeQuery(message);
324
364
  }
325
365
  _adminLock.Unlock();
326
366
  }
327
367
 
328
- void NotifyClosure() const {
368
+ void NotifyCookieJarChanged() const {
329
369
  _adminLock.Lock();
330
- for (auto* notification : _browserNotification) {
331
- notification->Closure();
370
+ for (auto* notification : _browsercookiejarNotification) {
371
+ notification->CookieJarChanged();
332
372
  }
333
373
  _adminLock.Unlock();
334
374
  }
335
375
 
336
376
  mutable Core::CriticalSection _adminLock;
337
377
  BrowserNotificationContainer _browserNotification;
378
+ WebBrowserNotificationContainer _webbrowserNotification;
379
+ BrowserCookieJarNotificationContainer _browsercookiejarNotification;
338
380
  };
339
381
 
340
382
  SERVICE_REGISTRATION(OutOfProcessImplementation, 1, 0)
341
383
  } // Plugin
342
384
  } // Thunder