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

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

Issue 2047833002: DevTools: introduce browser domain for basic target discovery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 scoped_refptr<base::SingleThreadTaskRunner> tethering_task_runner, 101 scoped_refptr<base::SingleThreadTaskRunner> tethering_task_runner,
102 const CreateServerSocketCallback& socket_callback); 102 const CreateServerSocketCallback& socket_callback);
103 103
104 static bool IsDebuggerAttached(WebContents* web_contents); 104 static bool IsDebuggerAttached(WebContents* web_contents);
105 105
106 typedef std::vector<scoped_refptr<DevToolsAgentHost> > List; 106 typedef std::vector<scoped_refptr<DevToolsAgentHost> > List;
107 107
108 // Returns all possible DevToolsAgentHosts. 108 // Returns all possible DevToolsAgentHosts.
109 static List GetOrCreateAll(); 109 static List GetOrCreateAll();
110 110
111 // Client attaches to this agent host to start debugging it. 111 // Attaches |client| to this agent host to start debugging.
dgozman 2016/06/08 03:53:29 Let's comment when this may return false.
pfeldman 2016/06/08 15:54:52 Done.
112 virtual void AttachClient(DevToolsAgentHostClient* client) = 0; 112 virtual bool AttachClient(DevToolsAgentHostClient* client) = 0;
113
114 // Attaches |client| to this agent host to start debugging. Disconnects
115 // any existing clients.
116 virtual bool ForceAttachClient(DevToolsAgentHostClient* client) = 0;
dgozman 2016/06/08 03:53:29 Can this ever return false?
pfeldman 2016/06/08 15:54:53 Done.
113 117
114 // Already attached client detaches from this agent host to stop debugging it. 118 // Already attached client detaches from this agent host to stop debugging it.
115 virtual void DetachClient() = 0; 119 virtual bool DetachClient(DevToolsAgentHostClient* client) = 0;
116 120
117 // Returns true if there is a client attached. 121 // Returns true if there is a client attached.
118 virtual bool IsAttached() = 0; 122 virtual bool IsAttached() = 0;
119 123
120 // Sends a message to the agent. Returns true if the message is handled. 124 // Sends a message to the agent. Returns true if the message is handled.
121 virtual bool DispatchProtocolMessage(const std::string& message) = 0; 125 virtual bool DispatchProtocolMessage(const std::string& message) = 0;
dgozman 2016/06/08 03:53:29 Let's add client parameter here as well, to be sur
pfeldman 2016/06/08 15:54:52 Done.
122 126
123 // Starts inspecting element at position (|x|, |y|) in the specified page. 127 // Starts inspecting element at position (|x|, |y|) in the specified page.
124 virtual void InspectElement(int x, int y) = 0; 128 virtual void InspectElement(int x, int y) = 0;
125 129
126 // Returns the unique id of the agent. 130 // Returns the unique id of the agent.
127 virtual std::string GetId() = 0; 131 virtual std::string GetId() = 0;
128 132
129 // Returns web contents instance for this host if any. 133 // Returns web contents instance for this host if any.
130 virtual WebContents* GetWebContents() = 0; 134 virtual WebContents* GetWebContents() = 0;
131 135
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 static void RemoveAgentStateCallback(const AgentStateCallback& callback); 168 static void RemoveAgentStateCallback(const AgentStateCallback& callback);
165 169
166 protected: 170 protected:
167 friend class base::RefCounted<DevToolsAgentHost>; 171 friend class base::RefCounted<DevToolsAgentHost>;
168 virtual ~DevToolsAgentHost() {} 172 virtual ~DevToolsAgentHost() {}
169 }; 173 };
170 174
171 } // namespace content 175 } // namespace content
172 176
173 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_ 177 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698