Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(653)

Unified Diff: third_party/WebKit/Source/core/workers/Worker.cpp

Issue 2939623002: [DONT COMMIT] WIP: WorkerClientsInitializer (Closed)
Patch Set: finalize2 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/workers/Worker.cpp
diff --git a/third_party/WebKit/Source/core/workers/Worker.cpp b/third_party/WebKit/Source/core/workers/Worker.cpp
index 8232da6c7bd61b31e99dc668522f6c67fd4e4b24..9d70e84eef7b600d2444a139603e5517f5104cfa 100644
--- a/third_party/WebKit/Source/core/workers/Worker.cpp
+++ b/third_party/WebKit/Source/core/workers/Worker.cpp
@@ -8,11 +8,16 @@
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
#include "core/frame/UseCounter.h"
-#include "core/workers/DedicatedWorkerMessagingProxyProvider.h"
-#include "core/workers/InProcessWorkerMessagingProxy.h"
+#include "core/frame/WebLocalFrameBase.h"
+#include "core/workers/DedicatedWorkerMessagingProxy.h"
+#include "core/workers/WorkerContentSettingsClient.h"
+#include "public/platform/WebContentSettingsClient.h"
+#include "public/web/WebFrameClient.h"
namespace blink {
+template class CORE_TEMPLATE_EXPORT WorkerClientsInitializer<Worker>;
+
Worker::Worker(ExecutionContext* context) : InProcessWorkerBase(context) {}
Worker* Worker::Create(ExecutionContext* context,
@@ -43,10 +48,14 @@ const AtomicString& Worker::InterfaceName() const {
InProcessWorkerMessagingProxy* Worker::CreateInProcessWorkerMessagingProxy(
ExecutionContext* context) {
Document* document = ToDocument(context);
- DedicatedWorkerMessagingProxyProvider* proxy_provider =
- DedicatedWorkerMessagingProxyProvider::From(*document->GetPage());
- DCHECK(proxy_provider);
- return proxy_provider->CreateWorkerMessagingProxy(this);
+ WebLocalFrameBase* web_frame =
+ WebLocalFrameBase::FromFrame(document->GetFrame());
+
+ WorkerClients* worker_clients = WorkerClients::Create();
+ WorkerClientsInitializer<Worker>::Run(worker_clients);
+ ProvideContentSettingsClientToWorker(
+ worker_clients, web_frame->Client()->CreateWorkerContentSettingsClient());
+ return new DedicatedWorkerMessagingProxy(this, worker_clients);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/workers/Worker.h ('k') | third_party/WebKit/Source/core/workers/WorkerClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698