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

Side by Side Diff: src/shared/ppapi_proxy/plugin_resource.cc

Issue 4210003: Started on Resource class. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Resource->PluginResource Created 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Native Client 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 "native_client/src/shared/ppapi_proxy/plugin_resource.h"
6
7 namespace ppapi_proxy {
8
9 PluginResource::PluginResource(PluginModule* module)
10 : resource_id_(0), module_(module) {
11 }
12
13 PluginResource::~PluginResource() {
14 }
15
16 PP_Resource PluginResource::GetReference() {
17 PluginResourceTracker *tracker = PluginResourceTracker::Get();
18 if (resource_id_)
19 tracker->AddRefResource(resource_id_);
20 else
21 resource_id_ = tracker->AddResource(this);
22 return resource_id_;
23 }
24
25 void PluginResource::StoppedTracking() {
26 resource_id_ = 0;
27 }
28
29 } // namespace ppapi_proxy
30
OLDNEW
« no previous file with comments | « src/shared/ppapi_proxy/plugin_resource.h ('k') | src/shared/ppapi_proxy/plugin_resource_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698