summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 14:06:14 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 14:06:14 +0000
commitbc0c3ba245f12d916dbf028cee9a602bda2550f9 (patch)
tree348362d01cb7eb1bab1e4ff83ccaab3cb4fc1381
parentc7189e191b90798715edcdf8b2edaa2c0c29f3cd (diff)
downloadchromium_src-bc0c3ba245f12d916dbf028cee9a602bda2550f9.zip
chromium_src-bc0c3ba245f12d916dbf028cee9a602bda2550f9.tar.gz
chromium_src-bc0c3ba245f12d916dbf028cee9a602bda2550f9.tar.bz2
Cleanup: Rename OnLoadFont->OnPreCacheFont
I'm working on a Mac specific change where we'll need an IPC message to load a font and pass the font data back to the renderer process. To prevent confusion this CL preemptively renames a Windows message which actually causes a font to be cached by the browser. The distinction between these two operations is subtle but I thought it best to try to prevent future confusion by making sure the IPC messages don't have similar names. BUG=None TEST=None Review URL: http://codereview.chromium.org/1805002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45931 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc8
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h6
-rw-r--r--chrome/common/render_messages_internal.h6
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.cc2
4 files changed, 11 insertions, 11 deletions
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index 0ef86ea..b5d399d 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -436,7 +436,7 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_DeleteCookie, OnDeleteCookie)
IPC_MESSAGE_HANDLER(ViewHostMsg_GetCookiesEnabled, OnGetCookiesEnabled)
#if defined(OS_WIN) // This hack is Windows-specific.
- IPC_MESSAGE_HANDLER(ViewHostMsg_LoadFont, OnLoadFont)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_PreCacheFont, OnPreCacheFont)
#endif
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetPlugins, OnGetPlugins)
IPC_MESSAGE_HANDLER(ViewHostMsg_GetPluginPath, OnGetPluginPath)
@@ -713,10 +713,10 @@ void ResourceMessageFilter::OnGetCookiesEnabled(
}
#if defined(OS_WIN) // This hack is Windows-specific.
-void ResourceMessageFilter::OnLoadFont(LOGFONT font) {
- // If renderer is running in a sandbox, GetTextMetrics
+void ResourceMessageFilter::OnPreCacheFont(LOGFONT font) {
+ // If the renderer is running in a sandbox, GetTextMetrics()
// can sometimes fail. If a font has not been loaded
- // previously, GetTextMetrics will try to load the font
+ // previously, GetTextMetrics() will try to load the font
// from the font file. However, the sandboxed renderer does
// not have permissions to access any font files and
// the call fails. So we make the browser pre-load the
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index e16edc8..4a3f544 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -161,9 +161,9 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
uint32 user_data);
#if defined(OS_WIN) // This hack is Windows-specific.
- // Cache fonts for the renderer. See ResourceMessageFilter::OnLoadFont
- // implementation for more details
- void OnLoadFont(LOGFONT font);
+ // Cache fonts for the renderer. See ResourceMessageFilter::OnPreCacheFont
+ // implementation for more details.
+ void OnPreCacheFont(LOGFONT font);
#endif
#if !defined(OS_MACOSX)
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 60c4cab..d575873 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -1407,9 +1407,9 @@ IPC_BEGIN_MESSAGES(ViewHost)
#endif
#if defined(OS_WIN)
- // Request that the given font be loaded by the browser.
- // Please see ResourceMessageFilter::OnLoadFont for details.
- IPC_SYNC_MESSAGE_CONTROL1_0(ViewHostMsg_LoadFont,
+ // Request that the given font be loaded by the browser so it's cached by the
+ // OS. Please see ResourceMessageFilter::OnPreCacheFont for details.
+ IPC_SYNC_MESSAGE_CONTROL1_0(ViewHostMsg_PreCacheFont,
LOGFONT /* font data */)
#endif // defined(OS_WIN)
diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc
index ec34479..5359f13 100644
--- a/chrome/renderer/renderer_webkitclient_impl.cc
+++ b/chrome/renderer/renderer_webkitclient_impl.cc
@@ -230,7 +230,7 @@ WebString RendererWebKitClientImpl::MimeRegistry::preferredExtensionForMIMEType(
bool RendererWebKitClientImpl::SandboxSupport::ensureFontLoaded(HFONT font) {
LOGFONT logfont;
GetObject(font, sizeof(LOGFONT), &logfont);
- return RenderThread::current()->Send(new ViewHostMsg_LoadFont(logfont));
+ return RenderThread::current()->Send(new ViewHostMsg_PreCacheFont(logfont));
}
#elif defined(OS_LINUX)