OLD | NEW |
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 <string> | 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/callback.h" | 12 #include "base/callback.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/devtools_agent_host_client.h" | 15 #include "content/public/browser/devtools_agent_host_client.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class SingleThreadTaskRunner; | 19 class SingleThreadTaskRunner; |
20 } | 20 } |
21 | 21 |
22 namespace net { | 22 namespace net { |
23 class ServerSocket; | 23 class ServerSocket; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 static scoped_refptr<DevToolsAgentHost> GetForWorker(int worker_process_id, | 86 static scoped_refptr<DevToolsAgentHost> GetForWorker(int worker_process_id, |
87 int worker_route_id); | 87 int worker_route_id); |
88 | 88 |
89 // Creates DevToolsAgentHost that communicates to the target by means of | 89 // Creates DevToolsAgentHost that communicates to the target by means of |
90 // provided |delegate|. |delegate| ownership is passed to the created agent | 90 // provided |delegate|. |delegate| ownership is passed to the created agent |
91 // host. | 91 // host. |
92 static scoped_refptr<DevToolsAgentHost> Create( | 92 static scoped_refptr<DevToolsAgentHost> Create( |
93 DevToolsExternalAgentProxyDelegate* delegate); | 93 DevToolsExternalAgentProxyDelegate* delegate); |
94 | 94 |
95 using CreateServerSocketCallback = | 95 using CreateServerSocketCallback = |
96 base::Callback<scoped_ptr<net::ServerSocket>(std::string*)>; | 96 base::Callback<std::unique_ptr<net::ServerSocket>(std::string*)>; |
97 | 97 |
98 // Creates DevToolsAgentHost for the browser, which works with browser-wide | 98 // Creates DevToolsAgentHost for the browser, which works with browser-wide |
99 // debugging protocol. | 99 // debugging protocol. |
100 static scoped_refptr<DevToolsAgentHost> CreateForBrowser( | 100 static scoped_refptr<DevToolsAgentHost> CreateForBrowser( |
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; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 static void RemoveAgentStateCallback(const AgentStateCallback& callback); | 164 static void RemoveAgentStateCallback(const AgentStateCallback& callback); |
165 | 165 |
166 protected: | 166 protected: |
167 friend class base::RefCounted<DevToolsAgentHost>; | 167 friend class base::RefCounted<DevToolsAgentHost>; |
168 virtual ~DevToolsAgentHost() {} | 168 virtual ~DevToolsAgentHost() {} |
169 }; | 169 }; |
170 | 170 |
171 } // namespace content | 171 } // namespace content |
172 | 172 |
173 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_ | 173 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_AGENT_HOST_H_ |
OLD | NEW |