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

Side by Side Diff: device/hid/hid_service_mac.cc

Issue 584083002: Remove implicit conversions from scoped_refptr to T* in device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/bluetooth/bluetooth_socket_mac.mm ('k') | no next file » | 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/hid/hid_service_mac.h" 5 #include "device/hid/hid_service_mac.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 #include <IOKit/hid/IOHIDManager.h> 8 #include <IOKit/hid/IOHIDManager.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 top_level_collections->push_back(collection_info); 140 top_level_collections->push_back(collection_info);
141 } 141 }
142 } 142 }
143 } 143 }
144 144
145 } // namespace 145 } // namespace
146 146
147 HidServiceMac::HidServiceMac() { 147 HidServiceMac::HidServiceMac() {
148 DCHECK(thread_checker_.CalledOnValidThread()); 148 DCHECK(thread_checker_.CalledOnValidThread());
149 message_loop_ = base::MessageLoopProxy::current(); 149 message_loop_ = base::MessageLoopProxy::current();
150 DCHECK(message_loop_); 150 DCHECK(message_loop_.get());
151 hid_manager_.reset(IOHIDManagerCreate(NULL, 0)); 151 hid_manager_.reset(IOHIDManagerCreate(NULL, 0));
152 if (!hid_manager_) { 152 if (!hid_manager_) {
153 LOG(ERROR) << "Failed to initialize HidManager"; 153 LOG(ERROR) << "Failed to initialize HidManager";
154 return; 154 return;
155 } 155 }
156 DCHECK(CFGetTypeID(hid_manager_) == IOHIDManagerGetTypeID()); 156 DCHECK(CFGetTypeID(hid_manager_) == IOHIDManagerGetTypeID());
157 IOHIDManagerOpen(hid_manager_, kIOHIDOptionsTypeNone); 157 IOHIDManagerOpen(hid_manager_, kIOHIDOptionsTypeNone);
158 IOHIDManagerSetDeviceMatching(hid_manager_, NULL); 158 IOHIDManagerSetDeviceMatching(hid_manager_, NULL);
159 159
160 // Enumerate all the currently known devices. 160 // Enumerate all the currently known devices.
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 scoped_refptr<HidConnection> HidServiceMac::Connect( 270 scoped_refptr<HidConnection> HidServiceMac::Connect(
271 const HidDeviceId& device_id) { 271 const HidDeviceId& device_id) {
272 DCHECK(thread_checker_.CalledOnValidThread()); 272 DCHECK(thread_checker_.CalledOnValidThread());
273 HidDeviceInfo device_info; 273 HidDeviceInfo device_info;
274 if (!GetDeviceInfo(device_id, &device_info)) 274 if (!GetDeviceInfo(device_id, &device_info))
275 return NULL; 275 return NULL;
276 return scoped_refptr<HidConnection>(new HidConnectionMac(device_info)); 276 return scoped_refptr<HidConnection>(new HidConnectionMac(device_info));
277 } 277 }
278 278
279 } // namespace device 279 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_socket_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698