Add long running gmail memory benchmark for background tab.
[chromium-blink-merge.git] / content / browser / devtools / service_worker_devtools_agent_host.h
blob39c00dbe5ac74e80f6181e0091765c8b91cf877e
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_
8 #include <map>
10 #include "content/browser/devtools/service_worker_devtools_manager.h"
11 #include "content/browser/devtools/worker_devtools_agent_host.h"
13 namespace content {
15 class ServiceWorkerDevToolsAgentHost : public WorkerDevToolsAgentHost {
16 public:
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 overrides.
29 Type GetType() override;
30 std::string GetTitle() override;
31 GURL GetURL() override;
32 bool Activate() override;
33 bool Close() override;
35 // WorkerDevToolsAgentHost overrides.
36 void OnAttachedStateChanged(bool attached) override;
38 bool Matches(const ServiceWorkerIdentifier& other);
40 private:
41 ~ServiceWorkerDevToolsAgentHost() override;
42 scoped_ptr<ServiceWorkerIdentifier> service_worker_;
44 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsAgentHost);
47 } // namespace content
49 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_