ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / content / browser / devtools / worker_devtools_manager.h
blob910fd400e6bc4c9bafa20b63f4c05cb33260a9c3
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_WORKER_DEVTOOLS_MANAGER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_MANAGER_H_
8 #include <map>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/memory/ref_counted.h"
13 #include "content/common/content_export.h"
15 namespace content {
17 class DevToolsAgentHost;
18 class DevToolsAgentHostImpl;
19 class WorkerDevToolsAgentHost;
21 // A base class of SharedWorkerDevToolsManager and ServiceWorkerDevToolsManager,
22 // provides common default implementation for them.
23 // This class lives on UI thread.
24 class CONTENT_EXPORT WorkerDevToolsManager {
25 public:
26 typedef std::pair<int, int> WorkerId;
28 DevToolsAgentHostImpl* GetDevToolsAgentHostForWorker(int worker_process_id,
29 int worker_route_id);
30 void AddAllAgentHosts(std::vector<scoped_refptr<DevToolsAgentHost>>* result);
31 void WorkerReadyForInspection(int worker_process_id, int worker_route_id);
32 void WorkerDestroyed(int worker_process_id, int worker_route_id);
34 protected:
35 typedef std::map<WorkerId, WorkerDevToolsAgentHost*> AgentHostMap;
36 friend class SharedWorkerDevToolsManagerTest;
38 WorkerDevToolsManager();
39 virtual ~WorkerDevToolsManager();
40 void RemoveInspectedWorkerData(WorkerId id);
41 void WorkerRestarted(const WorkerId& id, const AgentHostMap::iterator& it);
42 AgentHostMap& workers() { return workers_; }
44 private:
45 AgentHostMap workers_;
46 DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsManager);
49 } // namespace content
51 #endif // CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_MANAGER_H_