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

Side by Side Diff: ppapi/cpp/dev/resource_array_dev.cc

Issue 9111008: Introduce PPB_ResourceArray_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 11 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
« no previous file with comments | « ppapi/cpp/dev/resource_array_dev.h ('k') | ppapi/ppapi_shared.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #include "ppapi/cpp/dev/resource_array_dev.h"
6
7 #include "ppapi/c/dev/ppb_resource_array_dev.h"
8 #include "ppapi/cpp/instance.h"
9 #include "ppapi/cpp/module_impl.h"
10
11 namespace pp {
12
13 namespace {
14
15 template <> const char* interface_name<PPB_ResourceArray_Dev>() {
16 return PPB_RESOURCEARRAY_DEV_INTERFACE;
17 }
18
19 } // namespace
20
21 ResourceArray_Dev::ResourceArray_Dev() {
22 }
23
24 ResourceArray_Dev::ResourceArray_Dev(PassRef, PP_Resource resource) {
25 PassRefFromConstructor(resource);
26 }
27
28 ResourceArray_Dev::ResourceArray_Dev(const ResourceArray_Dev& other)
29 : Resource(other) {
30 }
31
32 ResourceArray_Dev::ResourceArray_Dev(Instance* instance,
33 const PP_Resource elements[],
34 uint32_t size) {
35 if (has_interface<PPB_ResourceArray_Dev>() && instance) {
36 PassRefFromConstructor(get_interface<PPB_ResourceArray_Dev>()->Create(
37 instance->pp_instance(), elements, size));
38 }
39 }
40
41 ResourceArray_Dev::~ResourceArray_Dev() {
42 }
43
44 ResourceArray_Dev& ResourceArray_Dev::operator=(
45 const ResourceArray_Dev& other) {
46 Resource::operator=(other);
47 return *this;
48 }
49
50 uint32_t ResourceArray_Dev::size() const {
51 if (!has_interface<PPB_ResourceArray_Dev>())
52 return 0;
53 return get_interface<PPB_ResourceArray_Dev>()->GetSize(pp_resource());
54 }
55
56 PP_Resource ResourceArray_Dev::operator[](uint32_t index) const {
57 if (!has_interface<PPB_ResourceArray_Dev>())
58 return 0;
59 return get_interface<PPB_ResourceArray_Dev>()->GetAt(pp_resource(), index);
60 }
61
62 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/resource_array_dev.h ('k') | ppapi/ppapi_shared.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698