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

Side by Side Diff: content/browser/shared_worker/shared_worker_service_impl.cc

Issue 2601893002: SharedWorker: Remove message forwarding mechanism (Closed)
Patch Set: Created 3 years, 12 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/browser/shared_worker/shared_worker_service_impl.h" 5 #include "content/browser/shared_worker/shared_worker_service_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 return blink::WebWorkerCreationErrorSecureContextMismatch; 317 return blink::WebWorkerCreationErrorSecureContextMismatch;
318 return blink::WebWorkerCreationErrorNone; 318 return blink::WebWorkerCreationErrorNone;
319 } 319 }
320 320
321 std::unique_ptr<SharedWorkerPendingInstance> pending_instance( 321 std::unique_ptr<SharedWorkerPendingInstance> pending_instance(
322 new SharedWorkerPendingInstance(std::move(instance))); 322 new SharedWorkerPendingInstance(std::move(instance)));
323 pending_instance->AddRequest(std::move(request)); 323 pending_instance->AddRequest(std::move(request));
324 return ReserveRenderProcessToCreateWorker(std::move(pending_instance)); 324 return ReserveRenderProcessToCreateWorker(std::move(pending_instance));
325 } 325 }
326 326
327 void SharedWorkerServiceImpl::ForwardToWorker( 327 void SharedWorkerServiceImpl::ConnectToWorker(
328 const IPC::Message& message, 328 int route_id,
329 int sent_message_port_id,
329 SharedWorkerMessageFilter* filter) { 330 SharedWorkerMessageFilter* filter) {
330 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin(); 331 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin();
331 iter != worker_hosts_.end(); 332 iter != worker_hosts_.end();
332 ++iter) { 333 ++iter) {
333 if (iter->second->FilterMessage(message, filter)) 334 if (iter->second->CanHandleMessage(route_id, filter)) {
kinuko 2017/01/05 04:28:25 It feels this method doesn't need to be split from
nhiroki 2017/01/05 08:40:54 Done.
335 iter->second->Connect(route_id, sent_message_port_id, filter);
334 return; 336 return;
337 }
335 } 338 }
336 } 339 }
337 340
338 void SharedWorkerServiceImpl::DocumentDetached( 341 void SharedWorkerServiceImpl::DocumentDetached(
339 unsigned long long document_id, 342 unsigned long long document_id,
340 SharedWorkerMessageFilter* filter) { 343 SharedWorkerMessageFilter* filter) {
341 ScopedWorkerDependencyChecker checker(this); 344 ScopedWorkerDependencyChecker checker(this);
342 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin(); 345 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin();
343 iter != worker_hosts_.end(); 346 iter != worker_hosts_.end();
344 ++iter) { 347 ++iter) {
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 UpdateWorkerDependencyFunc new_func) { 675 UpdateWorkerDependencyFunc new_func) {
673 update_worker_dependency_ = new_func; 676 update_worker_dependency_ = new_func;
674 } 677 }
675 678
676 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( 679 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting(
677 bool (*new_func)(int)) { 680 bool (*new_func)(int)) {
678 s_try_increment_worker_ref_count_ = new_func; 681 s_try_increment_worker_ref_count_ = new_func;
679 } 682 }
680 683
681 } // namespace content 684 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698