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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 void setWorkerInspectorController(WorkerInspectorController*); | 114 void setWorkerInspectorController(WorkerInspectorController*); |
115 | 115 |
116 protected: | 116 protected: |
117 WorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerReportingProxy&); | 117 WorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerReportingProxy&); |
118 | 118 |
119 // Factory method for creating a new worker context for the thread. | 119 // Factory method for creating a new worker context for the thread. |
120 virtual PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(Pa
ssOwnPtr<WorkerThreadStartupData>) = 0; | 120 virtual PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(Pa
ssOwnPtr<WorkerThreadStartupData>) = 0; |
121 | 121 |
122 virtual void postInitialize() { } | 122 virtual void postInitialize() { } |
123 | 123 |
124 // Both of these methods are called in the worker thread. | |
125 virtual void initializeBackingThread(); | |
126 virtual void shutdownBackingThread(); | |
127 | |
128 virtual v8::Isolate* initializeIsolate(); | 124 virtual v8::Isolate* initializeIsolate(); |
129 virtual void willDestroyIsolate(); | 125 virtual void willDestroyIsolate(); |
130 virtual void destroyIsolate(); | 126 virtual void destroyIsolate(); |
131 virtual void terminateV8Execution(); | 127 virtual void terminateV8Execution(); |
132 | 128 |
133 // This is protected virtual for testing. | 129 // This is protected virtual for testing. |
134 virtual bool doIdleGc(double deadlineSeconds); | 130 virtual bool doIdleGc(double deadlineSeconds); |
135 | 131 |
136 private: | 132 private: |
137 friend class WorkerMicrotaskRunner; | 133 friend class WorkerMicrotaskRunner; |
(...skipping 30 matching lines...) Expand all Loading... |
168 // Used to signal thread shutdown. | 164 // Used to signal thread shutdown. |
169 OwnPtr<WebWaitableEvent> m_shutdownEvent; | 165 OwnPtr<WebWaitableEvent> m_shutdownEvent; |
170 | 166 |
171 // Used to signal thread termination. | 167 // Used to signal thread termination. |
172 OwnPtr<WebWaitableEvent> m_terminationEvent; | 168 OwnPtr<WebWaitableEvent> m_terminationEvent; |
173 }; | 169 }; |
174 | 170 |
175 } // namespace blink | 171 } // namespace blink |
176 | 172 |
177 #endif // WorkerThread_h | 173 #endif // WorkerThread_h |
OLD | NEW |