| 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/shared_worker_devtools_agent_host.h" | 5 #include "content/browser/devtools/shared_worker_devtools_agent_host.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "content/browser/devtools/shared_worker_devtools_manager.h" | 8 #include "content/browser/devtools/shared_worker_devtools_manager.h" |
| 9 #include "content/browser/shared_worker/shared_worker_instance.h" | 9 #include "content/browser/shared_worker/shared_worker_instance.h" |
| 10 #include "content/browser/shared_worker/shared_worker_service_impl.h" | 10 #include "content/browser/shared_worker/shared_worker_service_impl.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 void TerminateSharedWorkerOnIO( | 17 void TerminateSharedWorkerOnIO( |
| 18 WorkerDevToolsAgentHost::WorkerId worker_id) { | 18 WorkerDevToolsAgentHost::WorkerId worker_id) { |
| 19 SharedWorkerServiceImpl::GetInstance()->TerminateWorker( | 19 SharedWorkerServiceImpl::GetInstance()->TerminateWorker( |
| 20 worker_id.first, worker_id.second); | 20 worker_id.first, worker_id.second); |
| 21 } | 21 } |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 SharedWorkerDevToolsAgentHost::SharedWorkerDevToolsAgentHost( | 25 SharedWorkerDevToolsAgentHost::SharedWorkerDevToolsAgentHost( |
| 26 WorkerId worker_id, | 26 WorkerId worker_id, |
| 27 const SharedWorkerInstance& shared_worker) | 27 const SharedWorkerInstance& shared_worker) |
| 28 : WorkerDevToolsAgentHost(worker_id), | 28 : WorkerDevToolsAgentHost(worker_id), |
| 29 shared_worker_(new SharedWorkerInstance(shared_worker)) { | 29 shared_worker_(new SharedWorkerInstance(shared_worker)) { |
| 30 NotifyCreated(); |
| 30 } | 31 } |
| 31 | 32 |
| 32 std::string SharedWorkerDevToolsAgentHost::GetType() { | 33 std::string SharedWorkerDevToolsAgentHost::GetType() { |
| 33 return kTypeSharedWorker; | 34 return kTypeSharedWorker; |
| 34 } | 35 } |
| 35 | 36 |
| 36 std::string SharedWorkerDevToolsAgentHost::GetTitle() { | 37 std::string SharedWorkerDevToolsAgentHost::GetTitle() { |
| 37 return base::UTF16ToUTF8(shared_worker_->name()); | 38 return base::UTF16ToUTF8(shared_worker_->name()); |
| 38 } | 39 } |
| 39 | 40 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 58 const SharedWorkerInstance& other) { | 59 const SharedWorkerInstance& other) { |
| 59 return shared_worker_->Matches(other); | 60 return shared_worker_->Matches(other); |
| 60 } | 61 } |
| 61 | 62 |
| 62 SharedWorkerDevToolsAgentHost::~SharedWorkerDevToolsAgentHost() { | 63 SharedWorkerDevToolsAgentHost::~SharedWorkerDevToolsAgentHost() { |
| 63 SharedWorkerDevToolsManager::GetInstance()->RemoveInspectedWorkerData( | 64 SharedWorkerDevToolsManager::GetInstance()->RemoveInspectedWorkerData( |
| 64 worker_id()); | 65 worker_id()); |
| 65 } | 66 } |
| 66 | 67 |
| 67 } // namespace content | 68 } // namespace content |
| OLD | NEW |