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

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 5 years 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 3a1a92c029a35cff446f732911ba2581a50d6b5a..bb0d4f3e9fce344a7b4531cfa183766d59dfd052 100644
--- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp
@@ -6,11 +6,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 {
@@ -22,6 +25,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()) {
@@ -36,6 +40,7 @@ CompositorWorker* CompositorWorker::create(ExecutionContext* context, const Stri
CompositorWorker::~CompositorWorker()
{
+ TRACE_EVENT0("compositor-worker", "CompositorWorker::~CompositorWorker");
ASSERT(isMainThread());
}
@@ -44,10 +49,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