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

Side by Side Diff: ppapi/cpp/resource.cc

Issue 52233002: [PPAPI] Added VarResource_Dev class. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix Windows compile. Created 7 years, 1 month 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
« no previous file with comments | « ppapi/cpp/resource.h ('k') | ppapi/cpp/var.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/resource.h" 5 #include "ppapi/cpp/resource.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ppapi/cpp/logging.h" 9 #include "ppapi/cpp/logging.h"
10 #include "ppapi/cpp/module.h" 10 #include "ppapi/cpp/module.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 Resource::Resource(PassRef, PP_Resource resource) : pp_resource_(resource) { 47 Resource::Resource(PassRef, PP_Resource resource) : pp_resource_(resource) {
48 } 48 }
49 49
50 void Resource::PassRefFromConstructor(PP_Resource resource) { 50 void Resource::PassRefFromConstructor(PP_Resource resource) {
51 PP_DCHECK(!pp_resource_); 51 PP_DCHECK(!pp_resource_);
52 pp_resource_ = resource; 52 pp_resource_ = resource;
53 } 53 }
54 54
55 void Resource::Clear() {
56 if (is_null())
57 return;
58 Module::Get()->core()->ReleaseResource(pp_resource_);
59 pp_resource_ = 0;
60 }
61
55 } // namespace pp 62 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/resource.h ('k') | ppapi/cpp/var.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698