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

Side by Side Diff: chrome/browser/extensions/api/usb/usb_api.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_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/extensions/api/api_function.h" 10 #include "chrome/browser/extensions/api/api_function.h"
11 #include "chrome/browser/extensions/api/api_resource_manager.h" 11 #include "chrome/browser/extensions/api/api_resource_manager.h"
12 #include "chrome/common/extensions/api/experimental_usb.h" 12 #include "chrome/common/extensions/api/experimental_usb.h"
13 13
14 class UsbDevice; 14 class UsbDevice;
15 15
16 namespace extensions { 16 namespace extensions {
17 17
18 class ApiResourceEventNotifier; 18 class ApiResourceEventNotifier;
19 class UsbDeviceResource; 19 class UsbDeviceResource;
20 20
21 class UsbAsyncApiFunction : public AsyncApiFunction { 21 class UsbAsyncApiFunction : public AsyncApiFunction {
22 public: 22 public:
23 UsbAsyncApiFunction(); 23 UsbAsyncApiFunction();
24 24
25 protected: 25 protected:
26 virtual ~UsbAsyncApiFunction(); 26 virtual ~UsbAsyncApiFunction();
27 27
28 virtual bool PrePrepare() OVERRIDE; 28 virtual bool PrePrepare() OVERRIDE;
29 29
30 UsbDeviceResource* GetUsbDeviceResource(int api_resource_id);
31 void RemoveUsbDeviceResource(int api_resource_id);
32
30 ApiResourceManager<UsbDeviceResource>* manager_; 33 ApiResourceManager<UsbDeviceResource>* manager_;
31 }; 34 };
32 35
33 class UsbFindDeviceFunction : public UsbAsyncApiFunction { 36 class UsbFindDeviceFunction : public UsbAsyncApiFunction {
34 public: 37 public:
35 DECLARE_EXTENSION_FUNCTION_NAME("experimental.usb.findDevice"); 38 DECLARE_EXTENSION_FUNCTION_NAME("experimental.usb.findDevice");
36 39
37 UsbFindDeviceFunction(); 40 UsbFindDeviceFunction();
38 41
39 static void SetDeviceForTest(UsbDevice* device); 42 static void SetDeviceForTest(UsbDevice* device);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 virtual bool Respond() OVERRIDE; 133 virtual bool Respond() OVERRIDE;
131 134
132 private: 135 private:
133 scoped_ptr<extensions::api::experimental_usb::IsochronousTransfer::Params> 136 scoped_ptr<extensions::api::experimental_usb::IsochronousTransfer::Params>
134 parameters_; 137 parameters_;
135 }; 138 };
136 139
137 } // namespace extensions 140 } // namespace extensions
138 141
139 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ 142 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/socket/udp_socket_unittest.cc ('k') | chrome/browser/extensions/api/usb/usb_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698