| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PPAPI_THUNK_ENTER_H_ | 5 #ifndef PPAPI_THUNK_ENTER_H_ |
| 6 #define PPAPI_THUNK_ENTER_H_ | 6 #define PPAPI_THUNK_ENTER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
| 10 #include "ppapi/proxy/interface_id.h" | 10 #include "ppapi/proxy/interface_id.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // TODO(brettw) actually implement locks, this is just a placeholder for now. | 121 // TODO(brettw) actually implement locks, this is just a placeholder for now. |
| 122 template<typename ResourceT> | 122 template<typename ResourceT> |
| 123 class EnterResourceNoLock : public EnterResource<ResourceT> { | 123 class EnterResourceNoLock : public EnterResource<ResourceT> { |
| 124 public: | 124 public: |
| 125 EnterResourceNoLock(PP_Resource resource, bool report_error) | 125 EnterResourceNoLock(PP_Resource resource, bool report_error) |
| 126 : EnterResource<ResourceT>(resource, report_error) { | 126 : EnterResource<ResourceT>(resource, report_error) { |
| 127 // TODO(brettw) assert the lock is held. | 127 // TODO(brettw) assert the lock is held. |
| 128 } | 128 } |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 // Simpler wrapper to enter the resource creation API. This is used for every | |
| 132 // class so we have this helper function to save template instantiations and | |
| 133 // typing. | |
| 134 class EnterResourceCreation : public EnterFunctionNoLock<ResourceCreationAPI> { | |
| 135 public: | |
| 136 EnterResourceCreation(PP_Instance instance); | |
| 137 ~EnterResourceCreation(); | |
| 138 }; | |
| 139 | |
| 140 // Simpler wrapper to enter the instance API from proxy code. This is used for | |
| 141 // many interfaces so we have this helper function to save template | |
| 142 // instantiations and typing. | |
| 143 class EnterInstance : public EnterFunctionNoLock<PPB_Instance_FunctionAPI> { | |
| 144 public: | |
| 145 EnterInstance(PP_Instance instance); | |
| 146 ~EnterInstance(); | |
| 147 }; | |
| 148 | |
| 149 } // namespace thunk | 131 } // namespace thunk |
| 150 } // namespace ppapi | 132 } // namespace ppapi |
| 151 | 133 |
| 152 #endif // PPAPI_THUNK_ENTER_H_ | 134 #endif // PPAPI_THUNK_ENTER_H_ |
| OLD | NEW |