| 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 #include "chrome/browser/android/dev_tools_server.h" | 5 #include "chrome/browser/android/dev_tools_server.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 #include <pwd.h> | 8 #include <pwd.h> |
| 9 | 9 |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 if (protocol_handler_) | 122 if (protocol_handler_) |
| 123 return; | 123 return; |
| 124 | 124 |
| 125 chrome::VersionInfo version_info; | 125 chrome::VersionInfo version_info; |
| 126 | 126 |
| 127 protocol_handler_ = content::DevToolsHttpHandler::Start( | 127 protocol_handler_ = content::DevToolsHttpHandler::Start( |
| 128 new net::UnixDomainSocketWithAbstractNamespaceFactory( | 128 new net::UnixDomainSocketWithAbstractNamespaceFactory( |
| 129 socket_name_, | 129 socket_name_, |
| 130 base::Bind(&content::CanUserConnectToDevTools)), | 130 base::Bind(&content::CanUserConnectToDevTools)), |
| 131 use_bundled_frontend_resources_ ? | 131 use_bundled_frontend_resources_ ? |
| 132 "" : StringPrintf(kFrontEndURL, version_info.Version().c_str()), | 132 "" : |
| 133 base::StringPrintf(kFrontEndURL, version_info.Version().c_str()), |
| 133 new DevToolsServerDelegate(use_bundled_frontend_resources_)); | 134 new DevToolsServerDelegate(use_bundled_frontend_resources_)); |
| 134 } | 135 } |
| 135 | 136 |
| 136 void DevToolsServer::Stop() { | 137 void DevToolsServer::Stop() { |
| 137 if (!protocol_handler_) | 138 if (!protocol_handler_) |
| 138 return; | 139 return; |
| 139 // Note that the call to Stop() below takes care of |protocol_handler_| | 140 // Note that the call to Stop() below takes care of |protocol_handler_| |
| 140 // deletion. | 141 // deletion. |
| 141 protocol_handler_->Stop(); | 142 protocol_handler_->Stop(); |
| 142 protocol_handler_ = NULL; | 143 protocol_handler_ = NULL; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 jobject obj, | 175 jobject obj, |
| 175 jint server, | 176 jint server, |
| 176 jboolean enabled) { | 177 jboolean enabled) { |
| 177 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); | 178 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); |
| 178 if (enabled) { | 179 if (enabled) { |
| 179 devtools_server->Start(); | 180 devtools_server->Start(); |
| 180 } else { | 181 } else { |
| 181 devtools_server->Stop(); | 182 devtools_server->Stop(); |
| 182 } | 183 } |
| 183 } | 184 } |
| OLD | NEW |