| Index: android_webview/native/aw_dev_tools_server.cc
|
| diff --git a/android_webview/native/aw_dev_tools_server.cc b/android_webview/native/aw_dev_tools_server.cc
|
| index 90b72d18a441113b584515e13742b6c541463475..567944df7265462092fce05a1da7c10daa77501a 100644
|
| --- a/android_webview/native/aw_dev_tools_server.cc
|
| +++ b/android_webview/native/aw_dev_tools_server.cc
|
| @@ -19,7 +19,7 @@
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/common/user_agent.h"
|
| #include "jni/AwDevToolsServer_jni.h"
|
| -#include "net/socket/unix_domain_listen_socket_posix.h"
|
| +#include "net/socket/unix_domain_server_socket_posix.h"
|
|
|
| using content::DevToolsAgentHost;
|
| using content::RenderViewHost;
|
| @@ -157,6 +157,25 @@ std::string GetViewDescription(WebContents* web_contents) {
|
| return json;
|
| }
|
|
|
| +// Factory for UnixDomainServerSocket.
|
| +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));
|
| + }
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(UnixDomainServerSocketFactory);
|
| +};
|
| +
|
| } // namespace
|
|
|
| namespace android_webview {
|
| @@ -173,11 +192,11 @@ void AwDevToolsServer::Start() {
|
| if (protocol_handler_)
|
| return;
|
|
|
| + scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory> factory(
|
| + new UnixDomainServerSocketFactory(
|
| + base::StringPrintf(kSocketNameFormat, getpid())));
|
| protocol_handler_ = content::DevToolsHttpHandler::Start(
|
| - new net::deprecated::UnixDomainListenSocketWithAbstractNamespaceFactory(
|
| - base::StringPrintf(kSocketNameFormat, getpid()),
|
| - "",
|
| - base::Bind(&content::CanUserConnectToDevTools)),
|
| + factory.Pass(),
|
| base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()),
|
| new AwDevToolsServerDelegate(),
|
| base::FilePath());
|
|
|