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

Side by Side Diff: device/usb/usb_context.cc

Issue 628873002: replace OVERRIDE and FINAL with override and final in device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « device/test/usb_test_gadget_impl.cc ('k') | device/usb/usb_device_filter_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "device/usb/usb_context.h" 5 #include "device/usb/usb_context.h"
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
11 #include "device/usb/usb_error.h" 11 #include "device/usb/usb_error.h"
12 #include "third_party/libusb/src/libusb/interrupt.h" 12 #include "third_party/libusb/src/libusb/interrupt.h"
13 #include "third_party/libusb/src/libusb/libusb.h" 13 #include "third_party/libusb/src/libusb/libusb.h"
14 14
15 namespace device { 15 namespace device {
16 16
17 // The UsbEventHandler works around a design flaw in the libusb interface. There 17 // The UsbEventHandler works around a design flaw in the libusb interface. There
18 // is currently no way to signal to libusb that any caller into one of the event 18 // is currently no way to signal to libusb that any caller into one of the event
19 // handler calls should return without handling any events. 19 // handler calls should return without handling any events.
20 class UsbContext::UsbEventHandler : public base::PlatformThread::Delegate { 20 class UsbContext::UsbEventHandler : public base::PlatformThread::Delegate {
21 public: 21 public:
22 explicit UsbEventHandler(libusb_context* context); 22 explicit UsbEventHandler(libusb_context* context);
23 virtual ~UsbEventHandler(); 23 virtual ~UsbEventHandler();
24 24
25 // base::PlatformThread::Delegate 25 // base::PlatformThread::Delegate
26 virtual void ThreadMain() OVERRIDE; 26 virtual void ThreadMain() override;
27 27
28 private: 28 private:
29 base::subtle::Atomic32 running_; 29 base::subtle::Atomic32 running_;
30 libusb_context* context_; 30 libusb_context* context_;
31 base::PlatformThreadHandle thread_handle_; 31 base::PlatformThreadHandle thread_handle_;
32 base::WaitableEvent start_polling_; 32 base::WaitableEvent start_polling_;
33 DISALLOW_COPY_AND_ASSIGN(UsbEventHandler); 33 DISALLOW_COPY_AND_ASSIGN(UsbEventHandler);
34 }; 34 };
35 35
36 UsbContext::UsbEventHandler::UsbEventHandler(libusb_context* context) 36 UsbContext::UsbEventHandler::UsbEventHandler(libusb_context* context)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 UsbContext::~UsbContext() { 72 UsbContext::~UsbContext() {
73 // destruction of UsbEventHandler is a blocking operation. 73 // destruction of UsbEventHandler is a blocking operation.
74 DCHECK(thread_checker_.CalledOnValidThread()); 74 DCHECK(thread_checker_.CalledOnValidThread());
75 delete event_handler_; 75 delete event_handler_;
76 event_handler_ = NULL; 76 event_handler_ = NULL;
77 libusb_exit(context_); 77 libusb_exit(context_);
78 } 78 }
79 79
80 } // namespace device 80 } // namespace device
OLDNEW
« no previous file with comments | « device/test/usb_test_gadget_impl.cc ('k') | device/usb/usb_device_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698