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

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

Issue 150152: Test reply by email2 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | « no previous file | no next file » | 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/worker_messages.h" 9 #include "chrome/common/worker_messages.h"
10 #include "webkit/api/public/WebURL.h" 10 #include "webkit/api/public/WebURL.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // have already been called. 51 // have already been called.
52 queued_messages_.insert(queued_messages_.begin(), 52 queued_messages_.insert(queued_messages_.begin(),
53 new WorkerMsg_StartWorkerContext( 53 new WorkerMsg_StartWorkerContext(
54 route_id_, script_url, user_agent, source_code)); 54 route_id_, script_url, user_agent, source_code));
55 } 55 }
56 56
57 void WebWorkerProxy::terminateWorkerContext() { 57 void WebWorkerProxy::terminateWorkerContext() {
58 if (route_id_ != MSG_ROUTING_NONE) { 58 if (route_id_ != MSG_ROUTING_NONE) {
59 Send(new WorkerMsg_TerminateWorkerContext(route_id_)); 59 Send(new WorkerMsg_TerminateWorkerContext(route_id_));
60 child_thread_->RemoveRoute(route_id_); 60 child_thread_->RemoveRoute(route_id_);
61 if (!queued_messages_.empty()) {
62 child_thread_->Send(
63 new ViewHostMsg_CancelCreateDedicatedWorker(route_id_));
64 }
61 route_id_ = MSG_ROUTING_NONE; 65 route_id_ = MSG_ROUTING_NONE;
62 } 66 }
63 } 67 }
64 68
65 void WebWorkerProxy::postMessageToWorkerContext( 69 void WebWorkerProxy::postMessageToWorkerContext(
66 const WebString& message) { 70 const WebString& message) {
67 Send(new WorkerMsg_PostMessageToWorkerContext(route_id_, message)); 71 Send(new WorkerMsg_PostMessageToWorkerContext(route_id_, message));
68 } 72 }
69 73
70 void WebWorkerProxy::workerObjectDestroyed() { 74 void WebWorkerProxy::workerObjectDestroyed() {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 124
121 void WebWorkerProxy::OnDedicatedWorkerCreated() { 125 void WebWorkerProxy::OnDedicatedWorkerCreated() {
122 DCHECK(queued_messages_.size()); 126 DCHECK(queued_messages_.size());
123 std::vector<IPC::Message*> queued_messages = queued_messages_; 127 std::vector<IPC::Message*> queued_messages = queued_messages_;
124 queued_messages_.clear(); 128 queued_messages_.clear();
125 for (size_t i = 0; i < queued_messages.size(); ++i) { 129 for (size_t i = 0; i < queued_messages.size(); ++i) {
126 queued_messages[i]->set_routing_id(route_id_); 130 queued_messages[i]->set_routing_id(route_id_);
127 Send(queued_messages[i]); 131 Send(queued_messages[i]);
128 } 132 }
129 } 133 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698