| 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_IO_PEPPER_INTERFACE_H_ | 5 #ifndef LIBRARIES_NACL_IO_PEPPER_INTERFACE_H_ |
| 6 #define LIBRARIES_NACL_IO_PEPPER_INTERFACE_H_ | 6 #define LIBRARIES_NACL_IO_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> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "nacl_io/pepper/undef_macros.h" | 41 #include "nacl_io/pepper/undef_macros.h" |
| 42 | 42 |
| 43 int PPErrorToErrno(int32_t err); | 43 int PPErrorToErrno(int32_t err); |
| 44 | 44 |
| 45 class PepperInterface { | 45 class PepperInterface { |
| 46 public: | 46 public: |
| 47 virtual ~PepperInterface() {} | 47 virtual ~PepperInterface() {} |
| 48 virtual PP_Instance GetInstance() = 0; | 48 virtual PP_Instance GetInstance() = 0; |
| 49 virtual void AddRefResource(PP_Resource) = 0; | 49 virtual void AddRefResource(PP_Resource) = 0; |
| 50 virtual void ReleaseResource(PP_Resource) = 0; | 50 virtual void ReleaseResource(PP_Resource) = 0; |
| 51 virtual bool IsMainThread() = 0; |
| 51 | 52 |
| 52 // Interface getters. | 53 // Interface getters. |
| 53 #include "nacl_io/pepper/define_empty_macros.h" | 54 #include "nacl_io/pepper/define_empty_macros.h" |
| 54 #undef BEGIN_INTERFACE | 55 #undef BEGIN_INTERFACE |
| 55 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ | 56 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ |
| 56 virtual BaseClass* Get##BaseClass() = 0; | 57 virtual BaseClass* Get##BaseClass() = 0; |
| 57 #include "nacl_io/pepper/all_interfaces.h" | 58 #include "nacl_io/pepper/all_interfaces.h" |
| 58 #include "nacl_io/pepper/undef_macros.h" | 59 #include "nacl_io/pepper/undef_macros.h" |
| 59 }; | 60 }; |
| 60 | 61 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 PP_Resource Release(); | 93 PP_Resource Release(); |
| 93 | 94 |
| 94 private: | 95 private: |
| 95 PepperInterface* ppapi_; | 96 PepperInterface* ppapi_; |
| 96 PP_Resource resource_; | 97 PP_Resource resource_; |
| 97 | 98 |
| 98 DISALLOW_COPY_AND_ASSIGN(ScopedResource); | 99 DISALLOW_COPY_AND_ASSIGN(ScopedResource); |
| 99 }; | 100 }; |
| 100 | 101 |
| 101 #endif // LIBRARIES_NACL_IO_PEPPER_INTERFACE_H_ | 102 #endif // LIBRARIES_NACL_IO_PEPPER_INTERFACE_H_ |
| OLD | NEW |