| Index: content/browser/devtools/devtools_agent_host_impl.cc
|
| diff --git a/content/browser/devtools/devtools_agent_host_impl.cc b/content/browser/devtools/devtools_agent_host_impl.cc
|
| index 6d0a30f69f12d2dd703b3530d7ba4a5899431e6d..3140c4b1818561df5085c00260a799c06e61502e 100644
|
| --- a/content/browser/devtools/devtools_agent_host_impl.cc
|
| +++ b/content/browser/devtools/devtools_agent_host_impl.cc
|
| @@ -11,12 +11,17 @@
|
| #include "base/guid.h"
|
| #include "base/lazy_instance.h"
|
| #include "content/browser/devtools/devtools_manager_impl.h"
|
| +#include "content/browser/devtools/embedded_worker_devtools_manager.h"
|
| #include "content/browser/devtools/forwarding_agent_host.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/devtools_manager_delegate.h"
|
|
|
| namespace content {
|
|
|
| +const char DevToolsAgentHost::kTypeWebContents[] = "web_contents";
|
| +const char DevToolsAgentHost::kTypeWorker[] = "worker";
|
| +const char DevToolsAgentHost::kTypeServiceWorker[] = "service_worker";
|
| +
|
| namespace {
|
| typedef std::map<std::string, DevToolsAgentHostImpl*> Instances;
|
| base::LazyInstance<Instances>::Leaky g_instances = LAZY_INSTANCE_INITIALIZER;
|
| @@ -27,6 +32,19 @@ base::LazyInstance<AgentStateCallbacks>::Leaky g_callbacks =
|
| LAZY_INSTANCE_INITIALIZER;
|
| } // namespace
|
|
|
| +// static
|
| +DevToolsAgentHost::List DevToolsAgentHost::GetOrCreateAll() {
|
| + List result = EmbeddedWorkerDevToolsManager::GetInstance()
|
| + ->GetOrCreateAllAgentHosts();
|
| + std::vector<WebContents*> wc_list =
|
| + DevToolsAgentHostImpl::GetInspectableWebContents();
|
| + for (std::vector<WebContents*>::iterator it = wc_list.begin();
|
| + it != wc_list.end(); ++it) {
|
| + result.push_back(GetOrCreateFor(*it));
|
| + }
|
| + return result;
|
| +}
|
| +
|
| DevToolsAgentHostImpl::DevToolsAgentHostImpl()
|
| : id_(base::GenerateGUID()),
|
| client_(NULL) {
|
| @@ -39,7 +57,7 @@ DevToolsAgentHostImpl::~DevToolsAgentHostImpl() {
|
| g_instances.Get().erase(g_instances.Get().find(id_));
|
| }
|
|
|
| -//static
|
| +// static
|
| scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::GetForId(
|
| const std::string& id) {
|
| if (g_instances == NULL)
|
|
|