| 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/embedded_worker_instance.h" | 5 #include "content/browser/service_worker/embedded_worker_instance.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 FROM_HERE, | 73 FROM_HERE, |
| 74 base::Bind(callback, worker_devtools_agent_route_id, wait_for_debugger)); | 74 base::Bind(callback, worker_devtools_agent_route_id, wait_for_debugger)); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void SetupMojoOnUIThread( | 77 void SetupMojoOnUIThread( |
| 78 int process_id, | 78 int process_id, |
| 79 int thread_id, | 79 int thread_id, |
| 80 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 80 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 81 mojo::InterfacePtrInfo<mojo::ServiceProvider> exposed_services) { | 81 mojo::InterfacePtrInfo<mojo::ServiceProvider> exposed_services) { |
| 82 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); | 82 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); |
| 83 // |rph| may be NULL in unit tests. | 83 // |rph| or its ServiceRegistry may be NULL in unit tests. |
| 84 if (!rph) | 84 if (!rph || !rph->GetServiceRegistry()) |
| 85 return; | 85 return; |
| 86 EmbeddedWorkerSetupPtr setup; | 86 EmbeddedWorkerSetupPtr setup; |
| 87 rph->GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&setup)); | 87 rph->GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&setup)); |
| 88 setup->ExchangeServiceProviders(thread_id, services.Pass(), | 88 setup->ExchangeServiceProviders(thread_id, services.Pass(), |
| 89 mojo::MakeProxy(exposed_services.Pass())); | 89 mojo::MakeProxy(exposed_services.Pass())); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace | 92 } // namespace |
| 93 | 93 |
| 94 // Lives on IO thread, proxies notifications to DevToolsManager that lives on | 94 // Lives on IO thread, proxies notifications to DevToolsManager that lives on |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 case SCRIPT_READ_FINISHED: | 565 case SCRIPT_READ_FINISHED: |
| 566 return "Script read finished"; | 566 return "Script read finished"; |
| 567 case STARTING_PHASE_MAX_VALUE: | 567 case STARTING_PHASE_MAX_VALUE: |
| 568 NOTREACHED(); | 568 NOTREACHED(); |
| 569 } | 569 } |
| 570 NOTREACHED() << phase; | 570 NOTREACHED() << phase; |
| 571 return std::string(); | 571 return std::string(); |
| 572 } | 572 } |
| 573 | 573 |
| 574 } // namespace content | 574 } // namespace content |
| OLD | NEW |