summaryrefslogtreecommitdiffstats
path: root/content/public/browser/devtools_agent_host_registry.h
blob: e0c76fa8878fee2a374ec2582ac88bf56c240084 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_REGISTRY_H_
#define CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_REGISTRY_H_

#include "content/common/content_export.h"

namespace content {

class DevToolsAgentHost;
class RenderViewHost;
class WebContents;

class CONTENT_EXPORT DevToolsAgentHostRegistry {
 public:
  // Returns DevToolsAgentHost that can be used for inspecting |rvh|.
  // New DevToolsAgentHost will be created if it does not exist.
  static DevToolsAgentHost* GetDevToolsAgentHost(RenderViewHost* rvh);

  // Returns render view host instance for given |agent_host|.
  static RenderViewHost* GetRenderViewHost(
      DevToolsAgentHost* agent_host);

  // Returns true iff an instance of DevToolsAgentHost for the |rvh|
  // does exist.
  static bool HasDevToolsAgentHost(RenderViewHost* rvh);

  // Returns DevToolsAgentHost that can be used for inspecting shared worker
  // with given worker process host id and routing id.
  static DevToolsAgentHost* GetDevToolsAgentHostForWorker(
      int worker_process_id,
      int worker_route_id);

  static bool IsDebuggerAttached(WebContents* web_contents);
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_REGISTRY_H_