OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/renderer/websharedworker_proxy.h" | 5 #include "content/renderer/websharedworker_proxy.h" |
6 #include "content/common/child_thread.h" | 6 #include "content/common/child_thread.h" |
7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
8 #include "content/common/webmessageportchannel_impl.h" | 8 #include "content/common/webmessageportchannel_impl.h" |
9 #include "content/common/worker_messages.h" | 9 #include "content/common/worker_messages.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWorkerClient.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWorkerClient.h" |
12 | 12 |
13 WebSharedWorkerProxy::WebSharedWorkerProxy(ChildThread* child_thread, | 13 WebSharedWorkerProxy::WebSharedWorkerProxy(ChildThread* child_thread, |
14 unsigned long long document_id, | 14 unsigned long long document_id, |
15 bool exists, | 15 bool exists, |
16 int route_id, | 16 int route_id, |
17 int render_view_route_id) | 17 int render_view_route_id) |
18 : route_id_(exists ? route_id : MSG_ROUTING_NONE), | 18 : route_id_(exists ? route_id : MSG_ROUTING_NONE), |
19 render_view_route_id_(render_view_route_id), | 19 render_view_route_id_(render_view_route_id), |
20 child_thread_(child_thread), | 20 child_thread_(child_thread), |
21 document_id_(document_id), | 21 document_id_(document_id), |
22 parent_appcache_host_id_(-1), | |
binji
2011/12/20 20:00:06
Why is -1 a safe value for this?
James Hawkins
2011/12/20 20:48:51
moot point, I deleted the variable since it's unus
| |
22 pending_route_id_(route_id), | 23 pending_route_id_(route_id), |
23 connect_listener_(NULL) { | 24 connect_listener_(NULL) { |
24 if (route_id_ != MSG_ROUTING_NONE) | 25 if (route_id_ != MSG_ROUTING_NONE) |
25 child_thread_->AddRoute(route_id_, this); | 26 child_thread_->AddRoute(route_id_, this); |
26 } | 27 } |
27 | 28 |
28 WebSharedWorkerProxy::~WebSharedWorkerProxy() { | 29 WebSharedWorkerProxy::~WebSharedWorkerProxy() { |
29 Disconnect(); | 30 Disconnect(); |
30 | 31 |
31 // Free up any unsent queued messages. | 32 // Free up any unsent queued messages. |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 // The worker is created - now send off the CreateWorkerContext message and | 167 // The worker is created - now send off the CreateWorkerContext message and |
167 // any other queued messages | 168 // any other queued messages |
168 SendQueuedMessages(); | 169 SendQueuedMessages(); |
169 | 170 |
170 // Inform any listener that the pending connect event has been sent | 171 // Inform any listener that the pending connect event has been sent |
171 // (this can result in this object being freed). | 172 // (this can result in this object being freed). |
172 if (connect_listener_) { | 173 if (connect_listener_) { |
173 connect_listener_->connected(); | 174 connect_listener_->connected(); |
174 } | 175 } |
175 } | 176 } |
OLD | NEW |