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

Side by Side Diff: chrome/renderer/webworker_proxy.cc

Issue 266036: Fix another race condition on worker process shutdown that results in use-aft... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « chrome/renderer/webworker_proxy.h ('k') | chrome/worker/nativewebworker_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/webworker_proxy.h" 5 #include "chrome/renderer/webworker_proxy.h"
6 6
7 #include "chrome/common/child_thread.h" 7 #include "chrome/common/child_thread.h"
8 #include "chrome/common/render_messages.h" 8 #include "chrome/common/render_messages.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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 Send(new WorkerMsg_PostMessage( 91 Send(new WorkerMsg_PostMessage(
92 route_id_, message, message_port_ids, routing_ids)); 92 route_id_, message, message_port_ids, routing_ids));
93 } 93 }
94 94
95 void WebWorkerProxy::workerObjectDestroyed() { 95 void WebWorkerProxy::workerObjectDestroyed() {
96 Send(new WorkerMsg_WorkerObjectDestroyed(route_id_)); 96 Send(new WorkerMsg_WorkerObjectDestroyed(route_id_));
97 delete this; 97 delete this;
98 } 98 }
99 99
100 void WebWorkerProxy::clientDestroyed() {
101 }
102
100 bool WebWorkerProxy::Send(IPC::Message* message) { 103 bool WebWorkerProxy::Send(IPC::Message* message) {
101 // It's possible that postMessage is called before the worker is created, in 104 // It's possible that postMessage is called before the worker is created, in
102 // which case route_id_ will be none. Or the worker object can be interacted 105 // which case route_id_ will be none. Or the worker object can be interacted
103 // with before the browser process told us that it started, in which case we 106 // with before the browser process told us that it started, in which case we
104 // also want to queue the message. 107 // also want to queue the message.
105 if (route_id_ == MSG_ROUTING_NONE || !queued_messages_.empty()) { 108 if (route_id_ == MSG_ROUTING_NONE || !queued_messages_.empty()) {
106 queued_messages_.push_back(message); 109 queued_messages_.push_back(message);
107 return true; 110 return true;
108 } 111 }
109 112
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 client_->postMessageToWorkerObject(message, channels); 167 client_->postMessageToWorkerObject(message, channels);
165 } 168 }
166 169
167 void WebWorkerProxy::OnPostConsoleMessageToWorkerObject( 170 void WebWorkerProxy::OnPostConsoleMessageToWorkerObject(
168 const WorkerHostMsg_PostConsoleMessageToWorkerObject_Params& params) { 171 const WorkerHostMsg_PostConsoleMessageToWorkerObject_Params& params) {
169 client_->postConsoleMessageToWorkerObject(params.destination_identifier, 172 client_->postConsoleMessageToWorkerObject(params.destination_identifier,
170 params.source_identifier, params.message_type, params.message_level, 173 params.source_identifier, params.message_type, params.message_level,
171 params.message, params.line_number, params.source_url); 174 params.message, params.line_number, params.source_url);
172 } 175 }
173 176
OLDNEW
« no previous file with comments | « chrome/renderer/webworker_proxy.h ('k') | chrome/worker/nativewebworker_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698