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

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

Issue 2481843003: Worker: Add WorkerOrWorkletGlobalScope::thread() interface (Closed)
Patch Set: Created 4 years, 1 month 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/DedicatedWorkerGlobalScope.cpp
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp
index 3f31441b1dc7b75a8442a0e1abfaf43b5bc73638..7b2b1017d145d0d0abe7b02df07b52a8bcee1f87 100644
--- a/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp
+++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp
@@ -96,12 +96,8 @@ void DedicatedWorkerGlobalScope::postMessage(
MessagePort::disentanglePorts(context, ports, exceptionState);
if (exceptionState.hadException())
return;
- thread()->workerObjectProxy().postMessageToWorkerObject(std::move(message),
- std::move(channels));
-}
-
-DedicatedWorkerThread* DedicatedWorkerGlobalScope::thread() const {
- return static_cast<DedicatedWorkerThread*>(WorkerGlobalScope::thread());
+ workerObjectProxy().postMessageToWorkerObject(std::move(message),
+ std::move(channels));
}
static void countOnDocument(UseCounter::Feature feature,
@@ -118,16 +114,21 @@ static void countDeprecationOnDocument(UseCounter::Feature feature,
void DedicatedWorkerGlobalScope::countFeature(
UseCounter::Feature feature) const {
- thread()->workerObjectProxy().postTaskToMainExecutionContext(
+ workerObjectProxy().postTaskToMainExecutionContext(
createCrossThreadTask(&countOnDocument, feature));
}
void DedicatedWorkerGlobalScope::countDeprecation(
UseCounter::Feature feature) const {
- thread()->workerObjectProxy().postTaskToMainExecutionContext(
+ workerObjectProxy().postTaskToMainExecutionContext(
createCrossThreadTask(&countDeprecationOnDocument, feature));
}
+InProcessWorkerObjectProxy& DedicatedWorkerGlobalScope::workerObjectProxy()
+ const {
+ return static_cast<DedicatedWorkerThread*>(thread())->workerObjectProxy();
+}
+
DEFINE_TRACE(DedicatedWorkerGlobalScope) {
WorkerGlobalScope::trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698