| 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/devtools/service_worker_devtools_manager.h" | 5 #include "content/browser/devtools/service_worker_devtools_manager.h" |
| 6 | 6 |
| 7 #include "content/browser/devtools/devtools_manager.h" | 7 #include "content/browser/devtools/devtools_manager.h" |
| 8 #include "content/browser/devtools/ipc_devtools_agent_host.h" | 8 #include "content/browser/devtools/ipc_devtools_agent_host.h" |
| 9 #include "content/browser/devtools/service_worker_devtools_agent_host.h" | 9 #include "content/browser/devtools/service_worker_devtools_agent_host.h" |
| 10 #include "content/browser/devtools/shared_worker_devtools_agent_host.h" | 10 #include "content/browser/devtools/shared_worker_devtools_agent_host.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool ServiceWorkerDevToolsManager::WorkerCreated( | 53 bool ServiceWorkerDevToolsManager::WorkerCreated( |
| 54 int worker_process_id, | 54 int worker_process_id, |
| 55 int worker_route_id, | 55 int worker_route_id, |
| 56 const ServiceWorkerIdentifier& service_worker_id) { | 56 const ServiceWorkerIdentifier& service_worker_id) { |
| 57 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 57 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 58 const WorkerId id(worker_process_id, worker_route_id); | 58 const WorkerId id(worker_process_id, worker_route_id); |
| 59 AgentHostMap::iterator it = FindExistingWorkerAgentHost(service_worker_id); | 59 AgentHostMap::iterator it = FindExistingWorkerAgentHost(service_worker_id); |
| 60 if (it == workers().end()) { | 60 if (it == workers().end()) { |
| 61 workers()[id] = new ServiceWorkerDevToolsAgentHost( | 61 WorkerDevToolsManager::WorkerCreated(id, |
| 62 id, service_worker_id, debug_service_worker_on_start_); | 62 new ServiceWorkerDevToolsAgentHost(id, service_worker_id, |
| 63 DevToolsManager::GetInstance()->AgentHostChanged(workers()[id]); | 63 debug_service_worker_on_start_)); |
| 64 return debug_service_worker_on_start_; | 64 return debug_service_worker_on_start_; |
| 65 } | 65 } |
| 66 WorkerRestarted(id, it); | 66 WorkerRestarted(id, it); |
| 67 return it->second->IsAttached(); | 67 return it->second->IsAttached(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void ServiceWorkerDevToolsManager::WorkerStopIgnored(int worker_process_id, | 70 void ServiceWorkerDevToolsManager::WorkerStopIgnored(int worker_process_id, |
| 71 int worker_route_id) { | 71 int worker_route_id) { |
| 72 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 72 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 73 // TODO(pfeldman): Show a console message to tell the user that UA didn't | 73 // TODO(pfeldman): Show a console message to tell the user that UA didn't |
| (...skipping 13 matching lines...) Expand all Loading... |
| 87 AgentHostMap::iterator it = workers().begin(); | 87 AgentHostMap::iterator it = workers().begin(); |
| 88 for (; it != workers().end(); ++it) { | 88 for (; it != workers().end(); ++it) { |
| 89 if (static_cast<ServiceWorkerDevToolsAgentHost*>( | 89 if (static_cast<ServiceWorkerDevToolsAgentHost*>( |
| 90 it->second)->Matches(service_worker_id)) | 90 it->second)->Matches(service_worker_id)) |
| 91 break; | 91 break; |
| 92 } | 92 } |
| 93 return it; | 93 return it; |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace content | 96 } // namespace content |
| OLD | NEW |