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

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

Issue 1874313002: Convert device to std::unique_ptr (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/usb/usb_device_filter.h ('k') | device/usb/usb_device_handle_impl.h » ('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_device_filter.h" 5 #include "device/usb/usb_device_filter.h"
6 6
7 #include <memory>
7 #include <utility> 8 #include <utility>
8 9
9 #include "base/values.h" 10 #include "base/values.h"
10 #include "device/usb/usb_descriptors.h" 11 #include "device/usb/usb_descriptors.h"
11 #include "device/usb/usb_device.h" 12 #include "device/usb/usb_device.h"
12 13
13 namespace device { 14 namespace device {
14 15
15 namespace { 16 namespace {
16 17
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 84 }
84 } 85 }
85 } 86 }
86 87
87 return false; 88 return false;
88 } 89 }
89 90
90 return true; 91 return true;
91 } 92 }
92 93
93 scoped_ptr<base::Value> UsbDeviceFilter::ToValue() const { 94 std::unique_ptr<base::Value> UsbDeviceFilter::ToValue() const {
94 scoped_ptr<base::DictionaryValue> obj(new base::DictionaryValue()); 95 std::unique_ptr<base::DictionaryValue> obj(new base::DictionaryValue());
95 96
96 if (vendor_id_set_) { 97 if (vendor_id_set_) {
97 obj->SetInteger(kVendorIdKey, vendor_id_); 98 obj->SetInteger(kVendorIdKey, vendor_id_);
98 if (product_id_set_) { 99 if (product_id_set_) {
99 obj->SetInteger(kProductIdKey, product_id_); 100 obj->SetInteger(kProductIdKey, product_id_);
100 } 101 }
101 } 102 }
102 103
103 if (interface_class_set_) { 104 if (interface_class_set_) {
104 obj->SetInteger(kInterfaceClassKey, interface_class_); 105 obj->SetInteger(kInterfaceClassKey, interface_class_);
(...skipping 15 matching lines...) Expand all
120 i != filters.end(); 121 i != filters.end();
121 ++i) { 122 ++i) {
122 if (i->Matches(device)) { 123 if (i->Matches(device)) {
123 return true; 124 return true;
124 } 125 }
125 } 126 }
126 return false; 127 return false;
127 } 128 }
128 129
129 } // namespace device 130 } // namespace device
OLDNEW
« no previous file with comments | « device/usb/usb_device_filter.h ('k') | device/usb/usb_device_handle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698