Index: content/shell/browser/shell_devtools_delegate.cc |
diff --git a/content/shell/browser/shell_devtools_delegate.cc b/content/shell/browser/shell_devtools_delegate.cc |
index c740b4609b582a324bb0a827ebee674e47576860..0f4214f1d42367d51e1edefa89f2d1dd82234b57 100644 |
--- a/content/shell/browser/shell_devtools_delegate.cc |
+++ b/content/shell/browser/shell_devtools_delegate.cc |
@@ -24,12 +24,12 @@ |
#include "content/public/common/user_agent.h" |
#include "content/shell/browser/shell.h" |
#include "grit/shell_resources.h" |
-#include "net/socket/tcp_server_socket.h" |
+#include "net/socket/tcp_listen_socket.h" |
#include "ui/base/resource/resource_bundle.h" |
#if defined(OS_ANDROID) |
#include "content/public/browser/android/devtools_auth.h" |
-#include "net/socket/unix_domain_server_socket_posix.h" |
+#include "net/socket/unix_domain_listen_socket_posix.h" |
#endif |
using content::DevToolsAgentHost; |
@@ -44,45 +44,7 @@ |
#endif |
const char kTargetTypePage[] = "page"; |
-#if defined(OS_ANDROID) |
-class UnixDomainServerSocketFactory |
- : public content::DevToolsHttpHandler::ServerSocketFactory { |
- public: |
- explicit UnixDomainServerSocketFactory(const std::string& socket_name) |
- : content::DevToolsHttpHandler::ServerSocketFactory(socket_name, 0, 1) {} |
- |
- private: |
- // content::DevToolsHttpHandler::ServerSocketFactory. |
- virtual scoped_ptr<net::ServerSocket> Create() const OVERRIDE { |
- return scoped_ptr<net::ServerSocket>( |
- new net::UnixDomainServerSocket( |
- base::Bind(&content::CanUserConnectToDevTools), |
- true /* use_abstract_namespace */)); |
- } |
- |
- DISALLOW_COPY_AND_ASSIGN(UnixDomainServerSocketFactory); |
-}; |
-#else |
-class TCPServerSocketFactory |
- : public content::DevToolsHttpHandler::ServerSocketFactory { |
- public: |
- TCPServerSocketFactory(const std::string& address, int port, int backlog) |
- : content::DevToolsHttpHandler::ServerSocketFactory( |
- address, port, backlog) {} |
- |
- private: |
- // content::DevToolsHttpHandler::ServerSocketFactory. |
- virtual scoped_ptr<net::ServerSocket> Create() const OVERRIDE { |
- return scoped_ptr<net::ServerSocket>( |
- new net::TCPServerSocket(NULL, net::NetLog::Source())); |
- } |
- |
- DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory); |
-}; |
-#endif |
- |
-scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory> |
-CreateSocketFactory() { |
+net::StreamListenSocketFactory* CreateSocketFactory() { |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
#if defined(OS_ANDROID) |
std::string socket_name = "content_shell_devtools_remote"; |
@@ -90,8 +52,9 @@ |
socket_name = command_line.GetSwitchValueASCII( |
switches::kRemoteDebuggingSocketName); |
} |
- return scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory>( |
- new UnixDomainServerSocketFactory(socket_name)); |
+ return new net::deprecated:: |
+ UnixDomainListenSocketWithAbstractNamespaceFactory( |
+ socket_name, "", base::Bind(&content::CanUserConnectToDevTools)); |
#else |
// See if the user specified a port on the command line (useful for |
// automation). If not, use an ephemeral port by specifying 0. |
@@ -107,8 +70,7 @@ |
DLOG(WARNING) << "Invalid http debugger port number " << temp_port; |
} |
} |
- return scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory>( |
- new TCPServerSocketFactory("127.0.0.1", port, 1)); |
+ return new net::TCPListenSocketFactory("127.0.0.1", port); |
#endif |
} |