| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/service_worker/service_worker_provider_host.h" | 5 #include "content/browser/service_worker/service_worker_provider_host.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 if (running_hosted_version_.get()) | 371 if (running_hosted_version_.get()) |
| 372 return false; | 372 return false; |
| 373 if (!registration || associated_registration_.get() || !allow_association_) | 373 if (!registration || associated_registration_.get() || !allow_association_) |
| 374 return false; | 374 return false; |
| 375 return true; | 375 return true; |
| 376 } | 376 } |
| 377 | 377 |
| 378 void ServiceWorkerProviderHost::PostMessageToClient( | 378 void ServiceWorkerProviderHost::PostMessageToClient( |
| 379 ServiceWorkerVersion* version, | 379 ServiceWorkerVersion* version, |
| 380 const base::string16& message, | 380 const base::string16& message, |
| 381 const std::vector<TransferredMessagePort>& sent_message_ports) { | 381 const std::vector<int>& sent_message_ports) { |
| 382 if (!dispatcher_host_) | 382 if (!dispatcher_host_) |
| 383 return; // Could be NULL in some tests. | 383 return; // Could be NULL in some tests. |
| 384 | 384 |
| 385 std::vector<int> new_routing_ids; | 385 std::vector<int> new_routing_ids; |
| 386 dispatcher_host_->message_port_message_filter()-> | 386 dispatcher_host_->message_port_message_filter()-> |
| 387 UpdateMessagePortsWithNewRoutes(sent_message_ports, | 387 UpdateMessagePortsWithNewRoutes(sent_message_ports, |
| 388 &new_routing_ids); | 388 &new_routing_ids); |
| 389 | 389 |
| 390 ServiceWorkerMsg_MessageToDocument_Params params; | 390 ServiceWorkerMsg_MessageToDocument_Params params; |
| 391 params.thread_id = kDocumentMainThreadId; | 391 params.thread_id = kDocumentMainThreadId; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 Send(new ServiceWorkerMsg_SetControllerServiceWorker( | 646 Send(new ServiceWorkerMsg_SetControllerServiceWorker( |
| 647 render_thread_id_, provider_id(), | 647 render_thread_id_, provider_id(), |
| 648 GetOrCreateServiceWorkerHandle( | 648 GetOrCreateServiceWorkerHandle( |
| 649 associated_registration_->active_version()), | 649 associated_registration_->active_version()), |
| 650 false /* shouldNotifyControllerChange */)); | 650 false /* shouldNotifyControllerChange */)); |
| 651 } | 651 } |
| 652 } | 652 } |
| 653 } | 653 } |
| 654 | 654 |
| 655 } // namespace content | 655 } // namespace content |
| OLD | NEW |