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

Unified Diff: third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp

Issue 1547893003: WIP - compositor worker mega patch. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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/modules/compositorworker/CompositorWorker.cpp
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp
index a348c194302b14aff88bd60c2a2be7334eda8aff..23f92b745bd493751f7df8c93f87c4a2da953de3 100644
--- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp
@@ -5,11 +5,14 @@
#include "modules/compositorworker/CompositorWorker.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "core/dom/CompositorProxyClient.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
+#include "core/page/ChromeClient.h"
#include "core/workers/WorkerClients.h"
#include "modules/EventTargetModules.h"
#include "modules/compositorworker/CompositorWorkerMessagingProxy.h"
+#include "platform/TraceEvent.h"
#include "wtf/MainThread.h"
namespace blink {
@@ -21,6 +24,7 @@ inline CompositorWorker::CompositorWorker(ExecutionContext* context)
CompositorWorker* CompositorWorker::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState)
{
+ TRACE_EVENT0("compositor-worker", "CompositorWorker::create");
ASSERT(isMainThread());
Document* document = toDocument(context);
if (!document->page()) {
@@ -35,6 +39,7 @@ CompositorWorker* CompositorWorker::create(ExecutionContext* context, const Stri
CompositorWorker::~CompositorWorker()
{
+ TRACE_EVENT0("compositor-worker", "CompositorWorker::~CompositorWorker");
ASSERT(isMainThread());
}
@@ -43,10 +48,14 @@ const AtomicString& CompositorWorker::interfaceName() const
return EventTargetNames::CompositorWorker;
}
-WorkerGlobalScopeProxy* CompositorWorker::createWorkerGlobalScopeProxy(ExecutionContext* worker)
+WorkerGlobalScopeProxy* CompositorWorker::createWorkerGlobalScopeProxy(ExecutionContext* context)
{
- ASSERT(executionContext()->isDocument());
- return new CompositorWorkerMessagingProxy(this);
+ TRACE_EVENT0("compositor-worker", "CompositorWorker::createWorkerGlobalScopeProxy");
+ ASSERT(context->isDocument());
+ Document* document = toDocument(context);
+ OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create();
+ provideCompositorProxyClientTo(workerClients.get(), adoptPtrWillBeNoop(document->frame()->chromeClient().createCompositorProxyClient()));
+ return new CompositorWorkerMessagingProxy(this, workerClients.release());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698