Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_ | |
| 6 #define PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "ppapi/shared_impl/resource.h" | |
| 11 #include "ppapi/thunk/ppb_resource_array_api.h" | |
| 12 | |
| 13 namespace ppapi { | |
| 14 | |
| 15 class PPAPI_SHARED_EXPORT PPB_ResourceArray_Shared | |
| 16 : public Resource, | |
| 17 public thunk::PPB_ResourceArray_API { | |
| 18 public: | |
| 19 struct InitAsImpl {}; | |
| 20 struct InitAsProxy {}; | |
| 21 | |
| 22 // The dummy arguments control which version of Resource's constructor is | |
| 23 // called for this base class. | |
| 24 PPB_ResourceArray_Shared(const InitAsImpl&, | |
| 25 PP_Instance instance, | |
| 26 const PP_Resource elements[], | |
| 27 uint32_t size); | |
| 28 PPB_ResourceArray_Shared(const InitAsProxy&, | |
| 29 PP_Instance instance, | |
| 30 const PP_Resource elements[], | |
| 31 uint32_t size); | |
| 32 | |
| 33 virtual ~PPB_ResourceArray_Shared(); | |
| 34 | |
| 35 // Resource overrides. | |
| 36 virtual PPB_ResourceArray_API* AsPPB_ResourceArray_API() OVERRIDE; | |
| 37 | |
| 38 // PPB_ResourceArray_API implementation. | |
| 39 virtual uint32_t GetSize() OVERRIDE; | |
| 40 virtual PP_Resource GetAt(uint32_t index) OVERRIDE; | |
| 41 | |
| 42 private: | |
| 43 void Initialize(const PP_Resource elements[], uint32_t size); | |
| 44 | |
| 45 PP_Resource* elements_; | |
|
brettw
2012/01/05 22:32:28
Why not just use a std::vector<PP_Resource> here t
yzshen1
2012/01/06 18:20:11
Done.
I used a raw buffer because the contents/si
| |
| 46 uint32_t size_; | |
| 47 | |
| 48 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_ResourceArray_Shared); | |
| 49 }; | |
| 50 | |
| 51 } // namespace ppapi | |
| 52 | |
| 53 #endif // PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_ | |
| OLD | NEW |