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

Unified Diff: chrome/renderer/webworker_proxy.cc

Issue 390017: Added lifecycle management and sharing support for SharedWorkers. SharedWorkers (Closed)
Patch Set: Changed WebWorkerBase not not call a virtual function from the destructor Created 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/webworker_proxy.cc
diff --git a/chrome/renderer/webworker_proxy.cc b/chrome/renderer/webworker_proxy.cc
index a263565e9361cc02955bf6c9fde344b560f6b8c9..fdcc9f1d0dc55b2be736363c66743d75a5ea2f1e 100644
--- a/chrome/renderer/webworker_proxy.cc
+++ b/chrome/renderer/webworker_proxy.cc
@@ -26,16 +26,18 @@ WebWorkerProxy::WebWorkerProxy(
client_(client) {
}
-void WebWorkerProxy::Disconnect() {
+WebWorkerProxy::~WebWorkerProxy() {
+ // If we're midway through starting a worker, cancel it.
+ CancelCreation();
+}
+
+void WebWorkerProxy::CancelCreation() {
if (route_id_ == MSG_ROUTING_NONE)
return;
// Tell the browser to not start our queued worker.
if (!IsStarted())
child_thread_->Send(new ViewHostMsg_CancelCreateDedicatedWorker(route_id_));
-
- // Call our superclass to shutdown the routing
- WebWorkerBase::Disconnect();
}
void WebWorkerProxy::startWorkerContext(
@@ -48,6 +50,7 @@ void WebWorkerProxy::startWorkerContext(
void WebWorkerProxy::terminateWorkerContext() {
if (route_id_ != MSG_ROUTING_NONE) {
Send(new WorkerMsg_TerminateWorkerContext(route_id_));
+ CancelCreation();
Disconnect();
}
}

Powered by Google App Engine
This is Rietveld 408576698