summaryrefslogtreecommitdiffstats
path: root/ppapi/shared_impl/ppb_resource_array_shared.h
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-07 00:51:01 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-07 00:51:01 +0000
commit6117b82da99a439a5e2c02acfc320291d1c3abc2 (patch)
treec4fc666f220604f716b8e291ea8fa5c9766c0846 /ppapi/shared_impl/ppb_resource_array_shared.h
parentcec568d6f1e79bda1362bd5d64f494ccd79e6d08 (diff)
downloadchromium_src-6117b82da99a439a5e2c02acfc320291d1c3abc2.zip
chromium_src-6117b82da99a439a5e2c02acfc320291d1c3abc2.tar.gz
chromium_src-6117b82da99a439a5e2c02acfc320291d1c3abc2.tar.bz2
Introduce PPB_ResourceArray_Dev.
TEST=test_resource_array.{h,cc} BUG=None Review URL: http://codereview.chromium.org/9111008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/shared_impl/ppb_resource_array_shared.h')
-rw-r--r--ppapi/shared_impl/ppb_resource_array_shared.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/ppapi/shared_impl/ppb_resource_array_shared.h b/ppapi/shared_impl/ppb_resource_array_shared.h
new file mode 100644
index 0000000..55342e0
--- /dev/null
+++ b/ppapi/shared_impl/ppb_resource_array_shared.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_
+#define PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "ppapi/shared_impl/resource.h"
+#include "ppapi/thunk/ppb_resource_array_api.h"
+
+namespace ppapi {
+
+class PPAPI_SHARED_EXPORT PPB_ResourceArray_Shared
+ : public Resource,
+ public thunk::PPB_ResourceArray_API {
+ public:
+ struct InitAsImpl {};
+ struct InitAsProxy {};
+
+ // The dummy arguments control which version of Resource's constructor is
+ // called for this base class.
+ PPB_ResourceArray_Shared(const InitAsImpl&,
+ PP_Instance instance,
+ const PP_Resource elements[],
+ uint32_t size);
+ PPB_ResourceArray_Shared(const InitAsProxy&,
+ PP_Instance instance,
+ const PP_Resource elements[],
+ uint32_t size);
+
+ virtual ~PPB_ResourceArray_Shared();
+
+ // Resource overrides.
+ virtual PPB_ResourceArray_API* AsPPB_ResourceArray_API() OVERRIDE;
+
+ // PPB_ResourceArray_API implementation.
+ virtual uint32_t GetSize() OVERRIDE;
+ virtual PP_Resource GetAt(uint32_t index) OVERRIDE;
+
+ private:
+ void Initialize(const PP_Resource elements[], uint32_t size);
+
+ std::vector<PP_Resource> resources_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_ResourceArray_Shared);
+};
+
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_