Chromium Code Reviews| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 void didLeaveNestedLoop(); | 87 void didLeaveNestedLoop(); |
| 88 | 88 |
| 89 WorkerGlobalScope* workerGlobalScope() const { return m_workerGlobalScop e.get(); } | 89 WorkerGlobalScope* workerGlobalScope() const { return m_workerGlobalScop e.get(); } |
| 90 bool terminated() const { return m_terminated; } | 90 bool terminated() const { return m_terminated; } |
| 91 | 91 |
| 92 // Number of active worker threads. | 92 // Number of active worker threads. |
| 93 static unsigned workerThreadCount(); | 93 static unsigned workerThreadCount(); |
| 94 | 94 |
| 95 void interruptAndDispatchInspectorCommands(); | 95 void interruptAndDispatchInspectorCommands(); |
| 96 void setWorkerInspectorController(WorkerInspectorController*); | 96 void setWorkerInspectorController(WorkerInspectorController*); |
| 97 unsigned decrementAndReturnTaskCount(); | |
|
jochen (gone - plz use gerrit)
2014/09/02 10:14:14
those should all be private
Mayur Kankanwadi
2014/09/03 11:26:22
These functions are accessed from within the Worke
| |
| 98 unsigned taskCount(); | |
| 99 void queueUpIdleHandlerNow(); | |
| 100 void decrementTaskCount(); | |
| 101 bool isIdleHandlerTaskFiredOnce(); | |
| 97 | 102 |
| 98 protected: | 103 protected: |
| 99 WorkerThread(WorkerLoaderProxy&, WorkerReportingProxy&, PassOwnPtrWillBe RawPtr<WorkerThreadStartupData>); | 104 WorkerThread(WorkerLoaderProxy&, WorkerReportingProxy&, PassOwnPtrWillBe RawPtr<WorkerThreadStartupData>); |
| 100 | 105 |
| 101 // Factory method for creating a new worker context for the thread. | 106 // Factory method for creating a new worker context for the thread. |
| 102 virtual PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScop e(PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>) = 0; | 107 virtual PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScop e(PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>) = 0; |
| 103 | 108 |
| 104 virtual void postInitialize() { } | 109 virtual void postInitialize() { } |
| 105 | 110 |
| 106 private: | 111 private: |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 124 | 129 |
| 125 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorContr oller; | 130 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorContr oller; |
| 126 Mutex m_workerInspectorControllerMutex; | 131 Mutex m_workerInspectorControllerMutex; |
| 127 | 132 |
| 128 Mutex m_threadCreationMutex; | 133 Mutex m_threadCreationMutex; |
| 129 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope; | 134 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope; |
| 130 OwnPtrWillBePersistent<WorkerThreadStartupData> m_startupData; | 135 OwnPtrWillBePersistent<WorkerThreadStartupData> m_startupData; |
| 131 | 136 |
| 132 // Used to signal thread shutdown. | 137 // Used to signal thread shutdown. |
| 133 OwnPtr<blink::WebWaitableEvent> m_shutdownEvent; | 138 OwnPtr<blink::WebWaitableEvent> m_shutdownEvent; |
| 139 Mutex m_taskCounterMutex; | |
| 140 unsigned m_tasksCount; | |
| 141 bool m_isIdleHandlerTaskFiredOnce; | |
| 142 bool m_isIdleHandlerTask; | |
| 134 | 143 |
| 135 // FIXME: This has to be last because of crbug.com/401397 - the | 144 // FIXME: This has to be last because of crbug.com/401397 - the |
| 136 // WorkerThread might get deleted before it had a chance to properly | 145 // WorkerThread might get deleted before it had a chance to properly |
| 137 // shut down. By deleting the WebThread first, we can guarantee that | 146 // shut down. By deleting the WebThread first, we can guarantee that |
| 138 // no pending tasks on the thread might want to access any of the other | 147 // no pending tasks on the thread might want to access any of the other |
| 139 // members during the WorkerThread's destruction. | 148 // members during the WorkerThread's destruction. |
| 140 OwnPtr<blink::WebThread> m_thread; | 149 OwnPtr<blink::WebThread> m_thread; |
| 141 }; | 150 }; |
| 142 | 151 |
| 143 } // namespace blink | 152 } // namespace blink |
| 144 | 153 |
| 145 #endif // WorkerThread_h | 154 #endif // WorkerThread_h |
| OLD | NEW |