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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/IsolatedWorkerThread.cpp

Issue 2118243002: [proof-of-concept] SW thread independent of the main thread Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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/serviceworkers/IsolatedWorkerThread.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/IsolatedWorkerThread.cpp b/third_party/WebKit/Source/modules/serviceworkers/IsolatedWorkerThread.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..dfd9384fab8c17c1492e79e933c59a0a7b8a8486
--- /dev/null
+++ b/third_party/WebKit/Source/modules/serviceworkers/IsolatedWorkerThread.cpp
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "modules/serviceworkers/IsolatedWorkerThread.h"
+
+#include "core/workers/WorkerBackingThread.h"
+#include "platform/TraceEvent.h"
+#include "core/dom/ExceptionCode.h"
+#include "core/workers/WorkerThreadStartupData.h"
+#include "modules/serviceworkers/ServiceWorkerGlobalScope.h"
+#include "modules/serviceworkers/IsolatedWorkerReportingProxy.h"
+#include "modules/EventTargetModulesNames.h"
+
+namespace blink {
+
+std::unique_ptr<IsolatedWorkerThread> IsolatedWorkerThread::create(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, WorkerReportingProxy& workerReportingProxy)
+{
+ return wrapUnique(new IsolatedWorkerThread(workerLoaderProxy, workerReportingProxy));
+}
+
+IsolatedWorkerThread::IsolatedWorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, WorkerReportingProxy& workerReportingProxy)
+ : WorkerThread(workerLoaderProxy, workerReportingProxy, false)
+ , m_workerBackingThread(WorkerBackingThread::create("IsolatedWorker Thread"))
+{
+}
+
+IsolatedWorkerThread::~IsolatedWorkerThread()
+{
+}
+
+void IsolatedWorkerThread::clearWorkerBackingThread()
+{
+ m_workerBackingThread = nullptr;
+}
+
+WorkerOrWorkletGlobalScope* IsolatedWorkerThread::createWorkerGlobalScope(std::unique_ptr<WorkerThreadStartupData> startupData)
+{
+ return ServiceWorkerGlobalScope::create(this, std::move(startupData));
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698