| 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 <pwd.h> | 7 #include <pwd.h> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 | 9 |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Desktop Chrome relies on this format to identify debuggable apps on Android | 57 // Desktop Chrome relies on this format to identify debuggable apps on Android |
| 58 // (see the code under chrome/browser/devtools/device). | 58 // (see the code under chrome/browser/devtools/device). |
| 59 // If this string ever changes it would not be sufficient to change the | 59 // If this string ever changes it would not be sufficient to change the |
| 60 // corresponding string on the client side. Since debugging an older version of | 60 // corresponding string on the client side. Since debugging an older version of |
| 61 // Chrome for Android from a newer version of desktop Chrome is a very common | 61 // Chrome for Android from a newer version of desktop Chrome is a very common |
| 62 // scenario, the client code will have to be modified to recognize both the old | 62 // scenario, the client code will have to be modified to recognize both the old |
| 63 // and the new format. | 63 // and the new format. |
| 64 const char kDevToolsChannelNameFormat[] = "%s_devtools_remote"; | 64 const char kDevToolsChannelNameFormat[] = "%s_devtools_remote"; |
| 65 | 65 |
| 66 const char kFrontEndURL[] = | 66 const char kFrontEndURL[] = |
| 67 "http://chrome-devtools-frontend.appspot.com/serve_rev/%s/devtools.html"; | 67 "http://chrome-devtools-frontend.appspot.com/serve_rev/%s/inspector.html"; |
| 68 const char kTetheringSocketName[] = "chrome_devtools_tethering_%d_%d"; | 68 const char kTetheringSocketName[] = "chrome_devtools_tethering_%d_%d"; |
| 69 | 69 |
| 70 const int kBackLog = 10; | 70 const int kBackLog = 10; |
| 71 | 71 |
| 72 bool AuthorizeSocketAccessWithDebugPermission( | 72 bool AuthorizeSocketAccessWithDebugPermission( |
| 73 const net::UnixDomainServerSocket::Credentials& credentials) { | 73 const net::UnixDomainServerSocket::Credentials& credentials) { |
| 74 JNIEnv* env = base::android::AttachCurrentThread(); | 74 JNIEnv* env = base::android::AttachCurrentThread(); |
| 75 return Java_DevToolsServer_checkDebugPermission( | 75 return Java_DevToolsServer_checkDebugPermission( |
| 76 env, base::android::GetApplicationContext(), | 76 env, base::android::GetApplicationContext(), |
| 77 credentials.process_id, credentials.user_id) || | 77 credentials.process_id, credentials.user_id) || |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 jlong server, | 246 jlong server, |
| 247 jboolean enabled, | 247 jboolean enabled, |
| 248 jboolean allow_debug_permission) { | 248 jboolean allow_debug_permission) { |
| 249 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); | 249 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); |
| 250 if (enabled) { | 250 if (enabled) { |
| 251 devtools_server->Start(allow_debug_permission); | 251 devtools_server->Start(allow_debug_permission); |
| 252 } else { | 252 } else { |
| 253 devtools_server->Stop(); | 253 devtools_server->Stop(); |
| 254 } | 254 } |
| 255 } | 255 } |
| OLD | NEW |