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

Unified Diff: ppapi/proxy/ppb_pdf_proxy.cc

Issue 6282007: First pass at making the proxy handle multiple renderers. This associates the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/ppb_instance_proxy.cc ('k') | ppapi/proxy/ppb_testing_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_pdf_proxy.cc
===================================================================
--- ppapi/proxy/ppb_pdf_proxy.cc (revision 71973)
+++ ppapi/proxy/ppb_pdf_proxy.cc (working copy)
@@ -14,6 +14,7 @@
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/ppapi_messages.h"
namespace pp {
@@ -21,7 +22,7 @@
class PrivateFontFile : public PluginResource {
public:
- PrivateFontFile() {}
+ PrivateFontFile(PP_Instance instance) : PluginResource(instance) {}
virtual ~PrivateFontFile() {}
// Resource overrides.
@@ -60,7 +61,10 @@
PP_Instance instance,
const PP_FontDescription_Dev* description,
PP_PrivateFontCharset charset) {
- PluginDispatcher* dispatcher = PluginDispatcher::Get();
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ if (!dispatcher)
+ return 0;
+
SerializedFontDescription desc;
desc.SetFromPPFontDescription(dispatcher, *description, true);
@@ -70,8 +74,8 @@
if (!result)
return 0;
- linked_ptr<PrivateFontFile> object(new PrivateFontFile);
- dispatcher->plugin_resource_tracker()->AddResource(result, object);
+ linked_ptr<PrivateFontFile> object(new PrivateFontFile(instance));
+ PluginResourceTracker::GetInstance()->AddResource(result, object);
return result;
}
@@ -82,13 +86,16 @@
PrivateFontFile* object = PluginResource::GetAs<PrivateFontFile>(font_file);
if (!object)
return false;
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(
+ object->instance());
+ if (!dispatcher)
+ return false;
std::string* contents = object->GetFontTable(table);
if (!contents) {
std::string deserialized;
- PluginDispatcher::Get()->Send(
- new PpapiHostMsg_PPBPDF_GetFontTableForPrivateFontFile(
- INTERFACE_ID_PPB_PDF, font_file, table, &deserialized));
+ dispatcher->Send(new PpapiHostMsg_PPBPDF_GetFontTableForPrivateFontFile(
+ INTERFACE_ID_PPB_PDF, font_file, table, &deserialized));
if (deserialized.empty())
return false;
contents = object->AddFontTable(table, deserialized);
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.cc ('k') | ppapi/proxy/ppb_testing_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698