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

Side by Side Diff: content/renderer/shared_worker/embedded_shared_worker_stub.cc

Issue 1974613002: Remove code that was only used by navigator.connect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 4 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shared_worker/embedded_shared_worker_stub.h" 5 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 return RenderThreadImpl::current()->Send(message); 274 return RenderThreadImpl::current()->Send(message);
275 } 275 }
276 276
277 void EmbeddedSharedWorkerStub::ConnectToChannel( 277 void EmbeddedSharedWorkerStub::ConnectToChannel(
278 WebMessagePortChannelImpl* channel) { 278 WebMessagePortChannelImpl* channel) {
279 impl_->connect(channel); 279 impl_->connect(channel);
280 Send( 280 Send(
281 new WorkerHostMsg_WorkerConnected(channel->message_port_id(), route_id_)); 281 new WorkerHostMsg_WorkerConnected(channel->message_port_id(), route_id_));
282 } 282 }
283 283
284 void EmbeddedSharedWorkerStub::OnConnect(int sent_message_port_id, 284 void EmbeddedSharedWorkerStub::OnConnect(int port,
285 int routing_id) { 285 int routing_id) {
286 TransferredMessagePort port;
287 port.id = sent_message_port_id;
288 WebMessagePortChannelImpl* channel = new WebMessagePortChannelImpl( 286 WebMessagePortChannelImpl* channel = new WebMessagePortChannelImpl(
289 routing_id, port, base::ThreadTaskRunnerHandle::Get().get()); 287 routing_id, port, base::ThreadTaskRunnerHandle::Get().get());
290 if (running_) { 288 if (running_) {
291 ConnectToChannel(channel); 289 ConnectToChannel(channel);
292 } else { 290 } else {
293 // If two documents try to load a SharedWorker at the same time, the 291 // If two documents try to load a SharedWorker at the same time, the
294 // WorkerMsg_Connect for one of the documents can come in before the 292 // WorkerMsg_Connect for one of the documents can come in before the
295 // worker is started. Just queue up the connect and deliver it once the 293 // worker is started. Just queue up the connect and deliver it once the
296 // worker starts. 294 // worker starts.
297 pending_channels_.push_back(channel); 295 pending_channels_.push_back(channel);
298 } 296 }
299 } 297 }
300 298
301 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { 299 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() {
302 // After this we wouldn't get any IPC for this stub. 300 // After this we wouldn't get any IPC for this stub.
303 running_ = false; 301 running_ = false;
304 impl_->terminateWorkerContext(); 302 impl_->terminateWorkerContext();
305 } 303 }
306 304
307 } // namespace content 305 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/message_port_types.cc ('k') | third_party/WebKit/Source/core/dom/MessagePort.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698