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

Side by Side Diff: extensions/browser/api/hid/hid_api.cc

Issue 503873002: Remove implicit conversions from scoped_refptr to T* in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 "extensions/browser/api/hid/hid_api.h" 5 #include "extensions/browser/api/hid/hid_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "device/hid/hid_connection.h" 10 #include "device/hid/hid_connection.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 APIPermission::kUsbDevice, &param)) { 124 APIPermission::kUsbDevice, &param)) {
125 LOG(WARNING) << "Insufficient permissions to access device."; 125 LOG(WARNING) << "Insufficient permissions to access device.";
126 CompleteWithError(kErrorPermissionDenied); 126 CompleteWithError(kErrorPermissionDenied);
127 return; 127 return;
128 } 128 }
129 129
130 HidService* hid_service = ExtensionsAPIClient::Get()->GetHidService(); 130 HidService* hid_service = ExtensionsAPIClient::Get()->GetHidService();
131 DCHECK(hid_service); 131 DCHECK(hid_service);
132 scoped_refptr<HidConnection> connection = 132 scoped_refptr<HidConnection> connection =
133 hid_service->Connect(device_info.device_id); 133 hid_service->Connect(device_info.device_id);
134 if (!connection) { 134 if (!connection.get()) {
135 CompleteWithError(kErrorFailedToOpenDevice); 135 CompleteWithError(kErrorFailedToOpenDevice);
136 return; 136 return;
137 } 137 }
138 int connection_id = connection_manager_->Add( 138 int connection_id = connection_manager_->Add(
139 new HidConnectionResource(extension_->id(), connection)); 139 new HidConnectionResource(extension_->id(), connection));
140 SetResult(PopulateHidConnection(connection_id, connection)); 140 SetResult(PopulateHidConnection(connection_id, connection));
141 AsyncWorkCompleted(); 141 AsyncWorkCompleted();
142 } 142 }
143 143
144 HidDisconnectFunction::HidDisconnectFunction() {} 144 HidDisconnectFunction::HidDisconnectFunction() {}
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 void HidSendFeatureReportFunction::OnFinished(bool success, size_t bytes) { 320 void HidSendFeatureReportFunction::OnFinished(bool success, size_t bytes) {
321 if (!success) { 321 if (!success) {
322 CompleteWithError(kErrorTransfer); 322 CompleteWithError(kErrorTransfer);
323 return; 323 return;
324 } 324 }
325 AsyncWorkCompleted(); 325 AsyncWorkCompleted();
326 } 326 }
327 327
328 } // namespace extensions 328 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/cast_channel/cast_socket_unittest.cc ('k') | extensions/browser/api/serial/serial_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698