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

Side by Side Diff: chrome/browser/extensions/api/usb/usb_device_resource.h

Issue 10919201: Make sure that a given app/extension requests only its own resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve tests; fix merge conflicts. Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 11 matching lines...) Expand all
22 22
23 namespace extensions { 23 namespace extensions {
24 24
25 class ApiResourceEventNotifier; 25 class ApiResourceEventNotifier;
26 26
27 // A UsbDeviceResource is an ApiResource wrapper for a UsbDevice. When invoking 27 // A UsbDeviceResource is an ApiResource wrapper for a UsbDevice. When invoking
28 // transfers on the underlying device it will use the ApiResourceEventNotifier 28 // transfers on the underlying device it will use the ApiResourceEventNotifier
29 // associated with the underlying ApiResource to deliver completion messages. 29 // associated with the underlying ApiResource to deliver completion messages.
30 class UsbDeviceResource : public ApiResource { 30 class UsbDeviceResource : public ApiResource {
31 public: 31 public:
32 UsbDeviceResource(ApiResourceEventNotifier* notifier, UsbDevice* device); 32 UsbDeviceResource(const std::string& owner_extension_id,
33 ApiResourceEventNotifier* notifier, UsbDevice* device);
33 virtual ~UsbDeviceResource(); 34 virtual ~UsbDeviceResource();
34 35
35 void Close(); 36 void Close();
36 37
37 // All of the *Transfer variants that are exposed here adapt their arguments 38 // All of the *Transfer variants that are exposed here adapt their arguments
38 // for the underlying UsbDevice's interface and invoke the corresponding 39 // for the underlying UsbDevice's interface and invoke the corresponding
39 // methods with completion callbacks that call OnTransferComplete on the event 40 // methods with completion callbacks that call OnTransferComplete on the event
40 // notifier. 41 // notifier.
41 void ControlTransfer( 42 void ControlTransfer(
42 const api::experimental_usb::ControlTransferInfo& transfer); 43 const api::experimental_usb::ControlTransferInfo& transfer);
(...skipping 10 matching lines...) Expand all
53 UsbTransferStatus status); 54 UsbTransferStatus status);
54 55
55 scoped_refptr<UsbDevice> device_; 56 scoped_refptr<UsbDevice> device_;
56 57
57 DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource); 58 DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource);
58 }; 59 };
59 60
60 } // namespace extensions 61 } // namespace extensions
61 62
62 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ 63 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/usb/usb_api.cc ('k') | chrome/browser/extensions/api/usb/usb_device_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698