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

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

Issue 1312583007: Introduce WorkerThread::willShutdown() Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | « no previous file | 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // Factory method for creating a new worker context for the thread. 126 // Factory method for creating a new worker context for the thread.
127 virtual PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(Pa ssOwnPtr<WorkerThreadStartupData>) = 0; 127 virtual PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(Pa ssOwnPtr<WorkerThreadStartupData>) = 0;
128 128
129 virtual void postInitialize() { } 129 virtual void postInitialize() { }
130 130
131 // Both of these methods are called in the worker thread. 131 // Both of these methods are called in the worker thread.
132 virtual void initializeBackingThread(); 132 virtual void initializeBackingThread();
133 virtual void shutdownBackingThread(); 133 virtual void shutdownBackingThread();
134 134
135 virtual v8::Isolate* initializeIsolate(); 135 virtual v8::Isolate* initializeIsolate();
136 // willShutdown() is called just before dispoing WorkerGlobalScope and its
137 // WorkerScriptController. If you want to run any clean-up task that needs t o
138 // interact with JavaScript, you should run the task in willShutdown().
139 virtual void willShutdown();
140 // willDestroyIsolate() is called after disposing WorkerGlobalScope (and its
141 // WorkerScriptController) but before dispoing an Isolate.
136 virtual void willDestroyIsolate(); 142 virtual void willDestroyIsolate();
137 virtual void destroyIsolate(); 143 virtual void destroyIsolate();
138 virtual void terminateV8Execution(); 144 virtual void terminateV8Execution();
139 145
140 // This is protected virtual for testing. 146 // This is protected virtual for testing.
141 virtual bool doIdleGc(double deadlineSeconds); 147 virtual bool doIdleGc(double deadlineSeconds);
142 148
143 private: 149 private:
144 friend class WorkerMicrotaskRunner; 150 friend class WorkerMicrotaskRunner;
145 151
(...skipping 30 matching lines...) Expand all
176 // Used to signal thread shutdown. 182 // Used to signal thread shutdown.
177 OwnPtr<WebWaitableEvent> m_shutdownEvent; 183 OwnPtr<WebWaitableEvent> m_shutdownEvent;
178 184
179 // Used to signal thread termination. 185 // Used to signal thread termination.
180 OwnPtr<WebWaitableEvent> m_terminationEvent; 186 OwnPtr<WebWaitableEvent> m_terminationEvent;
181 }; 187 };
182 188
183 } // namespace blink 189 } // namespace blink
184 190
185 #endif // WorkerThread_h 191 #endif // WorkerThread_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698