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

Unified Diff: ppapi/proxy/ppb_font_proxy.cc

Issue 7629017: Add a unified resource tracker shared between the proxy and the impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Assertion fixed Created 9 years, 4 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
Index: ppapi/proxy/ppb_font_proxy.cc
diff --git a/ppapi/proxy/ppb_font_proxy.cc b/ppapi/proxy/ppb_font_proxy.cc
index 392481bac887d65f359ff383b47879acaf011a98..2760c0b9a112c98783311aa2a62dbf55f1bdbe30 100644
--- a/ppapi/proxy/ppb_font_proxy.cc
+++ b/ppapi/proxy/ppb_font_proxy.cc
@@ -12,13 +12,14 @@
#include "ppapi/proxy/ppb_image_data_proxy.h"
#include "ppapi/proxy/serialized_var.h"
#include "ppapi/shared_impl/ppapi_preferences.h"
-#include "ppapi/shared_impl/resource_object_base.h"
+#include "ppapi/shared_impl/resource.h"
#include "ppapi/shared_impl/var.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_image_data_api.h"
#include "ppapi/thunk/thunk.h"
using ppapi::HostResource;
+using ppapi::Resource;
using ppapi::StringVar;
using ppapi::thunk::EnterResourceNoLock;
using ppapi::thunk::PPB_ImageData_API;
@@ -95,19 +96,20 @@ bool PPB_Font_Proxy::OnMessageReceived(const IPC::Message& msg) {
Font::Font(const HostResource& resource,
const PP_FontDescription_Dev& desc)
- : PluginResource(resource),
+ : Resource(resource),
webkit_event_(false, false) {
TRACE_EVENT0("ppapi proxy", "Font::Font");
scoped_refptr<StringVar> face(StringVar::FromPPVar(desc.face));
- WebKitForwarding* forwarding = GetDispatcher()->GetWebKitForwarding();
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForResource(this);
+ WebKitForwarding* forwarding = dispatcher->GetWebKitForwarding();
RunOnWebKitThread(true,
base::Bind(&WebKitForwarding::CreateFontForwarding,
base::Unretained(forwarding),
&webkit_event_, desc,
face.get() ? face->value() : std::string(),
- GetDispatcher()->preferences(),
+ dispatcher->preferences(),
&font_forwarding_));
}
@@ -221,7 +223,7 @@ int32_t Font::PixelOffsetForCharacter(const PP_TextRun_Dev* text,
}
void Font::RunOnWebKitThread(bool blocking, const base::Closure& task) {
- GetDispatcher()->PostToWebKitThread(FROM_HERE, task);
+ PluginDispatcher::GetForResource(this)->PostToWebKitThread(FROM_HERE, task);
if (blocking)
webkit_event_.Wait();
}

Powered by Google App Engine
This is Rietveld 408576698