summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/public/utility/utility_thread.h13
-rw-r--r--content/utility/utility_thread_impl.cc14
-rw-r--r--content/utility/utility_thread_impl.h5
3 files changed, 31 insertions, 1 deletions
diff --git a/content/public/utility/utility_thread.h b/content/public/utility/utility_thread.h
index 7d22efa..d2e43b9 100644
--- a/content/public/utility/utility_thread.h
+++ b/content/public/utility/utility_thread.h
@@ -10,6 +10,10 @@
#include "content/common/content_export.h"
#include "ipc/ipc_message.h"
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
namespace content {
class CONTENT_EXPORT UtilityThread : public IPC::Message::Sender {
@@ -23,6 +27,15 @@ namespace content {
// Releases the process if we are not (or no longer) in batch mode.
virtual void ReleaseProcessIfNeeded() = 0;
+
+#if defined(OS_WIN)
+ // Request that the given font be loaded by the browser so it's cached by the
+ // OS. Please see ChildProcessHost::PreCacheFont for details.
+ virtual void PreCacheFont(const LOGFONT& log_font) = 0;
+
+ // Release cached font.
+ virtual void ReleaseCachedFonts() = 0;
+#endif
};
} // namespace content
diff --git a/content/utility/utility_thread_impl.cc b/content/utility/utility_thread_impl.cc
index a743c27..f53fcd8 100644
--- a/content/utility/utility_thread_impl.cc
+++ b/content/utility/utility_thread_impl.cc
@@ -9,6 +9,7 @@
#include "base/file_path.h"
#include "base/memory/scoped_vector.h"
#include "content/common/child_process.h"
+#include "content/common/child_process_messages.h"
#include "content/common/indexed_db_key.h"
#include "content/common/utility_messages.h"
#include "content/public/utility/content_utility_client.h"
@@ -51,6 +52,19 @@ void UtilityThreadImpl::ReleaseProcessIfNeeded() {
ChildProcess::current()->ReleaseProcess();
}
+#if defined(OS_WIN)
+
+void UtilityThreadImpl::PreCacheFont(const LOGFONT& log_font) {
+ Send(new ChildProcessHostMsg_PreCacheFont(log_font));
+}
+
+void UtilityThreadImpl::ReleaseCachedFonts() {
+ Send(new ChildProcessHostMsg_ReleaseCachedFonts());
+}
+
+#endif // OS_WIN
+
+
bool UtilityThreadImpl::OnControlMessageReceived(const IPC::Message& msg) {
if (content::GetContentClient()->utility()->OnMessageReceived(msg))
return true;
diff --git a/content/utility/utility_thread_impl.h b/content/utility/utility_thread_impl.h
index 149fc6e..ab468c4 100644
--- a/content/utility/utility_thread_impl.h
+++ b/content/utility/utility_thread_impl.h
@@ -39,8 +39,11 @@ class UtilityThreadImpl : public content::UtilityThread,
virtual ~UtilityThreadImpl();
virtual bool Send(IPC::Message* msg) OVERRIDE;
-
virtual void ReleaseProcessIfNeeded() OVERRIDE;
+#if defined(OS_WIN)
+ virtual void PreCacheFont(const LOGFONT& log_font) OVERRIDE;
+ virtual void ReleaseCachedFonts() OVERRIDE;
+#endif
private:
// ChildThread implementation.