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

Side by Side Diff: device/usb/mojo/device_impl.h

Issue 1925463002: Mojo: Make device/ to not rely on connecton error notification on message loop destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « device/serial/data_source_sender.cc ('k') | device/usb/mojo/device_impl.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef DEVICE_USB_MOJO_DEVICE_IMPL_H_ 5 #ifndef DEVICE_USB_MOJO_DEVICE_IMPL_H_
6 #define DEVICE_USB_MOJO_DEVICE_IMPL_H_ 6 #define DEVICE_USB_MOJO_DEVICE_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/scoped_observer.h" 14 #include "base/scoped_observer.h"
15 #include "device/usb/mojo/permission_provider.h" 15 #include "device/usb/mojo/permission_provider.h"
16 #include "device/usb/public/interfaces/device.mojom.h" 16 #include "device/usb/public/interfaces/device.mojom.h"
17 #include "device/usb/usb_device.h" 17 #include "device/usb/usb_device.h"
18 #include "device/usb/usb_device_handle.h" 18 #include "device/usb/usb_device_handle.h"
19 #include "mojo/public/cpp/bindings/binding.h"
20 #include "mojo/public/cpp/bindings/callback.h" 19 #include "mojo/public/cpp/bindings/callback.h"
21 #include "mojo/public/cpp/bindings/interface_request.h" 20 #include "mojo/public/cpp/bindings/interface_request.h"
21 #include "mojo/public/cpp/bindings/strong_binding.h"
22 22
23 namespace net { 23 namespace net {
24 class IOBuffer; 24 class IOBuffer;
25 } 25 }
26 26
27 namespace device { 27 namespace device {
28 namespace usb { 28 namespace usb {
29 29
30 class PermissionProvider; 30 class PermissionProvider;
31 31
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 const scoped_refptr<UsbDevice> device_; 103 const scoped_refptr<UsbDevice> device_;
104 const DeviceInfoPtr device_info_; 104 const DeviceInfoPtr device_info_;
105 base::WeakPtr<PermissionProvider> permission_provider_; 105 base::WeakPtr<PermissionProvider> permission_provider_;
106 ScopedObserver<device::UsbDevice, device::UsbDevice::Observer> observer_; 106 ScopedObserver<device::UsbDevice, device::UsbDevice::Observer> observer_;
107 107
108 // The device handle. Will be null before the device is opened and after it 108 // The device handle. Will be null before the device is opened and after it
109 // has been closed. 109 // has been closed.
110 scoped_refptr<UsbDeviceHandle> device_handle_; 110 scoped_refptr<UsbDeviceHandle> device_handle_;
111 111
112 mojo::Binding<Device> binding_; 112 mojo::StrongBinding<Device> binding_;
113 base::WeakPtrFactory<DeviceImpl> weak_factory_; 113 base::WeakPtrFactory<DeviceImpl> weak_factory_;
114 114
115 DISALLOW_COPY_AND_ASSIGN(DeviceImpl); 115 DISALLOW_COPY_AND_ASSIGN(DeviceImpl);
116 }; 116 };
117 117
118 } // namespace usb 118 } // namespace usb
119 } // namespace device 119 } // namespace device
120 120
121 #endif // DEVICE_USB_MOJO_DEVICE_IMPL_H_ 121 #endif // DEVICE_USB_MOJO_DEVICE_IMPL_H_
OLDNEW
« no previous file with comments | « device/serial/data_source_sender.cc ('k') | device/usb/mojo/device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698