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

Unified Diff: ppapi/shared_impl/resource_tracker.cc

Issue 9455083: Proxy the PPP_Printing interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/resource_tracker.h ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/resource_tracker.cc
diff --git a/ppapi/shared_impl/resource_tracker.cc b/ppapi/shared_impl/resource_tracker.cc
index 3b66db8b40b8c7d03b356f4b394706fc26c0fb20..2069c74913e69ef85d7b4918508d01e18a644fcc 100644
--- a/ppapi/shared_impl/resource_tracker.cc
+++ b/ppapi/shared_impl/resource_tracker.cc
@@ -4,6 +4,9 @@
#include "ppapi/shared_impl/resource_tracker.h"
+#include "base/bind.h"
+#include "base/compiler_specific.h"
+#include "base/message_loop.h"
#include "ppapi/shared_impl/callback_tracker.h"
#include "ppapi/shared_impl/id_assignment.h"
#include "ppapi/shared_impl/ppapi_globals.h"
@@ -11,7 +14,9 @@
namespace ppapi {
-ResourceTracker::ResourceTracker() : last_resource_value_(0) {
+ResourceTracker::ResourceTracker()
+ : last_resource_value_(0),
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
}
ResourceTracker::~ResourceTracker() {
@@ -67,6 +72,14 @@ void ResourceTracker::ReleaseResource(PP_Resource res) {
}
}
+void ResourceTracker::ReleaseResourceSoon(PP_Resource res) {
+ MessageLoop::current()->PostNonNestableTask(
+ FROM_HERE,
+ base::Bind(&ResourceTracker::ReleaseResource,
+ weak_ptr_factory_.GetWeakPtr(),
+ res));
+}
+
void ResourceTracker::DidCreateInstance(PP_Instance instance) {
// Due to the infrastructure of some tests, the instance is registered
// twice in a few cases. It would be nice not to do that and assert here
« no previous file with comments | « ppapi/shared_impl/resource_tracker.h ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698