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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_
6 #define CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_
10 #include "content/browser/devtools/service_worker_devtools_manager.h"
11 #include "content/browser/devtools/worker_devtools_agent_host.h"
15 class ServiceWorkerDevToolsAgentHost
: public WorkerDevToolsAgentHost
{
17 using List
= std::vector
<scoped_refptr
<ServiceWorkerDevToolsAgentHost
>>;
18 using Map
= std::map
<std::string
,
19 scoped_refptr
<ServiceWorkerDevToolsAgentHost
>>;
20 using ServiceWorkerIdentifier
=
21 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier
;
23 ServiceWorkerDevToolsAgentHost(WorkerId worker_id
,
24 const ServiceWorkerIdentifier
& service_worker
);
26 void UnregisterWorker();
28 // DevToolsAgentHost override.
29 Type
GetType() override
;
30 std::string
GetTitle() override
;
31 GURL
GetURL() override
;
32 bool Activate() override
;
33 bool Close() override
;
35 // IPCDevToolsAgentHost override.
36 void OnClientAttached(bool reattached
) override
;
37 void OnClientDetached() override
;
39 bool Matches(const ServiceWorkerIdentifier
& other
);
42 ~ServiceWorkerDevToolsAgentHost() override
;
43 scoped_ptr
<ServiceWorkerIdentifier
> service_worker_
;
45 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsAgentHost
);
48 } // namespace content
50 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_