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

Unified Diff: ppapi/proxy/plugin_resource_tracker.cc

Issue 6981001: Make the Pepper proxy support in-process font rendering. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/proxy/plugin_dispatcher.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_resource_tracker.cc
===================================================================
--- ppapi/proxy/plugin_resource_tracker.cc (revision 84713)
+++ ppapi/proxy/plugin_resource_tracker.cc (working copy)
@@ -90,17 +90,14 @@
PP_Resource PluginResourceTracker::AddResource(
linked_ptr<PluginResource> object) {
- if (object->host_resource().is_null()) {
- // Prevent adding null resources or GetResourceObject(0) will return a
- // valid pointer!
- NOTREACHED();
- return 0;
- }
-
PP_Resource plugin_resource = ++last_resource_id_;
DCHECK(resource_map_.find(plugin_resource) == resource_map_.end());
resource_map_[plugin_resource] = ResourceInfo(1, object);
- host_resource_map_[object->host_resource()] = plugin_resource;
+ if (!object->host_resource().is_null()) {
+ // The host resource ID will be 0 for resources that only exist in the
+ // plugin process. Don't add those to the list.
+ host_resource_map_[object->host_resource()] = plugin_resource;
+ }
return plugin_resource;
}
@@ -157,7 +154,8 @@
PluginDispatcher* dispatcher =
PluginDispatcher::GetForInstance(plugin_resource->instance());
HostResource host_resource = plugin_resource->host_resource();
- host_resource_map_.erase(host_resource);
+ if (!host_resource.is_null())
+ host_resource_map_.erase(host_resource);
resource_map_.erase(found);
plugin_resource.reset();
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698