| 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; | |
| 52 class WorkerThreadStartupData; | 51 class WorkerThreadStartupData; |
| 53 | 52 |
| 54 enum WorkerThreadStartMode { | 53 enum WorkerThreadStartMode { |
| 55 DontPauseWorkerGlobalScopeOnStart, | 54 DontPauseWorkerGlobalScopeOnStart, |
| 56 PauseWorkerGlobalScopeOnStart | 55 PauseWorkerGlobalScopeOnStart |
| 57 }; | 56 }; |
| 58 | 57 |
| 59 // TODO(sadrul): Rename to WorkerScript. | 58 // TODO(sadrul): Rename to WorkerScript. |
| 60 class CORE_EXPORT WorkerThread : public RefCounted<WorkerThread> { | 59 class CORE_EXPORT WorkerThread : public RefCounted<WorkerThread> { |
| 61 public: | 60 public: |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 123 |
| 125 virtual v8::Isolate* initializeIsolate(); | 124 virtual v8::Isolate* initializeIsolate(); |
| 126 virtual void willDestroyIsolate(); | 125 virtual void willDestroyIsolate(); |
| 127 virtual void destroyIsolate(); | 126 virtual void destroyIsolate(); |
| 128 virtual void terminateV8Execution(); | 127 virtual void terminateV8Execution(); |
| 129 | 128 |
| 130 // This is protected virtual for testing. | 129 // This is protected virtual for testing. |
| 131 virtual bool doIdleGc(double deadlineSeconds); | 130 virtual bool doIdleGc(double deadlineSeconds); |
| 132 | 131 |
| 133 private: | 132 private: |
| 134 friend class WorkerSharedTimer; | |
| 135 friend class WorkerMicrotaskRunner; | 133 friend class WorkerMicrotaskRunner; |
| 136 | 134 |
| 137 void stopInShutdownSequence(); | 135 void stopInShutdownSequence(); |
| 138 void stopInternal(); | 136 void stopInternal(); |
| 139 | 137 |
| 140 void initialize(PassOwnPtr<WorkerThreadStartupData>); | 138 void initialize(PassOwnPtr<WorkerThreadStartupData>); |
| 141 void shutdown(); | 139 void shutdown(); |
| 142 void performIdleWork(double deadlineSeconds); | 140 void performIdleWork(double deadlineSeconds); |
| 143 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTas
k>, long long delayMs); | 141 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTas
k>, long long delayMs); |
| 144 | 142 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 166 // Used to signal thread shutdown. | 164 // Used to signal thread shutdown. |
| 167 OwnPtr<WebWaitableEvent> m_shutdownEvent; | 165 OwnPtr<WebWaitableEvent> m_shutdownEvent; |
| 168 | 166 |
| 169 // Used to signal thread termination. | 167 // Used to signal thread termination. |
| 170 OwnPtr<WebWaitableEvent> m_terminationEvent; | 168 OwnPtr<WebWaitableEvent> m_terminationEvent; |
| 171 }; | 169 }; |
| 172 | 170 |
| 173 } // namespace blink | 171 } // namespace blink |
| 174 | 172 |
| 175 #endif // WorkerThread_h | 173 #endif // WorkerThread_h |
| OLD | NEW |