Commit 32f73c9f authored by pilgrim@chromium.org's avatar pilgrim@chromium.org
Browse files

[Chromium][Mac] Remove loadFont from PlatformSupport

https://bugs.webkit.org/show_bug.cgi?id=97360

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

Source/WebCore:

* platform/chromium/PlatformSupport.h:
(PlatformSupport):
* platform/graphics/chromium/CrossProcessFontLoading.mm:

Source/WebKit/chromium:

* src/PlatformSupport.cpp:
(WebCore):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a39652e1
2012-09-24 Mark Pilgrim <pilgrim@chromium.org>
[Chromium][Mac] Remove loadFont from PlatformSupport
https://bugs.webkit.org/show_bug.cgi?id=97360
Reviewed by Adam Barth.
Part of a refactoring series. See tracking bug 82948.
* platform/chromium/PlatformSupport.h:
(PlatformSupport):
* platform/graphics/chromium/CrossProcessFontLoading.mm:
2012-09-24 Tony Chang <tony@chromium.org>
 
Replace 2 uses of updateLogicalHeight with computeLogicalHeight
......@@ -49,15 +49,6 @@ typedef struct NPObject NPObject;
typedef struct _NPP NPP_t;
typedef NPP_t* NPP;
#if OS(DARWIN)
typedef struct CGFont* CGFontRef;
#ifdef __OBJC__
@class NSFont;
#else
class NSFont;
#endif
#endif // OS(DARWIN)
#if OS(WINDOWS)
typedef struct HFONT__* HFONT;
#endif
......@@ -99,9 +90,6 @@ public:
#if OS(WINDOWS)
static bool ensureFontLoaded(HFONT);
#endif
#if OS(DARWIN)
static bool loadFont(NSFont* srcFont, CGFontRef*, uint32_t* fontID);
#endif
// IndexedDB ----------------------------------------------------------
static PassRefPtr<IDBFactoryBackendInterface> idbFactory();
......
......@@ -30,8 +30,10 @@
#import "CrossProcessFontLoading.h"
#import "../graphics/FontPlatformData.h"
#import "PlatformSupport.h"
#include "LinkHash.h"
#import <AppKit/NSFont.h>
#import <public/Platform.h>
#import <public/mac/WebSandboxSupport.h>
#import <wtf/HashMap.h>
namespace WebCore {
......@@ -121,7 +123,15 @@ PassRefPtr<MemoryActivatedFont> loadFontFromBrowserProcess(NSFont* nsFont)
CGFontRef tmpCGFont;
uint32_t fontID;
// Send cross-process request to load font.
if (!PlatformSupport::loadFont(nsFont, &tmpCGFont, &fontID))
WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport();
if (!sandboxSupport) {
// This function should only be called in response to an error loading a
// font due to being blocked by the sandbox.
// This by definition shouldn't happen if there is no sandbox support.
ASSERT_NOT_REACHED();
return 0;
}
if (!sandboxSupport->loadFont(nsFont, &tmpCGFont, &fontID))
return 0;
RetainPtr<CGFontRef> cgFont(tmpCGFont);
......@@ -129,7 +139,7 @@ PassRefPtr<MemoryActivatedFont> loadFontFromBrowserProcess(NSFont* nsFont)
// the ID cache.
font = fontCacheByFontID().get(fontID);
if (font)
// FIXME: PlatformSupport::loadFont() should consult the id cache
// FIXME: WebSandboxSupport::loadFont() should consult the id cache
// before activating the font.
return font;
......
2012-09-24 Mark Pilgrim <pilgrim@chromium.org>
[Chromium][Mac] Remove loadFont from PlatformSupport
https://bugs.webkit.org/show_bug.cgi?id=97360
Reviewed by Adam Barth.
Part of a refactoring series. See tracking bug 82948.
* src/PlatformSupport.cpp:
(WebCore):
2012-09-24 Tony Chang <tony@chromium.org>
 
Unreviewed. Rolled DEPS.
......
......@@ -217,24 +217,6 @@ bool PlatformSupport::ensureFontLoaded(HFONT font)
}
#endif
#if OS(DARWIN)
bool PlatformSupport::loadFont(NSFont* srcFont, CGFontRef* out, uint32_t* fontID)
{
WebSandboxSupport* ss = WebKit::Platform::current()->sandboxSupport();
if (ss)
return ss->loadFont(srcFont, out, fontID);
// This function should only be called in response to an error loading a
// font due to being blocked by the sandbox.
// This by definition shouldn't happen if there is no sandbox support.
ASSERT_NOT_REACHED();
*out = 0;
*fontID = 0;
return false;
}
#elif OS(UNIX)
#endif
// Indexed Database -----------------------------------------------------------
PassRefPtr<IDBFactoryBackendInterface> PlatformSupport::idbFactory()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment