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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerBackingThread.h

Issue 2053273002: Remove WorkerBackingThread::scriptCount (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/workers/WorkerBackingThread.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerBackingThread.h b/third_party/WebKit/Source/core/workers/WorkerBackingThread.h
index afbc4a0509ac1bdcb64a2d2d4975bd60f1734183..3895867064b04b7f498ad5f0bde168e433827cbd 100644
--- a/third_party/WebKit/Source/core/workers/WorkerBackingThread.h
+++ b/third_party/WebKit/Source/core/workers/WorkerBackingThread.h
@@ -18,8 +18,8 @@ class WebThread;
class WebThreadSupportingGC;
// WorkerBackingThread represents a WebThread with Oilpan and V8 potentially
-// shared by multiple WebWorker scripts. A WebWorker needs to call attach() when
-// attaching itself to the backing thread, and call detach() when the script
+// shared by multiple WebWorker scripts. A WebWorker needs to call initialize()
+// to using V8 and Oilpan functionalities, and call detach() when the script
// no longer needs the thread.
// A WorkerBackingThread represents a WebThread while a WorkerThread corresponds
// to a web worker. There is one-to-one correspondence between WorkerThread and
@@ -37,21 +37,12 @@ public:
~WorkerBackingThread();
- // attach() and detach() attaches and detaches Oilpan and V8 to / from
- // the caller worker script, respectively. attach() and detach() increments
- // and decrements m_workerScriptCount. attach() initializes Oilpan and V8
- // when m_workerScriptCount is 0. detach() terminates Oilpan and V8 when
- // m_workerScriptCount is 1. A worker script must not call any function
- // after calling detach().
+ // initialize() and shutdown() attaches and detaches Oilpan and V8 to / from
+ // the caller worker script, respectively. A worker script must not call
+ // any function after calling shutdown().
// They should be called from |this| thread.
- void attach();
- void detach();
-
- unsigned workerScriptCount()
- {
- MutexLocker locker(m_mutex);
- return m_workerScriptCount;
- }
+ void initialize();
+ void shutdown();
WebThreadSupportingGC& backingThread()
{
@@ -67,14 +58,9 @@ public:
private:
WorkerBackingThread(const char* name, bool shouldCallGCOnShutdown);
WorkerBackingThread(WebThread*, bool shouldCallGCOnSHutdown);
- void initialize();
- void shutdown();
- // Protects |m_workerScriptCount|.
- Mutex m_mutex;
OwnPtr<WebThreadSupportingGC> m_backingThread;
v8::Isolate* m_isolate = nullptr;
- unsigned m_workerScriptCount = 0;
bool m_isOwningThread;
bool m_shouldCallGCOnShutdown;
};
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698