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

Unified Diff: content/renderer/renderer_webkitclient_impl.cc

Issue 7080024: Mac: Part 1 of a fix to get OOP font loading working in the renderer on 10.6.6 . (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix review comments 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 | « content/common/view_messages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_webkitclient_impl.cc
diff --git a/content/renderer/renderer_webkitclient_impl.cc b/content/renderer/renderer_webkitclient_impl.cc
index 6dafa8d18daa81943ccaac7d5050e3abf7a68acc..33c8673218a220a6285555b6e742a37791b02b32 100644
--- a/content/renderer/renderer_webkitclient_impl.cc
+++ b/content/renderer/renderer_webkitclient_impl.cc
@@ -113,7 +113,10 @@ class RendererWebKitClientImpl::SandboxSupport
#if defined(OS_WIN)
virtual bool ensureFontLoaded(HFONT);
#elif defined(OS_MACOSX)
+ // TODO(jeremy): Remove once WebKit side of patch lands - crbug.com/72727 .
virtual bool loadFont(NSFont* srcFont, ATSFontContainerRef* out);
+ virtual bool loadFont(
+ NSFont* srcFont, ATSFontContainerRef* container, uint32* fontID);
#elif defined(OS_LINUX)
virtual WebKit::WebString getFontFamilyForCharacters(
const WebKit::WebUChar* characters,
@@ -463,30 +466,45 @@ void RendererWebKitClientImpl::SandboxSupport::getRenderStyleForStrike(
#elif defined(OS_MACOSX)
-bool RendererWebKitClientImpl::SandboxSupport::loadFont(NSFont* srcFont,
- ATSFontContainerRef* out) {
+// TODO(jeremy): Remove once WebKit side of patch lands - crbug.com/72727 .
+bool RendererWebKitClientImpl::SandboxSupport::loadFont(
+ NSFont* srcFont, ATSFontContainerRef* out) {
+ uint32 temp;
+ return loadFont(srcFont, out, &temp);
+}
+
+bool RendererWebKitClientImpl::SandboxSupport::loadFont(
+ NSFont* srcFont, ATSFontContainerRef* container, uint32* fontID) {
DCHECK(srcFont);
- DCHECK(out);
+ DCHECK(container);
+ DCHECK(fontID);
uint32 font_data_size;
FontDescriptor src_font_descriptor(srcFont);
base::SharedMemoryHandle font_data;
if (!RenderThread::current()->Send(new ViewHostMsg_LoadFont(
- src_font_descriptor, &font_data_size, &font_data))) {
+ src_font_descriptor, &font_data_size, &font_data, fontID))) {
LOG(ERROR) << "Sending ViewHostMsg_LoadFont() IPC failed for " <<
src_font_descriptor.font_name;
- *out = kATSFontContainerRefUnspecified;
+ *container = kATSFontContainerRefUnspecified;
+ *fontID = 0;
return false;
}
- if (font_data_size == 0 || font_data == base::SharedMemory::NULLHandle()) {
+ if (font_data_size == 0 || font_data == base::SharedMemory::NULLHandle() ||
+ *fontID == 0) {
LOG(ERROR) << "Bad response from ViewHostMsg_LoadFont() for " <<
src_font_descriptor.font_name;
- *out = kATSFontContainerRefUnspecified;
+ *container = kATSFontContainerRefUnspecified;
+ *fontID = 0;
return false;
}
- return FontLoader::ATSFontContainerFromBuffer(font_data, font_data_size, out);
+ // TODO(jeremy): Need to call back into WebKit to make sure that the font
+ // isn't already activated, based on the font id. If it's already
+ // activated, don't reactivate it here - crbug.com/72727 .
+ return FontLoader::ATSFontContainerFromBuffer(font_data, font_data_size,
+ container);
}
#endif
« no previous file with comments | « content/common/view_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698