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

Side by Side Diff: ppapi/shared_impl/ppb_resource_array_shared.h

Issue 9391013: Make a global enum to differentiate impl & proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_ 5 #ifndef PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_
6 #define PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_ 6 #define PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "ppapi/shared_impl/resource.h" 12 #include "ppapi/shared_impl/resource.h"
13 #include "ppapi/thunk/ppb_resource_array_api.h" 13 #include "ppapi/thunk/ppb_resource_array_api.h"
14 14
15 namespace ppapi { 15 namespace ppapi {
16 16
17 class PPAPI_SHARED_EXPORT PPB_ResourceArray_Shared 17 class PPAPI_SHARED_EXPORT PPB_ResourceArray_Shared
18 : public Resource, 18 : public Resource,
19 public thunk::PPB_ResourceArray_API { 19 public thunk::PPB_ResourceArray_API {
20 public: 20 public:
21 struct InitAsImpl {}; 21 PPB_ResourceArray_Shared(ResourceObjectType type,
22 struct InitAsProxy {};
23
24 // The dummy arguments control which version of Resource's constructor is
25 // called for this base class.
26 PPB_ResourceArray_Shared(const InitAsImpl&,
27 PP_Instance instance, 22 PP_Instance instance,
28 const PP_Resource elements[], 23 const PP_Resource elements[],
29 uint32_t size); 24 uint32_t size);
30 PPB_ResourceArray_Shared(const InitAsProxy&,
31 PP_Instance instance,
32 const PP_Resource elements[],
33 uint32_t size);
34
35 virtual ~PPB_ResourceArray_Shared(); 25 virtual ~PPB_ResourceArray_Shared();
36 26
37 // Resource overrides. 27 // Resource overrides.
38 virtual PPB_ResourceArray_API* AsPPB_ResourceArray_API() OVERRIDE; 28 virtual PPB_ResourceArray_API* AsPPB_ResourceArray_API() OVERRIDE;
39 29
40 // PPB_ResourceArray_API implementation. 30 // PPB_ResourceArray_API implementation.
41 virtual uint32_t GetSize() OVERRIDE; 31 virtual uint32_t GetSize() OVERRIDE;
42 virtual PP_Resource GetAt(uint32_t index) OVERRIDE; 32 virtual PP_Resource GetAt(uint32_t index) OVERRIDE;
43 33
44 private: 34 private:
45 void Initialize(const PP_Resource elements[], uint32_t size);
46
47 std::vector<PP_Resource> resources_; 35 std::vector<PP_Resource> resources_;
48 36
49 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_ResourceArray_Shared); 37 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_ResourceArray_Shared);
50 }; 38 };
51 39
52 } // namespace ppapi 40 } // namespace ppapi
53 41
54 #endif // PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_ 42 #endif // PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698