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

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

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USELESS PATCH TITLE Created 8 years, 9 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/device_ref_dev.h ('k') | ppapi/cpp/dev/file_chooser_dev.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ppapi/cpp/dev/device_ref_dev.h" 5 #include "ppapi/cpp/dev/device_ref_dev.h"
6 6
7 #include "ppapi/cpp/module_impl.h" 7 #include "ppapi/cpp/module_impl.h"
8 8
9 namespace pp { 9 namespace pp {
10 10
11 namespace { 11 namespace {
12 12
13 template <> const char* interface_name<PPB_DeviceRef_Dev>() { 13 template <> const char* interface_name<PPB_DeviceRef_Dev>() {
14 return PPB_DEVICEREF_DEV_INTERFACE; 14 return PPB_DEVICEREF_DEV_INTERFACE;
15 } 15 }
16 16
17 } // namespace 17 } // namespace
18 18
19 DeviceRef_Dev::DeviceRef_Dev() { 19 DeviceRef_Dev::DeviceRef_Dev() {
20 } 20 }
21 21
22 DeviceRef_Dev::DeviceRef_Dev(PP_Resource resource) : Resource(resource) { 22 DeviceRef_Dev::DeviceRef_Dev(PP_Resource resource) : Resource(resource) {
23 } 23 }
24 24
25 DeviceRef_Dev::DeviceRef_Dev(PassRef, PP_Resource resource) { 25 DeviceRef_Dev::DeviceRef_Dev(PassRef, PP_Resource resource)
26 PassRefFromConstructor(resource); 26 : Resource(PASS_REF, resource) {
27 } 27 }
28 28
29 DeviceRef_Dev::DeviceRef_Dev(const DeviceRef_Dev& other) : Resource(other) { 29 DeviceRef_Dev::DeviceRef_Dev(const DeviceRef_Dev& other) : Resource(other) {
30 } 30 }
31 31
32 DeviceRef_Dev::~DeviceRef_Dev() { 32 DeviceRef_Dev::~DeviceRef_Dev() {
33 } 33 }
34 34
35 PP_DeviceType_Dev DeviceRef_Dev::GetType() const { 35 PP_DeviceType_Dev DeviceRef_Dev::GetType() const {
36 if (!has_interface<PPB_DeviceRef_Dev>()) 36 if (!has_interface<PPB_DeviceRef_Dev>())
37 return PP_DEVICETYPE_DEV_INVALID; 37 return PP_DEVICETYPE_DEV_INVALID;
38 return get_interface<PPB_DeviceRef_Dev>()->GetType(pp_resource()); 38 return get_interface<PPB_DeviceRef_Dev>()->GetType(pp_resource());
39 } 39 }
40 40
41 Var DeviceRef_Dev::GetName() const { 41 Var DeviceRef_Dev::GetName() const {
42 if (!has_interface<PPB_DeviceRef_Dev>()) 42 if (!has_interface<PPB_DeviceRef_Dev>())
43 return Var(); 43 return Var();
44 return Var(Var::PassRef(), 44 return Var(PASS_REF,
45 get_interface<PPB_DeviceRef_Dev>()->GetName(pp_resource())); 45 get_interface<PPB_DeviceRef_Dev>()->GetName(pp_resource()));
46 } 46 }
47 47
48 } // namespace pp 48 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/device_ref_dev.h ('k') | ppapi/cpp/dev/file_chooser_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698