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

Unified Diff: ppapi/shared_impl/ppb_resource_array_shared.h

Issue 9111008: Introduce PPB_ResourceArray_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/resource_creation_proxy.cc ('k') | ppapi/shared_impl/ppb_resource_array_shared.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_resource_array_shared.h
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 0000000000000000000000000000000000000000..0024f1d10f2b27b3f90b196c4685375bcf9fff6d
--- /dev/null
+++ b/ppapi/shared_impl/ppb_resource_array_shared.h
@@ -0,0 +1,53 @@
+// 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 "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);
+
+ 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
+ uint32_t size_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_ResourceArray_Shared);
+};
+
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_PPB_RESOURCE_ARRAY_SHARED_H_
« no previous file with comments | « ppapi/proxy/resource_creation_proxy.cc ('k') | ppapi/shared_impl/ppb_resource_array_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698