summaryrefslogtreecommitdiffstats
path: root/chrome/service
diff options
context:
space:
mode:
authorarthurhsu@chromium.org <arthurhsu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-20 03:33:21 +0000
committerarthurhsu@chromium.org <arthurhsu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-20 03:33:21 +0000
commit79fff8227ab720a8bf309107ef96f57ae93592c1 (patch)
treecb9c7d286ece595404e5dde9ab381820017b40dc /chrome/service
parentf354e25b2905341d67166e20709a71163004de73 (diff)
downloadchromium_src-79fff8227ab720a8bf309107ef96f57ae93592c1.zip
chromium_src-79fff8227ab720a8bf309107ef96f57ae93592c1.tar.gz
chromium_src-79fff8227ab720a8bf309107ef96f57ae93592c1.tar.bz2
New implementation of font precache on Windows.
BUG=94421 TEST=none Review URL: http://codereview.chromium.org/7866019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101911 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
-rw-r--r--chrome/service/service_utility_process_host.cc12
-rw-r--r--chrome/service/service_utility_process_host.h3
2 files changed, 13 insertions, 2 deletions
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc
index 0c4e88c..760fc23 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.cc
@@ -20,6 +20,7 @@
#if defined(OS_WIN)
#include "base/memory/scoped_ptr.h"
#include "base/win/scoped_handle.h"
+#include "content/common/child_process_messages.h"
#include "printing/emf_win.h"
#endif
@@ -29,6 +30,7 @@ ServiceUtilityProcessHost::ServiceUtilityProcessHost(
client_(client),
client_message_loop_proxy_(client_message_loop_proxy),
waiting_for_reply_(false) {
+ process_id_ = ChildProcessInfo::GenerateChildProcessUniqueId();
}
ServiceUtilityProcessHost::~ServiceUtilityProcessHost() {
@@ -144,7 +146,9 @@ bool ServiceUtilityProcessHost::OnMessageReceived(const IPC::Message& message) {
bool msg_is_ok = false;
IPC_BEGIN_MESSAGE_MAP_EX(ServiceUtilityProcessHost, message, msg_is_ok)
#if defined(OS_WIN) // This hack is Windows-specific.
- IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_PreCacheFont, OnPreCacheFont)
+ IPC_MESSAGE_HANDLER(ChildProcessHostMsg_PreCacheFont, OnPreCacheFont)
+ IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ReleaseCachedFonts,
+ OnReleaseCachedFonts)
#endif
IPC_MESSAGE_HANDLER(
ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Succeeded,
@@ -166,7 +170,11 @@ bool ServiceUtilityProcessHost::MessageForClient(const IPC::Message& message) {
#if defined(OS_WIN) // This hack is Windows-specific.
void ServiceUtilityProcessHost::OnPreCacheFont(const LOGFONT& font) {
- PreCacheFont(font);
+ PreCacheFont(font, process_id_);
+}
+
+void ServiceUtilityProcessHost::OnReleaseCachedFonts() {
+ ReleaseCachedFonts(process_id_);
}
#endif // OS_WIN
diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h
index b3802f9..f24bd3a 100644
--- a/chrome/service/service_utility_process_host.h
+++ b/chrome/service/service_utility_process_host.h
@@ -131,6 +131,7 @@ class ServiceUtilityProcessHost : public ServiceChildProcessHost {
#if defined(OS_WIN) // This hack is Windows-specific.
void OnPreCacheFont(const LOGFONT& font);
+ void OnReleaseCachedFonts();
#endif // defined(OS_WIN)
// A pointer to our client interface, who will be informed of progress.
@@ -141,6 +142,8 @@ class ServiceUtilityProcessHost : public ServiceChildProcessHost {
FilePath metafile_path_;
// The temporary folder created for the metafile.
scoped_ptr<ScopedTempDir> scratch_metafile_dir_;
+ // The unique id created for the process.
+ int process_id_;
DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost);
};