OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "android_webview/native/aw_dev_tools_server.h" | 5 #include "android_webview/native/aw_dev_tools_server.h" |
6 | 6 |
7 #include "android_webview/native/aw_contents.h" | 7 #include "android_webview/native/aw_contents.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 AwDevToolsServer::~AwDevToolsServer() { | 170 AwDevToolsServer::~AwDevToolsServer() { |
171 Stop(); | 171 Stop(); |
172 } | 172 } |
173 | 173 |
174 void AwDevToolsServer::Start() { | 174 void AwDevToolsServer::Start() { |
175 if (protocol_handler_) | 175 if (protocol_handler_) |
176 return; | 176 return; |
177 | 177 |
178 protocol_handler_ = content::DevToolsHttpHandler::Start( | 178 protocol_handler_ = content::DevToolsHttpHandler::Start( |
179 new net::UnixDomainSocketWithAbstractNamespaceFactory( | 179 new net::UnixDomainListenSocketWithAbstractNamespaceFactory( |
180 base::StringPrintf(kSocketNameFormat, getpid()), | 180 base::StringPrintf(kSocketNameFormat, getpid()), |
181 "", | 181 "", |
182 base::Bind(&content::CanUserConnectToDevTools)), | 182 base::Bind(&content::CanUserConnectToDevTools)), |
183 base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()), | 183 base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()), |
184 new AwDevToolsServerDelegate(), | 184 new AwDevToolsServerDelegate(), |
185 base::FilePath()); | 185 base::FilePath()); |
186 } | 186 } |
187 | 187 |
188 void AwDevToolsServer::Stop() { | 188 void AwDevToolsServer::Stop() { |
189 if (!protocol_handler_) | 189 if (!protocol_handler_) |
(...skipping 29 matching lines...) Expand all Loading... |
219 AwDevToolsServer* devtools_server = | 219 AwDevToolsServer* devtools_server = |
220 reinterpret_cast<AwDevToolsServer*>(server); | 220 reinterpret_cast<AwDevToolsServer*>(server); |
221 if (enabled) { | 221 if (enabled) { |
222 devtools_server->Start(); | 222 devtools_server->Start(); |
223 } else { | 223 } else { |
224 devtools_server->Stop(); | 224 devtools_server->Stop(); |
225 } | 225 } |
226 } | 226 } |
227 | 227 |
228 } // namespace android_webview | 228 } // namespace android_webview |
OLD | NEW |