OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 30 matching lines...) Expand all Loading... |
41 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
42 #include <v8.h> | 42 #include <v8.h> |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 class WebWaitableEvent; | 46 class WebWaitableEvent; |
47 class WorkerGlobalScope; | 47 class WorkerGlobalScope; |
48 class WorkerInspectorController; | 48 class WorkerInspectorController; |
49 class WorkerMicrotaskRunner; | 49 class WorkerMicrotaskRunner; |
50 class WorkerReportingProxy; | 50 class WorkerReportingProxy; |
| 51 class WorkerSharedTimer; |
51 class WorkerThreadStartupData; | 52 class WorkerThreadStartupData; |
52 | 53 |
53 enum WorkerThreadStartMode { | 54 enum WorkerThreadStartMode { |
54 DontPauseWorkerGlobalScopeOnStart, | 55 DontPauseWorkerGlobalScopeOnStart, |
55 PauseWorkerGlobalScopeOnStart | 56 PauseWorkerGlobalScopeOnStart |
56 }; | 57 }; |
57 | 58 |
58 // TODO(sadrul): Rename to WorkerScript. | 59 // TODO(sadrul): Rename to WorkerScript. |
59 class CORE_EXPORT WorkerThread : public RefCounted<WorkerThread> { | 60 class CORE_EXPORT WorkerThread : public RefCounted<WorkerThread> { |
60 public: | 61 public: |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 124 |
124 virtual v8::Isolate* initializeIsolate(); | 125 virtual v8::Isolate* initializeIsolate(); |
125 virtual void willDestroyIsolate(); | 126 virtual void willDestroyIsolate(); |
126 virtual void destroyIsolate(); | 127 virtual void destroyIsolate(); |
127 virtual void terminateV8Execution(); | 128 virtual void terminateV8Execution(); |
128 | 129 |
129 // This is protected virtual for testing. | 130 // This is protected virtual for testing. |
130 virtual bool doIdleGc(double deadlineSeconds); | 131 virtual bool doIdleGc(double deadlineSeconds); |
131 | 132 |
132 private: | 133 private: |
| 134 friend class WorkerSharedTimer; |
133 friend class WorkerMicrotaskRunner; | 135 friend class WorkerMicrotaskRunner; |
134 | 136 |
135 void stopInShutdownSequence(); | 137 void stopInShutdownSequence(); |
136 void stopInternal(); | 138 void stopInternal(); |
137 | 139 |
138 void initialize(PassOwnPtr<WorkerThreadStartupData>); | 140 void initialize(PassOwnPtr<WorkerThreadStartupData>); |
139 void shutdown(); | 141 void shutdown(); |
140 void performIdleWork(double deadlineSeconds); | 142 void performIdleWork(double deadlineSeconds); |
141 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTas
k>, long long delayMs); | 143 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTas
k>, long long delayMs); |
142 | 144 |
(...skipping 21 matching lines...) Expand all Loading... |
164 // Used to signal thread shutdown. | 166 // Used to signal thread shutdown. |
165 OwnPtr<WebWaitableEvent> m_shutdownEvent; | 167 OwnPtr<WebWaitableEvent> m_shutdownEvent; |
166 | 168 |
167 // Used to signal thread termination. | 169 // Used to signal thread termination. |
168 OwnPtr<WebWaitableEvent> m_terminationEvent; | 170 OwnPtr<WebWaitableEvent> m_terminationEvent; |
169 }; | 171 }; |
170 | 172 |
171 } // namespace blink | 173 } // namespace blink |
172 | 174 |
173 #endif // WorkerThread_h | 175 #endif // WorkerThread_h |
OLD | NEW |