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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return base::FilePath(); | 105 return base::FilePath(); |
106 } | 106 } |
107 | 107 |
108 virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( | 108 virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( |
109 net::StreamListenSocket::Delegate* delegate, | 109 net::StreamListenSocket::Delegate* delegate, |
110 std::string* name) override { | 110 std::string* name) override { |
111 *name = base::StringPrintf( | 111 *name = base::StringPrintf( |
112 kTetheringSocketName, getpid(), ++last_tethering_socket_); | 112 kTetheringSocketName, getpid(), ++last_tethering_socket_); |
113 return net::deprecated::UnixDomainListenSocket:: | 113 return net::deprecated::UnixDomainListenSocket:: |
114 CreateAndListenWithAbstractNamespace( | 114 CreateAndListenWithAbstractNamespace( |
115 *name, | 115 *name, "", delegate, auth_callback_); |
116 "", | |
117 delegate, | |
118 auth_callback_) | |
119 .PassAs<net::StreamListenSocket>(); | |
120 } | 116 } |
121 | 117 |
122 private: | 118 private: |
123 static void PopulatePageThumbnails() { | 119 static void PopulatePageThumbnails() { |
124 Profile* profile = | 120 Profile* profile = |
125 ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); | 121 ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); |
126 history::TopSites* top_sites = profile->GetTopSites(); | 122 history::TopSites* top_sites = profile->GetTopSites(); |
127 if (top_sites) | 123 if (top_sites) |
128 top_sites->SyncWithHistory(); | 124 top_sites->SyncWithHistory(); |
129 } | 125 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 jlong server, | 248 jlong server, |
253 jboolean enabled, | 249 jboolean enabled, |
254 jboolean allow_debug_permission) { | 250 jboolean allow_debug_permission) { |
255 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); | 251 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); |
256 if (enabled) { | 252 if (enabled) { |
257 devtools_server->Start(allow_debug_permission); | 253 devtools_server->Start(allow_debug_permission); |
258 } else { | 254 } else { |
259 devtools_server->Stop(); | 255 devtools_server->Stop(); |
260 } | 256 } |
261 } | 257 } |
OLD | NEW |