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

Side by Side Diff: extensions/browser/api/usb/usb_api.cc

Issue 564043004: Remove implicit conversions from scoped_refptr to T* in extensions code. (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 | « chrome/browser/extensions/api/image_writer_private/removable_storage_provider_chromeos_unittest.cc ('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 "extensions/browser/api/usb/usb_api.h" 5 #include "extensions/browser/api/usb/usb_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 bool UsbRequestAccessFunction::Prepare() { 687 bool UsbRequestAccessFunction::Prepare() {
688 parameters_ = RequestAccess::Params::Create(*args_); 688 parameters_ = RequestAccess::Params::Create(*args_);
689 EXTENSION_FUNCTION_VALIDATE(parameters_.get()); 689 EXTENSION_FUNCTION_VALIDATE(parameters_.get());
690 return true; 690 return true;
691 } 691 }
692 692
693 void UsbRequestAccessFunction::AsyncWorkStart() { 693 void UsbRequestAccessFunction::AsyncWorkStart() {
694 #if defined(OS_CHROMEOS) 694 #if defined(OS_CHROMEOS)
695 scoped_refptr<UsbDevice> device = 695 scoped_refptr<UsbDevice> device =
696 GetDeviceOrCompleteWithError(parameters_->device); 696 GetDeviceOrCompleteWithError(parameters_->device);
697 if (!device) 697 if (!device.get())
698 return; 698 return;
699 699
700 device->RequestUsbAccess( 700 device->RequestUsbAccess(
701 parameters_->interface_id, 701 parameters_->interface_id,
702 base::Bind(&UsbRequestAccessFunction::OnCompleted, this)); 702 base::Bind(&UsbRequestAccessFunction::OnCompleted, this));
703 #else 703 #else
704 SetResult(new base::FundamentalValue(false)); 704 SetResult(new base::FundamentalValue(false));
705 CompleteWithError(kErrorNotSupported); 705 CompleteWithError(kErrorNotSupported);
706 #endif // OS_CHROMEOS 706 #endif // OS_CHROMEOS
707 } 707 }
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 SetResult(new base::FundamentalValue(false)); 1216 SetResult(new base::FundamentalValue(false));
1217 CompleteWithError(kErrorResetDevice); 1217 CompleteWithError(kErrorResetDevice);
1218 return; 1218 return;
1219 } 1219 }
1220 1220
1221 SetResult(new base::FundamentalValue(true)); 1221 SetResult(new base::FundamentalValue(true));
1222 AsyncWorkCompleted(); 1222 AsyncWorkCompleted();
1223 } 1223 }
1224 1224
1225 } // namespace extensions 1225 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/image_writer_private/removable_storage_provider_chromeos_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698