| 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_agent_host.h" | 5 #include "content/browser/devtools/service_worker_devtools_agent_host.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "content/browser/devtools/service_worker_devtools_manager.h" | 8 #include "content/browser/devtools/service_worker_devtools_manager.h" |
| 9 #include "content/browser/service_worker/service_worker_context_core.h" | 9 #include "content/browser/service_worker/service_worker_context_core.h" |
| 10 #include "content/browser/service_worker/service_worker_version.h" | 10 #include "content/browser/service_worker/service_worker_version.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 return true; | 85 return true; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void ServiceWorkerDevToolsAgentHost::UnregisterWorker() { | 88 void ServiceWorkerDevToolsAgentHost::UnregisterWorker() { |
| 89 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 89 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 90 base::Bind(&UnregisterServiceWorkerOnIO, | 90 base::Bind(&UnregisterServiceWorkerOnIO, |
| 91 service_worker_->context_weak(), | 91 service_worker_->context_weak(), |
| 92 service_worker_->version_id())); | 92 service_worker_->version_id())); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ServiceWorkerDevToolsAgentHost::OnClientAttached(bool reattached) { | 95 void ServiceWorkerDevToolsAgentHost::OnAttachedStateChanged(bool attached) { |
| 96 WorkerDevToolsAgentHost::OnClientAttached(reattached); | |
| 97 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 96 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 98 base::Bind(&SetDevToolsAttachedOnIO, | 97 base::Bind(&SetDevToolsAttachedOnIO, |
| 99 service_worker_->context_weak(), | 98 service_worker_->context_weak(), |
| 100 service_worker_->version_id(), | 99 service_worker_->version_id(), |
| 101 true)); | 100 attached)); |
| 102 } | |
| 103 | |
| 104 void ServiceWorkerDevToolsAgentHost::OnClientDetached() { | |
| 105 WorkerDevToolsAgentHost::OnClientDetached(); | |
| 106 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | |
| 107 base::Bind(&SetDevToolsAttachedOnIO, | |
| 108 service_worker_->context_weak(), | |
| 109 service_worker_->version_id(), | |
| 110 false)); | |
| 111 } | 101 } |
| 112 | 102 |
| 113 bool ServiceWorkerDevToolsAgentHost::Matches( | 103 bool ServiceWorkerDevToolsAgentHost::Matches( |
| 114 const ServiceWorkerIdentifier& other) { | 104 const ServiceWorkerIdentifier& other) { |
| 115 return service_worker_->Matches(other); | 105 return service_worker_->Matches(other); |
| 116 } | 106 } |
| 117 | 107 |
| 118 ServiceWorkerDevToolsAgentHost::~ServiceWorkerDevToolsAgentHost() { | 108 ServiceWorkerDevToolsAgentHost::~ServiceWorkerDevToolsAgentHost() { |
| 119 ServiceWorkerDevToolsManager::GetInstance()->RemoveInspectedWorkerData( | 109 ServiceWorkerDevToolsManager::GetInstance()->RemoveInspectedWorkerData( |
| 120 worker_id()); | 110 worker_id()); |
| 121 } | 111 } |
| 122 | 112 |
| 123 } // namespace content | 113 } // namespace content |
| OLD | NEW |