OLD | NEW |
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 Loading... |
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->FilterConnectionMessage(route_id, sent_message_port_id, |
| 335 filter)) |
334 return; | 336 return; |
335 } | 337 } |
336 } | 338 } |
337 | 339 |
338 void SharedWorkerServiceImpl::DocumentDetached( | 340 void SharedWorkerServiceImpl::DocumentDetached( |
339 unsigned long long document_id, | 341 unsigned long long document_id, |
340 SharedWorkerMessageFilter* filter) { | 342 SharedWorkerMessageFilter* filter) { |
341 ScopedWorkerDependencyChecker checker(this); | 343 ScopedWorkerDependencyChecker checker(this); |
342 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin(); | 344 for (WorkerHostMap::const_iterator iter = worker_hosts_.begin(); |
343 iter != worker_hosts_.end(); | 345 iter != worker_hosts_.end(); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 UpdateWorkerDependencyFunc new_func) { | 674 UpdateWorkerDependencyFunc new_func) { |
673 update_worker_dependency_ = new_func; | 675 update_worker_dependency_ = new_func; |
674 } | 676 } |
675 | 677 |
676 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( | 678 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( |
677 bool (*new_func)(int)) { | 679 bool (*new_func)(int)) { |
678 s_try_increment_worker_ref_count_ = new_func; | 680 s_try_increment_worker_ref_count_ = new_func; |
679 } | 681 } |
680 | 682 |
681 } // namespace content | 683 } // namespace content |
OLD | NEW |