Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: chrome/browser/devtools/device/usb/android_usb_device.cc

Issue 1034333002: Check USB device path access when prompting users to select a device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move MockPermissionBrokerClient into its own header. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/devtools/device/usb/android_usb_device.h" 5 #include "chrome/browser/devtools/device/usb/android_usb_device.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/barrier_closure.h" 9 #include "base/barrier_closure.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 if (!config) { 258 if (!config) {
259 barrier.Run(); 259 barrier.Run();
260 continue; 260 continue;
261 } 261 }
262 bool has_android_interface = false; 262 bool has_android_interface = false;
263 for (size_t j = 0; j < config->interfaces.size(); ++j) { 263 for (size_t j = 0; j < config->interfaces.size(); ++j) {
264 if (!IsAndroidInterface(config->interfaces[j])) { 264 if (!IsAndroidInterface(config->interfaces[j])) {
265 continue; 265 continue;
266 } 266 }
267 267
268 // Request permission on Chrome OS.
269 #if defined(OS_CHROMEOS)
270 device->RequestUsbAccess( 268 device->RequestUsbAccess(
271 j, base::Bind(&OpenAndroidDeviceOnFileThread, devices, rsa_key, 269 j, base::Bind(&OpenAndroidDeviceOnFileThread, devices, rsa_key,
272 barrier, device, j)); 270 barrier, device, j));
273 #else
274 OpenAndroidDeviceOnFileThread(devices, rsa_key, barrier, device, j, true);
275 #endif // defined(OS_CHROMEOS)
276 271
277 has_android_interface = true; 272 has_android_interface = true;
278 break; 273 break;
279 } 274 }
280 if (!has_android_interface) 275 if (!has_android_interface)
281 barrier.Run(); 276 barrier.Run();
282 } 277 }
283 } 278 }
284 279
285 // static 280 // static
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 BrowserThread::PostTask( 641 BrowserThread::PostTask(
647 BrowserThread::FILE, FROM_HERE, 642 BrowserThread::FILE, FROM_HERE,
648 base::Bind(&ReleaseInterface, usb_handle, interface_id_)); 643 base::Bind(&ReleaseInterface, usb_handle, interface_id_));
649 } 644 }
650 645
651 void AndroidUsbDevice::SocketDeleted(uint32 socket_id) { 646 void AndroidUsbDevice::SocketDeleted(uint32 socket_id) {
652 DCHECK(message_loop_ == base::MessageLoop::current()); 647 DCHECK(message_loop_ == base::MessageLoop::current());
653 648
654 sockets_.erase(socket_id); 649 sockets_.erase(socket_id);
655 } 650 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698