Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Side by Side Diff: content/public/browser/devtools_agent_host.h

Issue 2272213003: DevTools: remove devtools_discovery (merged into content). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/content_shell.gypi ('k') | content/public/browser/devtools_manager_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 namespace net { 23 namespace net {
24 class ServerSocket; 24 class ServerSocket;
25 } 25 }
26 26
27 namespace content { 27 namespace content {
28 28
29 class BrowserContext; 29 class BrowserContext;
30 class DevToolsExternalAgentProxyDelegate; 30 class DevToolsExternalAgentProxyDelegate;
31 class DevToolsManagerDelegate;
31 class RenderFrameHost; 32 class RenderFrameHost;
32 class WebContents; 33 class WebContents;
33 34
34 // Describes interface for managing devtools agents from browser process. 35 // Describes interface for managing devtools agents from browser process.
35 class CONTENT_EXPORT DevToolsAgentHost 36 class CONTENT_EXPORT DevToolsAgentHost
36 : public base::RefCounted<DevToolsAgentHost> { 37 : public base::RefCounted<DevToolsAgentHost> {
37 public: 38 public:
38 static char kTypePage[]; 39 static char kTypePage[];
39 static char kTypeFrame[]; 40 static char kTypeFrame[];
40 static char kTypeSharedWorker[]; 41 static char kTypeSharedWorker[];
41 static char kTypeServiceWorker[]; 42 static char kTypeServiceWorker[];
42 static char kTypeExternal[]; 43 static char kTypeExternal[];
43 static char kTypeBrowser[]; 44 static char kTypeBrowser[];
44 static char kTypeOther[]; 45 static char kTypeOther[];
45 46
47 // This is temporary while we are merging http handler and discovery
48 // into content/.
49 static DevToolsManagerDelegate* GetDevToolsManagerDelegate();
50
46 // Latest DevTools protocol version supported. 51 // Latest DevTools protocol version supported.
47 static std::string GetProtocolVersion(); 52 static std::string GetProtocolVersion();
48 53
49 // Returns whether particular version of DevTools protocol is supported. 54 // Returns whether particular version of DevTools protocol is supported.
50 static bool IsSupportedProtocolVersion(const std::string& version); 55 static bool IsSupportedProtocolVersion(const std::string& version);
51 56
52 // Returns DevToolsAgentHost with a given |id| or nullptr of it doesn't exist. 57 // Returns DevToolsAgentHost with a given |id| or nullptr of it doesn't exist.
53 static scoped_refptr<DevToolsAgentHost> GetForId(const std::string& id); 58 static scoped_refptr<DevToolsAgentHost> GetForId(const std::string& id);
54 59
55 // Returns DevToolsAgentHost that can be used for inspecting |web_contents|. 60 // Returns DevToolsAgentHost that can be used for inspecting |web_contents|.
(...skipping 29 matching lines...) Expand all
85 base::Callback<std::unique_ptr<net::ServerSocket>(std::string*)>; 90 base::Callback<std::unique_ptr<net::ServerSocket>(std::string*)>;
86 91
87 // Creates DevToolsAgentHost for the browser, which works with browser-wide 92 // Creates DevToolsAgentHost for the browser, which works with browser-wide
88 // debugging protocol. 93 // debugging protocol.
89 static scoped_refptr<DevToolsAgentHost> CreateForBrowser( 94 static scoped_refptr<DevToolsAgentHost> CreateForBrowser(
90 scoped_refptr<base::SingleThreadTaskRunner> tethering_task_runner, 95 scoped_refptr<base::SingleThreadTaskRunner> tethering_task_runner,
91 const CreateServerSocketCallback& socket_callback); 96 const CreateServerSocketCallback& socket_callback);
92 97
93 static bool IsDebuggerAttached(WebContents* web_contents); 98 static bool IsDebuggerAttached(WebContents* web_contents);
94 99
95 typedef std::vector<scoped_refptr<DevToolsAgentHost> > List; 100 using List = std::vector<scoped_refptr<DevToolsAgentHost>>;
96 101
97 // Returns all possible DevToolsAgentHosts. 102 using DiscoveryCallback = base::Callback<List()>;
103
104 // Registers embedder's custom host providers that are available via
105 // DiscoverAllHosts.
106 static void AddDiscoveryProvider(const DiscoveryCallback& callback);
107
108 // Returns all DevToolsAgentHosts content is aware of.
98 static List GetOrCreateAll(); 109 static List GetOrCreateAll();
99 110
111 // Returns all possible DevToolsAgentHosts embedder is aware of.
112 static List DiscoverAllHosts();
113
100 // Attaches |client| to this agent host to start debugging. 114 // Attaches |client| to this agent host to start debugging.
101 // Returns true iff attach succeeded. 115 // Returns true iff attach succeeded.
102 virtual bool AttachClient(DevToolsAgentHostClient* client) = 0; 116 virtual bool AttachClient(DevToolsAgentHostClient* client) = 0;
103 117
104 // Attaches |client| to this agent host to start debugging. Disconnects 118 // Attaches |client| to this agent host to start debugging. Disconnects
105 // any existing clients. 119 // any existing clients.
106 virtual void ForceAttachClient(DevToolsAgentHostClient* client) = 0; 120 virtual void ForceAttachClient(DevToolsAgentHostClient* client) = 0;
107 121
108 // Already attached client detaches from this agent host to stop debugging it. 122 // Already attached client detaches from this agent host to stop debugging it.
109 // Returns true iff detach succeeded. 123 // Returns true iff detach succeeded.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 static void RemoveAgentStateCallback(const AgentStateCallback& callback); 198 static void RemoveAgentStateCallback(const AgentStateCallback& callback);
185 199
186 protected: 200 protected:
187 friend class base::RefCounted<DevToolsAgentHost>; 201 friend class base::RefCounted<DevToolsAgentHost>;
188 virtual ~DevToolsAgentHost() {} 202 virtual ~DevToolsAgentHost() {}
189 }; 203 };
190 204
191 } // namespace content 205 } // namespace content
192 206
193 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_ 207 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_
OLDNEW
« no previous file with comments | « content/content_shell.gypi ('k') | content/public/browser/devtools_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698