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

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

Issue 704063002: Terminate and wait the worker thread in ~WebEmbeddedWorkerImpl() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 virtual ~WorkerThread(); 62 virtual ~WorkerThread();
63 63
64 virtual void start(); 64 virtual void start();
65 virtual void stop(); 65 virtual void stop();
66 66
67 // Can be used to wait for this worker thread to shut down. 67 // Can be used to wait for this worker thread to shut down.
68 // (This is signalled on the main thread, so it's assumed to be waited on th e worker context thread) 68 // (This is signalled on the main thread, so it's assumed to be waited on th e worker context thread)
69 WebWaitableEvent* shutdownEvent() { return m_shutdownEvent.get(); } 69 WebWaitableEvent* shutdownEvent() { return m_shutdownEvent.get(); }
70 70
71 WebWaitableEvent* terminationEvent() { return m_terminationEvent.get(); } 71 WebWaitableEvent* terminationEvent() { return m_terminationEvent.get(); }
72 void terminateAndWait();
72 static void terminateAndWaitForAllWorkers(); 73 static void terminateAndWaitForAllWorkers();
73 74
74 bool isCurrentThread() const; 75 bool isCurrentThread() const;
75 WorkerLoaderProxy& workerLoaderProxy() const { return m_workerLoaderProxy; } 76 WorkerLoaderProxy& workerLoaderProxy() const { return m_workerLoaderProxy; }
76 WorkerReportingProxy& workerReportingProxy() const { return m_workerReportin gProxy; } 77 WorkerReportingProxy& workerReportingProxy() const { return m_workerReportin gProxy; }
77 78
78 void postTask(PassOwnPtr<ExecutionContextTask>); 79 void postTask(PassOwnPtr<ExecutionContextTask>);
79 void postDebuggerTask(PassOwnPtr<ExecutionContextTask>); 80 void postDebuggerTask(PassOwnPtr<ExecutionContextTask>);
80 81
81 enum WaitMode { WaitForMessage, DontWaitForMessage }; 82 enum WaitMode { WaitForMessage, DontWaitForMessage };
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // WorkerThread might get deleted before it had a chance to properly 143 // WorkerThread might get deleted before it had a chance to properly
143 // shut down. By deleting the WebThread first, we can guarantee that 144 // shut down. By deleting the WebThread first, we can guarantee that
144 // 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
145 // members during the WorkerThread's destruction. 146 // members during the WorkerThread's destruction.
146 OwnPtr<WebThreadSupportingGC> m_thread; 147 OwnPtr<WebThreadSupportingGC> m_thread;
147 }; 148 };
148 149
149 } // namespace blink 150 } // namespace blink
150 151
151 #endif // WorkerThread_h 152 #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