| OLD | NEW |
| 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 LIBRARIES_NACL_MOUNTS_PEPPER_INTERFACE_H_ | 5 #ifndef LIBRARIES_NACL_MOUNTS_PEPPER_INTERFACE_H_ |
| 6 #define LIBRARIES_NACL_MOUNTS_PEPPER_INTERFACE_H_ | 6 #define LIBRARIES_NACL_MOUNTS_PEPPER_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <ppapi/c/dev/ppb_directory_reader_dev.h> | 8 #include <ppapi/c/dev/ppb_directory_reader_dev.h> |
| 9 #include <ppapi/c/pp_completion_callback.h> | 9 #include <ppapi/c/pp_completion_callback.h> |
| 10 #include <ppapi/c/pp_file_info.h> | 10 #include <ppapi/c/pp_file_info.h> |
| 11 #include <ppapi/c/pp_instance.h> | 11 #include <ppapi/c/pp_instance.h> |
| 12 #include <ppapi/c/pp_resource.h> | 12 #include <ppapi/c/pp_resource.h> |
| 13 #include <ppapi/c/pp_var.h> | 13 #include <ppapi/c/pp_var.h> |
| 14 #include <ppapi/c/ppb_console.h> | 14 #include <ppapi/c/ppb_console.h> |
| 15 #include <ppapi/c/ppb_file_io.h> | 15 #include <ppapi/c/ppb_file_io.h> |
| 16 #include <ppapi/c/ppb_file_ref.h> | 16 #include <ppapi/c/ppb_file_ref.h> |
| 17 #include <ppapi/c/ppb_file_system.h> | 17 #include <ppapi/c/ppb_file_system.h> |
| 18 #include <ppapi/c/ppb_messaging.h> | 18 #include <ppapi/c/ppb_messaging.h> |
| 19 #include <ppapi/c/ppb_messaging.h> | 19 #include <ppapi/c/ppb_messaging.h> |
| 20 #include <ppapi/c/ppb_url_loader.h> |
| 21 #include <ppapi/c/ppb_url_request_info.h> |
| 22 #include <ppapi/c/ppb_url_response_info.h> |
| 20 #include <ppapi/c/ppb_var.h> | 23 #include <ppapi/c/ppb_var.h> |
| 21 | 24 |
| 22 #include <utils/macros.h> | 25 #include <utils/macros.h> |
| 23 | 26 |
| 24 // Note: To add a new interface: | 27 // Note: To add a new interface: |
| 25 // | 28 // |
| 26 // 1. Using one of the other interfaces as a template, add your interface to | 29 // 1. Using one of the other interfaces as a template, add your interface to |
| 27 // all_interfaces.h. | 30 // all_interfaces.h. |
| 28 // 2. Add the necessary pepper header to the top of this file. | 31 // 2. Add the necessary pepper header to the top of this file. |
| 29 // 3. Compile and cross your fingers! | 32 // 3. Compile and cross your fingers! |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 virtual ReturnType MethodName(Type0, Type1, Type2, Type3) = 0; | 75 virtual ReturnType MethodName(Type0, Type1, Type2, Type3) = 0; |
| 73 #define METHOD5(Class, ReturnType, MethodName, Type0, Type1, Type2, Type3, \ | 76 #define METHOD5(Class, ReturnType, MethodName, Type0, Type1, Type2, Type3, \ |
| 74 Type4) \ | 77 Type4) \ |
| 75 virtual ReturnType MethodName(Type0, Type1, Type2, Type3, Type4) = 0; | 78 virtual ReturnType MethodName(Type0, Type1, Type2, Type3, Type4) = 0; |
| 76 #include "nacl_mounts/pepper/all_interfaces.h" | 79 #include "nacl_mounts/pepper/all_interfaces.h" |
| 77 #include "nacl_mounts/pepper/undef_macros.h" | 80 #include "nacl_mounts/pepper/undef_macros.h" |
| 78 | 81 |
| 79 | 82 |
| 80 class ScopedResource { | 83 class ScopedResource { |
| 81 public: | 84 public: |
| 82 struct NoAddRef {}; | 85 // Does not AddRef by default. |
| 86 ScopedResource(PepperInterface* ppapi, PP_Resource resource); |
| 87 ~ScopedResource(); |
| 83 | 88 |
| 84 ScopedResource(PepperInterface* ppapi, PP_Resource resource); | 89 PP_Resource pp_resource() { return resource_; } |
| 85 ScopedResource(PepperInterface* ppapi, PP_Resource resource, NoAddRef); | 90 |
| 86 ~ScopedResource(); | 91 // Return the resource without decrementing its refcount. |
| 92 PP_Resource Release(); |
| 87 | 93 |
| 88 private: | 94 private: |
| 89 PepperInterface* ppapi_; | 95 PepperInterface* ppapi_; |
| 90 PP_Resource resource_; | 96 PP_Resource resource_; |
| 91 | 97 |
| 92 DISALLOW_COPY_AND_ASSIGN(ScopedResource); | 98 DISALLOW_COPY_AND_ASSIGN(ScopedResource); |
| 93 }; | 99 }; |
| 94 | 100 |
| 95 #endif // LIBRARIES_NACL_MOUNTS_PEPPER_INTERFACE_H_ | 101 #endif // LIBRARIES_NACL_MOUNTS_PEPPER_INTERFACE_H_ |
| OLD | NEW |