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

Side by Side Diff: ppapi/shared_impl/scoped_pp_resource.cc

Issue 8342016: Revert 106142 - Add a new globals object for PPAPI tracking information. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 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/shared_impl/resource_tracker_unittest.cc ('k') | ppapi/shared_impl/test_globals.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/shared_impl/scoped_pp_resource.h" 5 #include "ppapi/shared_impl/scoped_pp_resource.h"
6 6
7 #include "ppapi/shared_impl/ppapi_globals.h"
8 #include "ppapi/shared_impl/resource.h" 7 #include "ppapi/shared_impl/resource.h"
9 #include "ppapi/shared_impl/resource_tracker.h" 8 #include "ppapi/shared_impl/resource_tracker.h"
9 #include "ppapi/shared_impl/tracker_base.h"
10 10
11 namespace ppapi { 11 namespace ppapi {
12 12
13 ScopedPPResource::ScopedPPResource() : id_(0) { 13 ScopedPPResource::ScopedPPResource() : id_(0) {
14 } 14 }
15 15
16 ScopedPPResource::ScopedPPResource(PP_Resource resource) : id_(resource) { 16 ScopedPPResource::ScopedPPResource(PP_Resource resource) : id_(resource) {
17 CallAddRef(); 17 CallAddRef();
18 } 18 }
19 19
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 PP_Resource ScopedPPResource::Release() { 57 PP_Resource ScopedPPResource::Release() {
58 CallRelease(); 58 CallRelease();
59 59
60 PP_Resource ret = id_; 60 PP_Resource ret = id_;
61 id_ = 0; 61 id_ = 0;
62 return ret; 62 return ret;
63 } 63 }
64 64
65 void ScopedPPResource::CallAddRef() { 65 void ScopedPPResource::CallAddRef() {
66 if (id_) 66 if (id_)
67 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(id_); 67 TrackerBase::Get()->GetResourceTracker()->AddRefResource(id_);
68 } 68 }
69 69
70 void ScopedPPResource::CallRelease() { 70 void ScopedPPResource::CallRelease() {
71 if (id_) 71 if (id_)
72 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(id_); 72 TrackerBase::Get()->GetResourceTracker()->ReleaseResource(id_);
73 } 73 }
74 74
75 } // namespace ppapi 75 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/resource_tracker_unittest.cc ('k') | ppapi/shared_impl/test_globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698