OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "core/workers/DedicatedWorkerThread.h" | 31 #include "core/workers/DedicatedWorkerThread.h" |
32 | 32 |
33 #include "core/workers/DedicatedWorkerGlobalScope.h" | 33 #include "core/workers/DedicatedWorkerGlobalScope.h" |
| 34 #include "core/workers/WorkerBackingThread.h" |
34 #include "core/workers/WorkerObjectProxy.h" | 35 #include "core/workers/WorkerObjectProxy.h" |
35 #include "core/workers/WorkerThreadStartupData.h" | 36 #include "core/workers/WorkerThreadStartupData.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 PassOwnPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(PassRefPtr<Worke
rLoaderProxy> workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double ti
meOrigin) | 40 PassOwnPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(PassRefPtr<Worke
rLoaderProxy> workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, double ti
meOrigin) |
40 { | 41 { |
41 return adoptPtr(new DedicatedWorkerThread(workerLoaderProxy, workerObjectPro
xy, timeOrigin)); | 42 return adoptPtr(new DedicatedWorkerThread(workerLoaderProxy, workerObjectPro
xy, timeOrigin)); |
42 } | 43 } |
43 | 44 |
44 DedicatedWorkerThread::DedicatedWorkerThread(PassRefPtr<WorkerLoaderProxy> worke
rLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin) | 45 DedicatedWorkerThread::DedicatedWorkerThread(PassRefPtr<WorkerLoaderProxy> worke
rLoaderProxy, WorkerObjectProxy& workerObjectProxy, double timeOrigin) |
45 : WorkerThread(workerLoaderProxy, workerObjectProxy) | 46 : WorkerThread(workerLoaderProxy, workerObjectProxy) |
| 47 , m_workerBackingThread(WorkerBackingThread::create("DedicatedWorker Thread"
)) |
46 , m_workerObjectProxy(workerObjectProxy) | 48 , m_workerObjectProxy(workerObjectProxy) |
47 , m_timeOrigin(timeOrigin) | 49 , m_timeOrigin(timeOrigin) |
48 { | 50 { |
49 } | 51 } |
50 | 52 |
51 DedicatedWorkerThread::~DedicatedWorkerThread() | 53 DedicatedWorkerThread::~DedicatedWorkerThread() |
52 { | 54 { |
53 } | 55 } |
54 | 56 |
55 WorkerGlobalScope* DedicatedWorkerThread::createWorkerGlobalScope(PassOwnPtr<Wor
kerThreadStartupData> startupData) | 57 WorkerGlobalScope* DedicatedWorkerThread::createWorkerGlobalScope(PassOwnPtr<Wor
kerThreadStartupData> startupData) |
56 { | 58 { |
57 return DedicatedWorkerGlobalScope::create(this, startupData, m_timeOrigin); | 59 return DedicatedWorkerGlobalScope::create(this, startupData, m_timeOrigin); |
58 } | 60 } |
59 | 61 |
60 WebThreadSupportingGC& DedicatedWorkerThread::backingThread() | |
61 { | |
62 if (!m_thread) | |
63 m_thread = WebThreadSupportingGC::create("DedicatedWorker Thread"); | |
64 return *m_thread.get(); | |
65 } | |
66 | |
67 void DedicatedWorkerThread::postInitialize() | 62 void DedicatedWorkerThread::postInitialize() |
68 { | 63 { |
69 // Notify the parent object of our current active state before the event | 64 // Notify the parent object of our current active state before the event |
70 // loop starts processing tasks. | 65 // loop starts processing tasks. |
71 m_workerObjectProxy.reportPendingActivity(false); | 66 m_workerObjectProxy.reportPendingActivity(false); |
72 } | 67 } |
73 | 68 |
74 } // namespace blink | 69 } // namespace blink |
OLD | NEW |