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

Side by Side Diff: Source/modules/compositorworker/CompositorWorkerThread.cpp

Issue 1166923003: Revert of compositor-worker: Share a thread and an isolate for compositor workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "modules/compositorworker/CompositorWorkerThread.h" 6 #include "modules/compositorworker/CompositorWorkerThread.h"
7 7
8 #include "bindings/core/v8/V8Initializer.h" 8 #include "bindings/core/v8/V8Initializer.h"
9 #include "core/workers/WorkerObjectProxy.h" 9 #include "core/workers/WorkerObjectProxy.h"
10 #include "core/workers/WorkerThreadStartupData.h" 10 #include "core/workers/WorkerThreadStartupData.h"
11 #include "modules/compositorworker/CompositorWorkerGlobalScope.h" 11 #include "modules/compositorworker/CompositorWorkerGlobalScope.h"
12 #include "modules/compositorworker/CompositorWorkerManager.h"
13 #include "public/platform/Platform.h" 12 #include "public/platform/Platform.h"
14 13
15 namespace blink { 14 namespace blink {
16 15
17 PassRefPtr<CompositorWorkerThread> CompositorWorkerThread::create(PassRefPtr<Wor kerLoaderProxy> workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin) 16 PassRefPtr<CompositorWorkerThread> CompositorWorkerThread::create(PassRefPtr<Wor kerLoaderProxy> workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin)
18 { 17 {
19 ASSERT(isMainThread()); 18 ASSERT(isMainThread());
20 return adoptRef(new CompositorWorkerThread(workerLoaderProxy, workerObjectPr oxy, timeOrigin)); 19 return adoptRef(new CompositorWorkerThread(workerLoaderProxy, workerObjectPr oxy, timeOrigin));
21 } 20 }
22 21
23 CompositorWorkerThread::CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy> wor kerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin) 22 CompositorWorkerThread::CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy> wor kerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin)
24 : WorkerThread(workerLoaderProxy, workerObjectProxy) 23 : WorkerThread(workerLoaderProxy, workerObjectProxy)
25 , m_workerObjectProxy(workerObjectProxy) 24 , m_workerObjectProxy(workerObjectProxy)
26 , m_timeOrigin(timeOrigin) 25 , m_timeOrigin(timeOrigin)
27 { 26 {
28 } 27 }
29 28
30 CompositorWorkerThread::~CompositorWorkerThread() 29 CompositorWorkerThread::~CompositorWorkerThread()
31 { 30 {
32 } 31 }
33 32
34 PassRefPtrWillBeRawPtr<WorkerGlobalScope> CompositorWorkerThread::createWorkerGl obalScope(PassOwnPtr<WorkerThreadStartupData> startupData) 33 PassRefPtrWillBeRawPtr<WorkerGlobalScope> CompositorWorkerThread::createWorkerGl obalScope(PassOwnPtr<WorkerThreadStartupData> startupData)
35 { 34 {
36 return CompositorWorkerGlobalScope::create(this, startupData, m_timeOrigin); 35 return CompositorWorkerGlobalScope::create(this, startupData, m_timeOrigin);
37 } 36 }
38 37
39 WebThreadSupportingGC& CompositorWorkerThread::backingThread() 38 WebThreadSupportingGC& CompositorWorkerThread::backingThread()
40 { 39 {
41 return CompositorWorkerManager::instance()->compositorWorkerThread(); 40 if (!m_thread)
42 } 41 m_thread = WebThreadSupportingGC::create("CompositorWorker Thread");
43 42 return *m_thread.get();
44 void CompositorWorkerThread::initializeBackingThread()
45 {
46 CompositorWorkerManager::instance()->initializeBackingThread();
47 }
48
49 void CompositorWorkerThread::shutdownBackingThread()
50 {
51 CompositorWorkerManager::instance()->shutdownBackingThread();
52 }
53
54 v8::Isolate* CompositorWorkerThread::initializeIsolate()
55 {
56 return CompositorWorkerManager::instance()->initializeIsolate();
57 }
58
59 void CompositorWorkerThread::willDestroyIsolate()
60 {
61 CompositorWorkerManager::instance()->willDestroyIsolate();
62 }
63
64 void CompositorWorkerThread::destroyIsolate()
65 {
66 CompositorWorkerManager::instance()->destroyIsolate();
67 }
68
69 void CompositorWorkerThread::terminateV8Execution()
70 {
71 CompositorWorkerManager::instance()->terminateV8Execution();
72 } 43 }
73 44
74 } // namespace blink 45 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/compositorworker/CompositorWorkerThread.h ('k') | Source/modules/compositorworker/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698