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

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

Issue 2344753002: DevTools: return discovered targets asynchronously. (Closed)
Patch Set: for bots Created 4 years, 2 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
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // Creates DevToolsAgentHost for the browser, which works with browser-wide 91 // Creates DevToolsAgentHost for the browser, which works with browser-wide
92 // debugging protocol. 92 // debugging protocol.
93 static scoped_refptr<DevToolsAgentHost> CreateForBrowser( 93 static scoped_refptr<DevToolsAgentHost> CreateForBrowser(
94 scoped_refptr<base::SingleThreadTaskRunner> tethering_task_runner, 94 scoped_refptr<base::SingleThreadTaskRunner> tethering_task_runner,
95 const CreateServerSocketCallback& socket_callback); 95 const CreateServerSocketCallback& socket_callback);
96 96
97 static bool IsDebuggerAttached(WebContents* web_contents); 97 static bool IsDebuggerAttached(WebContents* web_contents);
98 98
99 using List = std::vector<scoped_refptr<DevToolsAgentHost>>; 99 using List = std::vector<scoped_refptr<DevToolsAgentHost>>;
100 100
101 using DiscoveryCallback = base::Callback<List()>;
102
103 // Registers embedder's custom host providers that are available via
104 // DiscoverAllHosts.
105 static void AddDiscoveryProvider(const DiscoveryCallback& callback);
106
107 // Returns all DevToolsAgentHosts content is aware of. 101 // Returns all DevToolsAgentHosts content is aware of.
108 static List GetOrCreateAll(); 102 static List GetOrCreateAll();
109 103
104 using DiscoveryCallback = base::Callback<void(List)>;
105
110 // Returns all possible DevToolsAgentHosts embedder is aware of. 106 // Returns all possible DevToolsAgentHosts embedder is aware of.
111 static List DiscoverAllHosts(); 107 static void DiscoverAllHosts(const DiscoveryCallback& callback);
112 108
113 // Starts remote debugging. 109 // Starts remote debugging.
114 // Takes ownership over |socket_factory|. 110 // Takes ownership over |socket_factory|.
115 // If |frontend_url| is empty, assumes it's bundled. 111 // If |frontend_url| is empty, assumes it's bundled.
116 // If |active_port_output_directory| is non-empty, it is assumed the 112 // If |active_port_output_directory| is non-empty, it is assumed the
117 // socket_factory was initialized with an ephemeral port (0). The 113 // socket_factory was initialized with an ephemeral port (0). The
118 // port selected by the OS will be written to a well-known file in 114 // port selected by the OS will be written to a well-known file in
119 // the output directory. 115 // the output directory.
120 static void StartRemoteDebuggingServer( 116 static void StartRemoteDebuggingServer(
121 std::unique_ptr<DevToolsSocketFactory> server_socket_factory, 117 std::unique_ptr<DevToolsSocketFactory> server_socket_factory,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 static void RemoveAgentStateCallback(const AgentStateCallback& callback); 208 static void RemoveAgentStateCallback(const AgentStateCallback& callback);
213 209
214 protected: 210 protected:
215 friend class base::RefCounted<DevToolsAgentHost>; 211 friend class base::RefCounted<DevToolsAgentHost>;
216 virtual ~DevToolsAgentHost() {} 212 virtual ~DevToolsAgentHost() {}
217 }; 213 };
218 214
219 } // namespace content 215 } // namespace content
220 216
221 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_ 217 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/browser_handler.cc ('k') | content/public/browser/devtools_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698