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

Side by Side Diff: chrome/worker/webworkerclient_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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/worker/webworkerclient_proxy.h" 5 #include "chrome/worker/webworkerclient_proxy.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 #include "chrome/common/webmessageportchannel_impl.h" 9 #include "chrome/common/webmessageportchannel_impl.h"
10 #include "chrome/common/worker_messages.h" 10 #include "chrome/common/worker_messages.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 Send(new WorkerHostMsg_ConfirmMessageFromWorkerObject( 85 Send(new WorkerHostMsg_ConfirmMessageFromWorkerObject(
86 route_id_, has_pending_activity)); 86 route_id_, has_pending_activity));
87 } 87 }
88 88
89 void WebWorkerClientProxy::reportPendingActivity(bool has_pending_activity) { 89 void WebWorkerClientProxy::reportPendingActivity(bool has_pending_activity) {
90 Send(new WorkerHostMsg_ReportPendingActivity( 90 Send(new WorkerHostMsg_ReportPendingActivity(
91 route_id_, has_pending_activity)); 91 route_id_, has_pending_activity));
92 } 92 }
93 93
94 void WebWorkerClientProxy::workerContextClosed() { 94 void WebWorkerClientProxy::workerContextClosed() {
95 // TODO(atwilson): Notify WorkerProcessHost that the worker context is closing 95 Send(new WorkerHostMsg_WorkerContextClosed(route_id_));
96 // (needed for shared workers so we don't allow new connections).
97 } 96 }
98 97
99 void WebWorkerClientProxy::workerContextDestroyed() { 98 void WebWorkerClientProxy::workerContextDestroyed() {
100 Send(new WorkerHostMsg_WorkerContextDestroyed(route_id_)); 99 Send(new WorkerHostMsg_WorkerContextDestroyed(route_id_));
101 // Tell the stub that the worker has shutdown - frees this object. 100 // Tell the stub that the worker has shutdown - frees this object.
102 if (stub_) 101 if (stub_)
103 stub_->Shutdown(); 102 stub_->Shutdown();
104 } 103 }
105 104
106 WebKit::WebWorker* WebWorkerClientProxy::createWorker( 105 WebKit::WebWorker* WebWorkerClientProxy::createWorker(
(...skipping 17 matching lines...) Expand all
124 123
125 // This shuts down the process cleanly from the perspective of the browser 124 // This shuts down the process cleanly from the perspective of the browser
126 // process, and avoids the crashed worker infobar from appearing to the new 125 // process, and avoids the crashed worker infobar from appearing to the new
127 // page. 126 // page.
128 MessageLoop::current()->PostDelayedTask(FROM_HERE, 127 MessageLoop::current()->PostDelayedTask(FROM_HERE,
129 kill_process_factory_.NewRunnableMethod( 128 kill_process_factory_.NewRunnableMethod(
130 &WebWorkerClientProxy::workerContextDestroyed), 129 &WebWorkerClientProxy::workerContextDestroyed),
131 kMaxTimeForRunawayWorkerMs); 130 kMaxTimeForRunawayWorkerMs);
132 } 131 }
133 132
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698