Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: Source/core/workers/WorkerThread.h

Issue 469683002: Implement WebThreadSupportingGC, which wraps a WebThread attached to Oilpan's GC (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/parser/HTMLParserThread.cpp ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 * 24 *
25 */ 25 */
26 26
27 #ifndef WorkerThread_h 27 #ifndef WorkerThread_h
28 #define WorkerThread_h 28 #define WorkerThread_h
29 29
30 #include "core/dom/ExecutionContextTask.h" 30 #include "core/dom/ExecutionContextTask.h"
31 #include "core/frame/csp/ContentSecurityPolicy.h" 31 #include "core/frame/csp/ContentSecurityPolicy.h"
32 #include "core/workers/WorkerGlobalScope.h" 32 #include "core/workers/WorkerGlobalScope.h"
33 #include "platform/SharedTimer.h" 33 #include "platform/SharedTimer.h"
34 #include "platform/heap/glue/MessageLoopInterruptor.h" 34 #include "platform/WebThreadSupportingGC.h"
35 #include "platform/heap/glue/PendingGCRunner.h"
36 #include "platform/weborigin/SecurityOrigin.h" 35 #include "platform/weborigin/SecurityOrigin.h"
37 #include "public/platform/WebThread.h"
38 #include "wtf/Forward.h" 36 #include "wtf/Forward.h"
39 #include "wtf/MessageQueue.h" 37 #include "wtf/MessageQueue.h"
40 #include "wtf/OwnPtr.h" 38 #include "wtf/OwnPtr.h"
41 #include "wtf/PassRefPtr.h" 39 #include "wtf/PassRefPtr.h"
42 #include "wtf/RefCounted.h" 40 #include "wtf/RefCounted.h"
43 41
44 namespace blink { 42 namespace blink {
45 class WebWaitableEvent; 43 class WebWaitableEvent;
46 } 44 }
47 45
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 void stopInternal(); 114 void stopInternal();
117 115
118 void initialize(); 116 void initialize();
119 void cleanup(); 117 void cleanup();
120 void idleHandler(); 118 void idleHandler();
121 void postDelayedTask(PassOwnPtr<ExecutionContextTask>, long long delayMs ); 119 void postDelayedTask(PassOwnPtr<ExecutionContextTask>, long long delayMs );
122 120
123 bool m_terminated; 121 bool m_terminated;
124 OwnPtr<WorkerSharedTimer> m_sharedTimer; 122 OwnPtr<WorkerSharedTimer> m_sharedTimer;
125 MessageQueue<WorkerThreadTask> m_debuggerMessageQueue; 123 MessageQueue<WorkerThreadTask> m_debuggerMessageQueue;
126 OwnPtr<PendingGCRunner> m_pendingGCRunner;
127 OwnPtr<WebThread::TaskObserver> m_microtaskRunner; 124 OwnPtr<WebThread::TaskObserver> m_microtaskRunner;
128 OwnPtr<MessageLoopInterruptor> m_messageLoopInterruptor;
129 125
130 WorkerLoaderProxy& m_workerLoaderProxy; 126 WorkerLoaderProxy& m_workerLoaderProxy;
131 WorkerReportingProxy& m_workerReportingProxy; 127 WorkerReportingProxy& m_workerReportingProxy;
132 128
133 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorContr oller; 129 RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorContr oller;
134 Mutex m_workerInspectorControllerMutex; 130 Mutex m_workerInspectorControllerMutex;
135 131
136 Mutex m_threadCreationMutex; 132 Mutex m_threadCreationMutex;
137 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope; 133 RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope;
138 OwnPtrWillBePersistent<WorkerThreadStartupData> m_startupData; 134 OwnPtrWillBePersistent<WorkerThreadStartupData> m_startupData;
139 135
140 // Used to signal thread shutdown. 136 // Used to signal thread shutdown.
141 OwnPtr<blink::WebWaitableEvent> m_shutdownEvent; 137 OwnPtr<blink::WebWaitableEvent> m_shutdownEvent;
142 138
143 // Used to signal thread termination. 139 // Used to signal thread termination.
144 OwnPtr<blink::WebWaitableEvent> m_terminationEvent; 140 OwnPtr<blink::WebWaitableEvent> m_terminationEvent;
145 141
146 // FIXME: This has to be last because of crbug.com/401397 - the 142 // FIXME: This has to be last because of crbug.com/401397 - the
147 // WorkerThread might get deleted before it had a chance to properly 143 // WorkerThread might get deleted before it had a chance to properly
148 // shut down. By deleting the WebThread first, we can guarantee that 144 // shut down. By deleting the WebThread first, we can guarantee that
149 // no pending tasks on the thread might want to access any of the other 145 // no pending tasks on the thread might want to access any of the other
150 // members during the WorkerThread's destruction. 146 // members during the WorkerThread's destruction.
151 OwnPtr<blink::WebThread> m_thread; 147 OwnPtr<WebThreadSupportingGC> m_thread;
152 }; 148 };
153 149
154 } // namespace blink 150 } // namespace blink
155 151
156 #endif // WorkerThread_h 152 #endif // WorkerThread_h
OLDNEW
« no previous file with comments | « Source/core/html/parser/HTMLParserThread.cpp ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698