summaryrefslogtreecommitdiffstats
path: root/chrome/service
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-01 18:48:41 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-01 18:48:41 +0000
commite35c9a8966206fcef0ce03923939563c571a0a28 (patch)
tree8b105f82d94adc6500214703a5ab28df9c4a8f61 /chrome/service
parenta333fcafa7032a61fd5c8b193e0d13218a46f4d5 (diff)
downloadchromium_src-e35c9a8966206fcef0ce03923939563c571a0a28.zip
chromium_src-e35c9a8966206fcef0ce03923939563c571a0a28.tar.gz
chromium_src-e35c9a8966206fcef0ce03923939563c571a0a28.tar.bz2
Dispatch the Windows font caching IPCs in one filter. This avoids having the code that calls those functions be duplicated and also makes the chrome service code not know about internal content IPCs. It also cleans up ChildProcessHost a bit, which will be useful when it gets an interface around it for the Content API.
BUG=98716 Review URL: http://codereview.chromium.org/8759013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112492 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
-rw-r--r--chrome/service/service_utility_process_host.cc28
-rw-r--r--chrome/service/service_utility_process_host.h11
2 files changed, 5 insertions, 34 deletions
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc
index 2b4fe26..8352526 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.cc
@@ -13,7 +13,6 @@
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_utility_messages.h"
-#include "content/common/child_process_info.h"
#include "ipc/ipc_switches.h"
#include "printing/page_range.h"
#include "ui/base/ui_base_switches.h"
@@ -22,7 +21,6 @@
#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
@@ -31,7 +29,6 @@ ServiceUtilityProcessHost::ServiceUtilityProcessHost(
: client_(client),
client_message_loop_proxy_(client_message_loop_proxy),
waiting_for_reply_(false) {
- process_id_ = ChildProcessInfo::GenerateChildProcessUniqueId();
}
ServiceUtilityProcessHost::~ServiceUtilityProcessHost() {
@@ -137,13 +134,8 @@ void ServiceUtilityProcessHost::OnChildDied() {
}
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(ChildProcessHostMsg_PreCacheFont, OnPreCacheFont)
- IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ReleaseCachedFonts,
- OnReleaseCachedFonts)
-#endif
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(ServiceUtilityProcessHost, message)
IPC_MESSAGE_HANDLER(
ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Succeeded,
OnRenderPDFPagesToMetafileSucceeded)
@@ -154,20 +146,10 @@ bool ServiceUtilityProcessHost::OnMessageReceived(const IPC::Message& message) {
OnGetPrinterCapsAndDefaultsSucceeded)
IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed,
OnGetPrinterCapsAndDefaultsFailed)
- IPC_MESSAGE_UNHANDLED(msg_is_ok__ = false)
- IPC_END_MESSAGE_MAP_EX()
- return true;
-}
-
-#if defined(OS_WIN) // This hack is Windows-specific.
-void ServiceUtilityProcessHost::OnPreCacheFont(const LOGFONT& font) {
- PreCacheFont(font, process_id_);
-}
-
-void ServiceUtilityProcessHost::OnReleaseCachedFonts() {
- ReleaseCachedFonts(process_id_);
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
}
-#endif // OS_WIN
void ServiceUtilityProcessHost::OnRenderPDFPagesToMetafileSucceeded(
int highest_rendered_page_number) {
diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h
index ee82ee1..49e2450 100644
--- a/chrome/service/service_utility_process_host.h
+++ b/chrome/service/service_utility_process_host.h
@@ -8,10 +8,6 @@
#include "build/build_config.h"
-#if defined(OS_WIN)
-#include <windows.h>
-#endif // defined(OS_WIN)
-
#include <string>
#include <vector>
@@ -131,11 +127,6 @@ class ServiceUtilityProcessHost : public ServiceChildProcessHost {
// retrieved successfully.
void OnGetPrinterCapsAndDefaultsFailed(const std::string& printer_name);
-#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.
scoped_refptr<Client> client_;
scoped_refptr<base::MessageLoopProxy> client_message_loop_proxy_;
@@ -144,8 +135,6 @@ 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);
};