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

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

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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 #include <utility> 8 #include <utility>
9 9
10 #include "base/barrier_closure.h" 10 #include "base/barrier_closure.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 const uint32_t kVersion = 0x01000000; 52 const uint32_t kVersion = 0x01000000;
53 53
54 static const char kHostConnectMessage[] = "host::"; 54 static const char kHostConnectMessage[] = "host::";
55 55
56 using content::BrowserThread; 56 using content::BrowserThread;
57 57
58 typedef std::vector<scoped_refptr<UsbDevice> > UsbDevices; 58 typedef std::vector<scoped_refptr<UsbDevice> > UsbDevices;
59 typedef std::set<scoped_refptr<UsbDevice> > UsbDeviceSet; 59 typedef std::set<scoped_refptr<UsbDevice> > UsbDeviceSet;
60 60
61 // Stores android wrappers around claimed usb devices on caller thread. 61 // Stores android wrappers around claimed usb devices on caller thread.
62 base::LazyInstance<std::vector<AndroidUsbDevice*> >::Leaky g_devices = 62 base::LazyInstance<std::vector<AndroidUsbDevice*>>::Leaky g_devices =
63 LAZY_INSTANCE_INITIALIZER; 63 LAZY_INSTANCE_INITIALIZER;
64 64
65 bool IsAndroidInterface(const UsbInterfaceDescriptor& interface) { 65 bool IsAndroidInterface(const UsbInterfaceDescriptor& interface) {
66 if (interface.alternate_setting != 0 || 66 if (interface.alternate_setting != 0 ||
67 interface.interface_class != kAdbClass || 67 interface.interface_class != kAdbClass ||
68 interface.interface_subclass != kAdbSubclass || 68 interface.interface_subclass != kAdbSubclass ||
69 interface.interface_protocol != kAdbProtocol || 69 interface.interface_protocol != kAdbProtocol ||
70 interface.endpoints.size() != 2) { 70 interface.endpoints.size() != 2) {
71 return false; 71 return false;
72 } 72 }
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 BrowserThread::PostTask( 665 BrowserThread::PostTask(
666 BrowserThread::UI, FROM_HERE, 666 BrowserThread::UI, FROM_HERE,
667 base::Bind(&ReleaseInterface, usb_handle, interface_id_)); 667 base::Bind(&ReleaseInterface, usb_handle, interface_id_));
668 } 668 }
669 669
670 void AndroidUsbDevice::SocketDeleted(uint32_t socket_id) { 670 void AndroidUsbDevice::SocketDeleted(uint32_t socket_id) {
671 DCHECK(task_runner_->BelongsToCurrentThread()); 671 DCHECK(task_runner_->BelongsToCurrentThread());
672 672
673 sockets_.erase(socket_id); 673 sockets_.erase(socket_id);
674 } 674 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/printing/printers_manager_factory.cc ('k') | chrome/browser/download/download_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698