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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/ppapi_proxy/plugin_resource.cc
diff --git a/src/shared/ppapi_proxy/plugin_resource.cc b/src/shared/ppapi_proxy/plugin_resource.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b179f3a5e906181cdb592d4e7e4056d7eb910813
--- /dev/null
+++ b/src/shared/ppapi_proxy/plugin_resource.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2010 The Native Client Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "native_client/src/shared/ppapi_proxy/plugin_resource.h"
+
+namespace ppapi_proxy {
+
+PluginResource::PluginResource(PluginModule* module)
+ : resource_id_(0), module_(module) {
+}
+
+PluginResource::~PluginResource() {
+}
+
+PP_Resource PluginResource::GetReference() {
+ PluginResourceTracker *tracker = PluginResourceTracker::Get();
+ if (resource_id_)
+ tracker->AddRefResource(resource_id_);
+ else
+ resource_id_ = tracker->AddResource(this);
+ return resource_id_;
+}
+
+void PluginResource::StoppedTracking() {
+ resource_id_ = 0;
+}
+
+} // namespace ppapi_proxy
+
« 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