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

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

Issue 509016: Refactored code to allow associating workers with multiple renderers. (Closed)
Patch Set: Disabled overly-aggressive assertion in ResourceDispatcherHost. Created 10 years, 11 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
« no previous file with comments | « chrome/renderer/webworker_base.cc ('k') | chrome/test/data/workers/shared_worker_auth.html » ('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"
11 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" 11 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
12 #include "third_party/WebKit/WebKit/chromium/public/WebWorkerClient.h" 12 #include "third_party/WebKit/WebKit/chromium/public/WebWorkerClient.h"
13 13
14 using WebKit::WebCommonWorkerClient; 14 using WebKit::WebCommonWorkerClient;
15 using WebKit::WebMessagePortChannel; 15 using WebKit::WebMessagePortChannel;
16 using WebKit::WebMessagePortChannelArray; 16 using WebKit::WebMessagePortChannelArray;
17 using WebKit::WebString; 17 using WebKit::WebString;
18 using WebKit::WebURL; 18 using WebKit::WebURL;
19 using WebKit::WebWorkerClient; 19 using WebKit::WebWorkerClient;
20 20
21 WebWorkerProxy::WebWorkerProxy( 21 WebWorkerProxy::WebWorkerProxy(
22 WebWorkerClient* client, 22 WebWorkerClient* client,
23 ChildThread* child_thread, 23 ChildThread* child_thread,
24 int render_view_route_id) 24 int render_view_route_id)
25 : WebWorkerBase(child_thread, MSG_ROUTING_NONE, render_view_route_id), 25 : WebWorkerBase(child_thread, 0, MSG_ROUTING_NONE, render_view_route_id),
26 client_(client) { 26 client_(client) {
27 // TODO(atwilson): Change to pass in a real document_id when we support nested
28 // workers.
27 } 29 }
28 30
29 WebWorkerProxy::~WebWorkerProxy() { 31 WebWorkerProxy::~WebWorkerProxy() {
30 // If we're midway through starting a worker, cancel it. 32 // If we're midway through starting a worker, cancel it.
31 CancelCreation(); 33 CancelCreation();
32 } 34 }
33 35
34 void WebWorkerProxy::CancelCreation() { 36 void WebWorkerProxy::CancelCreation() {
35 if (route_id_ == MSG_ROUTING_NONE) 37 if (route_id_ == MSG_ROUTING_NONE)
36 return; 38 return;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 client_->postMessageToWorkerObject(message, channels); 126 client_->postMessageToWorkerObject(message, channels);
125 } 127 }
126 128
127 void WebWorkerProxy::OnPostConsoleMessageToWorkerObject( 129 void WebWorkerProxy::OnPostConsoleMessageToWorkerObject(
128 const WorkerHostMsg_PostConsoleMessageToWorkerObject_Params& params) { 130 const WorkerHostMsg_PostConsoleMessageToWorkerObject_Params& params) {
129 client_->postConsoleMessageToWorkerObject(params.destination_identifier, 131 client_->postConsoleMessageToWorkerObject(params.destination_identifier,
130 params.source_identifier, params.message_type, params.message_level, 132 params.source_identifier, params.message_type, params.message_level,
131 params.message, params.line_number, params.source_url); 133 params.message, params.line_number, params.source_url);
132 } 134 }
133 135
OLDNEW
« no previous file with comments | « chrome/renderer/webworker_base.cc ('k') | chrome/test/data/workers/shared_worker_auth.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698