From e3d6b757596c96fb8f59fd4d3ca24e2b282bafcb Mon Sep 17 00:00:00 2001 From: thestig Date: Tue, 7 Apr 2015 14:58:45 -0700 Subject: [PATCH] Give names to all utility processes. BUG=472340 Review URL: https://codereview.chromium.org/1062873003 Cr-Commit-Position: refs/heads/master@{#324130} --- chrome/app/generated_resources.grd | 65 ++++++++++++++++++++++ chrome/browser/android/seccomp_support_detector.cc | 4 ++ chrome/browser/chrome_browser_main_win.cc | 10 +++- .../chrome_select_file_dialog_factory_win.cc | 18 ++++-- .../chromeos/file_manager/zip_file_creator.cc | 4 ++ .../component_patcher_operation_out_of_process.cc | 4 ++ .../image_writer_utility_client.cc | 4 ++ .../networking_private_credentials_getter_win.cc | 6 +- .../browser/extensions/webstore_install_helper.cc | 4 ++ chrome/browser/extensions/zipfile_installer.cc | 4 ++ chrome/browser/image_decoder.cc | 4 ++ .../importer/external_process_importer_client.cc | 2 + .../local_discovery/pwg_raster_converter.cc | 4 ++ .../service_discovery_host_client.cc | 10 ++-- .../local_discovery/wifi/credential_getter_win.cc | 4 ++ .../fileapi/safe_audio_video_checker.cc | 4 ++ .../fileapi/safe_iapps_library_parser.cc | 4 ++ .../fileapi/safe_itunes_pref_parser_win.cc | 4 ++ .../fileapi/safe_media_metadata_parser.cc | 4 ++ .../fileapi/safe_picasa_album_table_reader.cc | 4 ++ .../fileapi/safe_picasa_albums_indexer.cc | 4 ++ chrome/browser/platform_util_win.cc | 6 +- chrome/browser/printing/pdf_to_emf_converter.cc | 26 +++++---- .../safe_browsing/sandboxed_zip_analyzer.cc | 4 ++ chrome/browser/safe_json_parser.cc | 4 ++ extensions/browser/sandboxed_unpacker.cc | 2 + extensions/browser/updater/safe_manifest_parser.cc | 4 ++ extensions/extensions_strings.grd | 8 +++ 28 files changed, 198 insertions(+), 27 deletions(-) diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index bff006fa4abf..96e9f63ab10a 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -3941,9 +3941,74 @@ Even if you have downloaded files from this website before, the website might ha + + Component Patcher + + + Image Decoder + + + JSON Parser + V8 Proxy Resolver + + + Zip File Creator + + + + + Seccomp Detector + + + + + Profile Importer + + + Safe Browsing Zip File Analyzer + + + + + EMF Convertor + + + File Open/Save Dialog + + + DirectWrite Font Cache Builder + + + WiFi Credentials Getter + + + + + ChromeOS System Image Writer + + + Media File Checker + + + Media Library File Checker + + + Zip File Installer + + + + + PWG Raster Convertor + + + + + Service Discovery Handler + + diff --git a/chrome/browser/android/seccomp_support_detector.cc b/chrome/browser/android/seccomp_support_detector.cc index 4488aee11afb..632cde228403 100644 --- a/chrome/browser/android/seccomp_support_detector.cc +++ b/chrome/browser/android/seccomp_support_detector.cc @@ -11,8 +11,10 @@ #include "base/metrics/histogram_macros.h" #include "base/metrics/sparse_histogram.h" #include "chrome/common/chrome_utility_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; @@ -73,6 +75,8 @@ void SeccompSupportDetector::DetectSeccomp() { content::UtilityProcessHost* utility_process_host = content::UtilityProcessHost::Create( this, base::MessageLoopProxy::current()); + utility_process_host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_SECCOMP_DETECTOR_NAME)); utility_process_host->Send(new ChromeUtilityMsg_DetectSeccompSupport()); } diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index ce9f4a20ace6..101e5dc5e1c9 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -108,12 +108,14 @@ int GetMinimumFontSize() { class TranslationDelegate : public installer::TranslationDelegate { public: - virtual base::string16 GetLocalizedString(int installer_string_id) override; + base::string16 GetLocalizedString(int installer_string_id) override; }; void ExecuteFontCacheBuildTask(const base::FilePath& path) { base::WeakPtr utility_process_host( content::UtilityProcessHost::Create(NULL, NULL)->AsWeakPtr()); + utility_process_host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_FONT_CACHE_BUILDER_NAME)); utility_process_host->DisableSandbox(); utility_process_host->Send( new ChromeUtilityHostMsg_BuildDirectWriteFontCache(path)); @@ -361,7 +363,8 @@ void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( // The encoding we use for the info is "title|context|direction" where // direction is either env_vars::kRtlLocale or env_vars::kLtrLocale depending // on the current locale. - base::string16 dlg_strings(l10n_util::GetStringUTF16(IDS_CRASH_RECOVERY_TITLE)); + base::string16 dlg_strings( + l10n_util::GetStringUTF16(IDS_CRASH_RECOVERY_TITLE)); dlg_strings.push_back('|'); base::string16 adjusted_string( l10n_util::GetStringUTF16(IDS_CRASH_RECOVERY_CONTENT)); @@ -458,7 +461,8 @@ bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { // system-level Chrome instead. const base::string16 text = l10n_util::GetStringUTF16(IDS_MACHINE_LEVEL_INSTALL_CONFLICT); - const base::string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); + const base::string16 caption = + l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; ui::MessageBox(NULL, text, caption, flags); } diff --git a/chrome/browser/chrome_select_file_dialog_factory_win.cc b/chrome/browser/chrome_select_file_dialog_factory_win.cc index 08f2024c1585..40d3baa4b605 100644 --- a/chrome/browser/chrome_select_file_dialog_factory_win.cc +++ b/chrome/browser/chrome_select_file_dialog_factory_win.cc @@ -17,9 +17,11 @@ #include "base/synchronization/waitable_event.h" #include "base/win/metro.h" #include "chrome/common/chrome_utility_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/utility_process_host.h" #include "content/public/browser/utility_process_host_client.h" #include "ipc/ipc_message_macros.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/win/open_file_name_win.h" #include "ui/shell_dialogs/select_file_dialog_win.h" @@ -65,9 +67,9 @@ class GetOpenFileNameClient : public content::UtilityProcessHostClient { const std::vector& filenames() const { return filenames_; } // UtilityProcessHostClient implementation - virtual void OnProcessCrashed(int exit_code) override; - virtual void OnProcessLaunchFailed() override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnProcessCrashed(int exit_code) override; + void OnProcessLaunchFailed() override; + bool OnMessageReceived(const IPC::Message& message) override; protected: virtual ~GetOpenFileNameClient(); @@ -137,6 +139,8 @@ void DoInvokeGetOpenFileName( base::WeakPtr utility_process_host( content::UtilityProcessHost::Create(client, current_task_runner) ->AsWeakPtr()); + utility_process_host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_FILE_DIALOG_NAME)); utility_process_host->DisableSandbox(); utility_process_host->Send(new ChromeUtilityMsg_GetOpenFileName( ofn->hwndOwner, @@ -196,9 +200,9 @@ class GetSaveFileNameClient : public content::UtilityProcessHostClient { int one_based_filter_index() const { return one_based_filter_index_; } // UtilityProcessHostClient implementation - virtual void OnProcessCrashed(int exit_code) override; - virtual void OnProcessLaunchFailed() override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnProcessCrashed(int exit_code) override; + void OnProcessLaunchFailed() override; + bool OnMessageReceived(const IPC::Message& message) override; protected: virtual ~GetSaveFileNameClient(); @@ -267,6 +271,8 @@ void DoInvokeGetSaveFileName( base::WeakPtr utility_process_host( content::UtilityProcessHost::Create(client, current_task_runner) ->AsWeakPtr()); + utility_process_host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_FILE_DIALOG_NAME)); utility_process_host->DisableSandbox(); ChromeUtilityMsg_GetSaveFileName_Params params; params.owner = ofn->hwndOwner; diff --git a/chrome/browser/chromeos/file_manager/zip_file_creator.cc b/chrome/browser/chromeos/file_manager/zip_file_creator.cc index f6e0788eb25f..6af8346c21b4 100644 --- a/chrome/browser/chromeos/file_manager/zip_file_creator.cc +++ b/chrome/browser/chromeos/file_manager/zip_file_creator.cc @@ -9,8 +9,10 @@ #include "base/message_loop/message_loop.h" #include "base/threading/sequenced_worker_pool.h" #include "chrome/common/chrome_utility_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; using content::UtilityProcessHost; @@ -91,6 +93,8 @@ void ZipFileCreator::StartProcessOnIOThread(base::File dest_file) { UtilityProcessHost* host = UtilityProcessHost::Create( this, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get()); + host->SetName( + l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_ZIP_FILE_CREATOR_NAME)); host->SetExposedDir(src_dir_); host->Send(new ChromeUtilityMsg_CreateZipFile(src_dir_, src_relative_paths_, dest_fd)); diff --git a/chrome/browser/component_updater/component_patcher_operation_out_of_process.cc b/chrome/browser/component_updater/component_patcher_operation_out_of_process.cc index 4242a4853c0e..1e35da4971d4 100644 --- a/chrome/browser/component_updater/component_patcher_operation_out_of_process.cc +++ b/chrome/browser/component_updater/component_patcher_operation_out_of_process.cc @@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "chrome/common/chrome_utility_messages.h" +#include "chrome/grit/generated_resources.h" #include "components/component_updater/component_updater_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" @@ -17,6 +18,7 @@ #include "courgette/courgette.h" #include "courgette/third_party/bsdiff.h" #include "ipc/ipc_message_macros.h" +#include "ui/base/l10n/l10n_util.h" namespace component_updater { @@ -54,6 +56,8 @@ void PatchHost::StartProcess(scoped_ptr message) { // UtilityProcessHost object. content::UtilityProcessHost* host = content::UtilityProcessHost::Create( this, base::MessageLoopProxy::current().get()); + host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_COMPONENT_PATCHER_NAME)); host->DisableSandbox(); host->Send(message.release()); } diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.cc index 37d80908c78c..9c77870764b6 100644 --- a/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.cc +++ b/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.cc @@ -7,7 +7,9 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; @@ -90,6 +92,8 @@ void ImageWriterUtilityClient::StartHost() { base::MessageLoop::current()->message_loop_proxy(); utility_process_host_ = content::UtilityProcessHost::Create( this, task_runner.get())->AsWeakPtr(); + utility_process_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_IMAGE_WRITER_NAME)); #if defined(OS_WIN) utility_process_host_->ElevatePrivileges(); diff --git a/chrome/browser/extensions/api/networking_private/networking_private_credentials_getter_win.cc b/chrome/browser/extensions/api/networking_private/networking_private_credentials_getter_win.cc index 0da377d61f8a..99389c29ebe7 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_credentials_getter_win.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_credentials_getter_win.cc @@ -10,9 +10,11 @@ #include "base/threading/sequenced_worker_pool.h" #include "chrome/common/extensions/api/networking_private/networking_private_crypto.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" #include "content/public/browser/utility_process_host_client.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; using content::UtilityProcessHost; @@ -98,9 +100,11 @@ void CredentialsGetterHostClient::StartProcessOnIOThread( const std::string& network_guid, const NetworkingPrivateCredentialsGetter::CredentialsCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); + callback_ = callback; UtilityProcessHost* host = UtilityProcessHost::Create(this, base::MessageLoopProxy::current()); - callback_ = callback; + host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_WIFI_CREDENTIALS_GETTER_NAME)); host->ElevatePrivileges(); host->Send(new ChromeUtilityHostMsg_GetWiFiCredentials(network_guid)); } diff --git a/chrome/browser/extensions/webstore_install_helper.cc b/chrome/browser/extensions/webstore_install_helper.cc index c1413f0cc2a8..2f406fa28e4e 100644 --- a/chrome/browser/extensions/webstore_install_helper.cc +++ b/chrome/browser/extensions/webstore_install_helper.cc @@ -11,10 +11,12 @@ #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" #include "chrome/common/chrome_utility_messages.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" #include "net/base/load_flags.h" #include "net/url_request/url_request.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; using content::UtilityProcessHost; @@ -68,6 +70,8 @@ void WebstoreInstallHelper::StartWorkOnIOThread() { CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); utility_host_ = UtilityProcessHost::Create( this, base::MessageLoopProxy::current().get())->AsWeakPtr(); + utility_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_JSON_PARSER_NAME)); utility_host_->StartBatchMode(); utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); diff --git a/chrome/browser/extensions/zipfile_installer.cc b/chrome/browser/extensions/zipfile_installer.cc index f78fb4a6850e..6f64b606f53a 100644 --- a/chrome/browser/extensions/zipfile_installer.cc +++ b/chrome/browser/extensions/zipfile_installer.cc @@ -11,8 +11,10 @@ #include "chrome/browser/extensions/unpacked_installer.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; using content::UtilityProcessHost; @@ -73,6 +75,8 @@ void ZipFileInstaller::StartWorkOnIOThread(const base::FilePath& temp_dir) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); UtilityProcessHost* host = UtilityProcessHost::Create(this, base::MessageLoopProxy::current().get()); + host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_ZIP_FILE_INSTALLER_NAME)); host->SetExposedDir(temp_dir); host->Send(new ChromeUtilityMsg_UnzipToDir(zip_path_, temp_dir)); } diff --git a/chrome/browser/image_decoder.cc b/chrome/browser/image_decoder.cc index 9e21662088f5..b0b9ce88010d 100644 --- a/chrome/browser/image_decoder.cc +++ b/chrome/browser/image_decoder.cc @@ -7,8 +7,10 @@ #include "base/bind.h" #include "chrome/browser/browser_process.h" #include "chrome/common/chrome_utility_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; using content::UtilityProcessHost; @@ -127,6 +129,8 @@ void ImageDecoder::StartBatchMode() { utility_process_host_ = UtilityProcessHost::Create(this, base::MessageLoopProxy::current().get()) ->AsWeakPtr(); + utility_process_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_IMAGE_DECODER_NAME)); if (!utility_process_host_->StartBatchMode()) { utility_process_host_.reset(); return; diff --git a/chrome/browser/importer/external_process_importer_client.cc b/chrome/browser/importer/external_process_importer_client.cc index 384f78e9d33d..a44c18e4763b 100644 --- a/chrome/browser/importer/external_process_importer_client.cc +++ b/chrome/browser/importer/external_process_importer_client.cc @@ -312,6 +312,8 @@ void ExternalProcessImporterClient::StartProcessOnIOThread( utility_process_host_ = UtilityProcessHost::Create( this, BrowserThread::GetMessageLoopProxyForThread(thread_id).get()) ->AsWeakPtr(); + utility_process_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_PROFILE_IMPORTER_NAME)); utility_process_host_->DisableSandbox(); #if defined(OS_MACOSX) diff --git a/chrome/browser/local_discovery/pwg_raster_converter.cc b/chrome/browser/local_discovery/pwg_raster_converter.cc index 11b6c317ca32..ae11a6c88c72 100644 --- a/chrome/browser/local_discovery/pwg_raster_converter.cc +++ b/chrome/browser/local_discovery/pwg_raster_converter.cc @@ -14,6 +14,7 @@ #include "base/logging.h" #include "chrome/common/chrome_utility_messages.h" #include "chrome/common/chrome_utility_printing_messages.h" +#include "chrome/grit/generated_resources.h" #include "components/cloud_devices/common/cloud_device_description.h" #include "components/cloud_devices/common/printer_description.h" #include "content/public/browser/browser_thread.h" @@ -23,6 +24,7 @@ #include "printing/pdf_render_settings.h" #include "printing/pwg_raster_settings.h" #include "printing/units.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" @@ -226,6 +228,8 @@ void PwgUtilityProcessHostClient::StartProcessOnIOThread() { content::UtilityProcessHost::Create( this, base::MessageLoop::current()->message_loop_proxy())->AsWeakPtr(); + utility_process_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_PWG_RASTER_CONVERTOR_NAME)); utility_process_host_->Send(new ChromeUtilityMsg_StartupPing); } diff --git a/chrome/browser/local_discovery/service_discovery_host_client.cc b/chrome/browser/local_discovery/service_discovery_host_client.cc index ebdbe62609e1..f201ffbdc876 100644 --- a/chrome/browser/local_discovery/service_discovery_host_client.cc +++ b/chrome/browser/local_discovery/service_discovery_host_client.cc @@ -5,10 +5,12 @@ #include "chrome/browser/local_discovery/service_discovery_host_client.h" #include "chrome/common/local_discovery/local_discovery_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" #include "net/dns/mdns_client.h" #include "net/socket/socket_descriptor.h" +#include "ui/base/l10n/l10n_util.h" #if defined(OS_POSIX) #include @@ -282,8 +284,8 @@ void ServiceDiscoveryHostClient::OnSocketsReady(const SocketInfoList& sockets) { DCHECK(!utility_host_); utility_host_ = UtilityProcessHost::Create( this, base::MessageLoopProxy::current().get())->AsWeakPtr(); - if (!utility_host_) - return; + utility_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_SERVICE_DISCOVERY_HANDLER_NAME)); utility_host_->EnableMDns(); utility_host_->StartBatchMode(); if (sockets.empty()) { @@ -304,8 +306,8 @@ void ServiceDiscoveryHostClient::StartOnIOThread() { DCHECK(!utility_host_); utility_host_ = UtilityProcessHost::Create( this, base::MessageLoopProxy::current().get())->AsWeakPtr(); - if (!utility_host_) - return; + utility_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_SERVICE_DISCOVERY_HANDLER_NAME)); utility_host_->EnableMDns(); utility_host_->StartBatchMode(); // Windows does not enumerate networks here. diff --git a/chrome/browser/local_discovery/wifi/credential_getter_win.cc b/chrome/browser/local_discovery/wifi/credential_getter_win.cc index fdd0052ec6b6..5ad439bdc292 100644 --- a/chrome/browser/local_discovery/wifi/credential_getter_win.cc +++ b/chrome/browser/local_discovery/wifi/credential_getter_win.cc @@ -5,8 +5,10 @@ #include "chrome/browser/local_discovery/wifi/credential_getter_win.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" +#include "ui/base/l10n/l10n_util.h" namespace local_discovery { @@ -33,6 +35,8 @@ void CredentialGetterWin::StartOnIOThread(const std::string& network_guid) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); content::UtilityProcessHost* host = content::UtilityProcessHost::Create( this, base::MessageLoopProxy::current()); + host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_WIFI_CREDENTIALS_GETTER_NAME)); host->ElevatePrivileges(); host->Send(new ChromeUtilityHostMsg_GetWiFiCredentials(network_guid)); } diff --git a/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc b/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc index 9d8ebdea9cdc..f4f67a8bd97b 100644 --- a/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc +++ b/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc @@ -11,11 +11,13 @@ #include "base/process/process_handle.h" #include "chrome/common/chrome_utility_messages.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/child_process_data.h" #include "content/public/browser/utility_process_host.h" #include "content/public/browser/browser_thread.h" #include "ipc/ipc_message_macros.h" #include "ipc/ipc_platform_file.h" +#include "ui/base/l10n/l10n_util.h" SafeAudioVideoChecker::SafeAudioVideoChecker( base::File file, @@ -38,6 +40,8 @@ void SafeAudioVideoChecker::Start() { utility_process_host_ = content::UtilityProcessHost::Create( this, base::MessageLoopProxy::current())->AsWeakPtr(); + utility_process_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_MEDIA_FILE_CHECKER_NAME)); utility_process_host_->Send(new ChromeUtilityMsg_StartupPing); } diff --git a/chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc b/chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc index e6dcffa4ff26..f9dafa91cfb5 100644 --- a/chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc +++ b/chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc @@ -7,9 +7,11 @@ #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" #include "chrome/common/chrome_utility_messages.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_data.h" #include "ipc/ipc_platform_file.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; using content::UtilityProcessHost; @@ -66,6 +68,8 @@ void SafeIAppsLibraryParser::StartProcessOnIOThread() { BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); utility_process_host_ = UtilityProcessHost::Create(this, message_loop_proxy.get())->AsWeakPtr(); + utility_process_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_MEDIA_LIBRARY_FILE_CHECKER_NAME)); // Wait for the startup notification before sending the main IPC to the // utility process, so that we can dup the file handle. utility_process_host_->Send(new ChromeUtilityMsg_StartupPing); diff --git a/chrome/browser/media_galleries/fileapi/safe_itunes_pref_parser_win.cc b/chrome/browser/media_galleries/fileapi/safe_itunes_pref_parser_win.cc index 7d7282eb9c55..71965bc0a084 100644 --- a/chrome/browser/media_galleries/fileapi/safe_itunes_pref_parser_win.cc +++ b/chrome/browser/media_galleries/fileapi/safe_itunes_pref_parser_win.cc @@ -5,8 +5,10 @@ #include "chrome/browser/media_galleries/fileapi/safe_itunes_pref_parser_win.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; using content::UtilityProcessHost; @@ -40,6 +42,8 @@ void SafeITunesPrefParserWin::StartWorkOnIOThread() { UtilityProcessHost* host = UtilityProcessHost::Create(this, base::MessageLoopProxy::current()); + host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_MEDIA_LIBRARY_FILE_CHECKER_NAME)); host->Send(new ChromeUtilityMsg_ParseITunesPrefXml(unsafe_xml_)); parser_state_ = STARTED_PARSING_STATE; } diff --git a/chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.cc b/chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.cc index 96eb7f99a709..3de0b8a69077 100644 --- a/chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.cc +++ b/chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.cc @@ -6,9 +6,11 @@ #include "chrome/browser/extensions/blob_reader.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_data.h" #include "content/public/browser/utility_process_host.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; @@ -49,6 +51,8 @@ void SafeMediaMetadataParser::StartWorkOnIOThread( utility_process_host_ = content::UtilityProcessHost::Create( this, base::MessageLoopProxy::current())->AsWeakPtr(); + utility_process_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_MEDIA_FILE_CHECKER_NAME)); utility_process_host_->Send( new ChromeUtilityMsg_ParseMediaMetadata(mime_type_, blob_size_, diff --git a/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc b/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc index b315fbcfa39b..e5aaadc939a4 100644 --- a/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc +++ b/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc @@ -9,8 +9,10 @@ #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" #include "chrome/common/chrome_utility_messages.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_data.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; @@ -65,6 +67,8 @@ void SafePicasaAlbumTableReader::StartWorkOnIOThread() { this, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get()) ->AsWeakPtr(); + utility_process_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_MEDIA_LIBRARY_FILE_CHECKER_NAME)); // Wait for the startup notification before sending the main IPC to the // utility process, so that we can dup the file handle. utility_process_host_->Send(new ChromeUtilityMsg_StartupPing); diff --git a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc index 3e5e9aa9b960..6373cb4326b2 100644 --- a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc +++ b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc @@ -7,9 +7,11 @@ #include "base/files/file_util.h" #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" #include "chrome/common/extensions/chrome_utility_extensions_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_data.h" #include "content/public/browser/utility_process_host.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; using content::UtilityProcessHost; @@ -96,6 +98,8 @@ void SafePicasaAlbumsIndexer::StartWorkOnIOThread() { UtilityProcessHost* host = UtilityProcessHost::Create(this, base::MessageLoopProxy::current()); + host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_MEDIA_LIBRARY_FILE_CHECKER_NAME)); host->Send(new ChromeUtilityMsg_IndexPicasaAlbumsContents(album_uids_, folders_inis_)); parser_state_ = STARTED_PARSING_STATE; diff --git a/chrome/browser/platform_util_win.cc b/chrome/browser/platform_util_win.cc index a905b2f42d1f..b26746c94c46 100644 --- a/chrome/browser/platform_util_win.cc +++ b/chrome/browser/platform_util_win.cc @@ -25,9 +25,11 @@ #include "chrome/browser/platform_util_internal.h" #include "chrome/browser/ui/host_desktop.h" #include "chrome/common/chrome_utility_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" #include "content/public/browser/utility_process_host_client.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/win/shell.h" #include "ui/gfx/native_widget_types.h" #include "url/gurl.h" @@ -54,7 +56,7 @@ void ShowItemInFolderOnFileThread(const base::FilePath& full_path) { DWORD flags); static SHOpenFolderAndSelectItemsFuncPtr open_folder_and_select_itemsPtr = - NULL; + nullptr; static bool initialize_open_folder_proc = true; if (initialize_open_folder_proc) { initialize_open_folder_proc = false; @@ -168,6 +170,8 @@ void OpenItemViaShellInUtilityProcess(const base::FilePath& full_path, OpenItemType type) { base::WeakPtr utility_process_host( content::UtilityProcessHost::Create(NULL, NULL)->AsWeakPtr()); + utility_process_host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_FILE_DIALOG_NAME)); utility_process_host->DisableSandbox(); switch (type) { case OPEN_FILE: diff --git a/chrome/browser/printing/pdf_to_emf_converter.cc b/chrome/browser/printing/pdf_to_emf_converter.cc index 48a384573055..0e22ccab2c03 100644 --- a/chrome/browser/printing/pdf_to_emf_converter.cc +++ b/chrome/browser/printing/pdf_to_emf_converter.cc @@ -12,12 +12,14 @@ #include "base/logging.h" #include "chrome/common/chrome_utility_messages.h" #include "chrome/common/chrome_utility_printing_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_data.h" #include "content/public/browser/utility_process_host.h" #include "content/public/browser/utility_process_host_client.h" #include "printing/emf_win.h" #include "printing/pdf_render_settings.h" +#include "ui/base/l10n/l10n_util.h" namespace printing { @@ -61,8 +63,8 @@ class LazyEmf : public MetafilePlayer { : temp_dir_(temp_dir), file_(file.Pass()) {} virtual ~LazyEmf() { Close(); } - virtual bool SafePlayback(HDC hdc) const override; - virtual bool SaveTo(base::File* file) const override; + bool SafePlayback(HDC hdc) const override; + bool SaveTo(base::File* file) const override; private: void Close() const; @@ -103,9 +105,9 @@ class PdfToEmfUtilityProcessHostClient void Stop(); // UtilityProcessHostClient implementation. - virtual void OnProcessCrashed(int exit_code) override; - virtual void OnProcessLaunchFailed() override; - virtual bool OnMessageReceived(const IPC::Message& message) override; + void OnProcessCrashed(int exit_code) override; + void OnProcessLaunchFailed() override; + bool OnMessageReceived(const IPC::Message& message) override; private: class GetPageCallbackData { @@ -181,12 +183,12 @@ class PdfToEmfConverterImpl : public PdfToEmfConverter { virtual ~PdfToEmfConverterImpl(); - virtual void Start(const scoped_refptr& data, - const PdfRenderSettings& conversion_settings, - const StartCallback& start_callback) override; + void Start(const scoped_refptr& data, + const PdfRenderSettings& conversion_settings, + const StartCallback& start_callback) override; - virtual void GetPage(int page_number, - const GetPageCallback& get_page_callback) override; + void GetPage(int page_number, + const GetPageCallback& get_page_callback) override; // Helps to cancel callbacks if this object is destroyed. void RunCallback(const base::Closure& callback); @@ -298,8 +300,8 @@ void PdfToEmfUtilityProcessHostClient::Start( content::UtilityProcessHost::Create( this, base::MessageLoop::current()->message_loop_proxy()) ->AsWeakPtr(); - if (!utility_process_host_) - return OnFailed(); + utility_process_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_EMF_CONVERTOR_NAME)); // Should reply with OnProcessStarted(). Send(new ChromeUtilityMsg_StartupPing); } diff --git a/chrome/browser/safe_browsing/sandboxed_zip_analyzer.cc b/chrome/browser/safe_browsing/sandboxed_zip_analyzer.cc index 92b5716197a0..f23a72416611 100644 --- a/chrome/browser/safe_browsing/sandboxed_zip_analyzer.cc +++ b/chrome/browser/safe_browsing/sandboxed_zip_analyzer.cc @@ -12,12 +12,14 @@ #include "base/threading/sequenced_worker_pool.h" #include "chrome/common/chrome_utility_messages.h" #include "chrome/common/safe_browsing/zip_analyzer_results.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_data.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/content_switches.h" #include "ipc/ipc_message_macros.h" #include "ipc/ipc_platform_file.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; @@ -115,6 +117,8 @@ void SandboxedZipAnalyzer::StartProcessOnIOThread() { this, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get()) ->AsWeakPtr(); + utility_process_host_->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_SAFE_BROWSING_ZIP_FILE_ANALYZER_NAME)); utility_process_host_->Send(new ChromeUtilityMsg_StartupPing); // Wait for the startup notification before sending the main IPC to the // utility process, so that we can dup the file handle. diff --git a/chrome/browser/safe_json_parser.cc b/chrome/browser/safe_json_parser.cc index f8334ce7397e..232fdd43daed 100644 --- a/chrome/browser/safe_json_parser.cc +++ b/chrome/browser/safe_json_parser.cc @@ -5,8 +5,10 @@ #include "chrome/browser/safe_json_parser.h" #include "chrome/common/chrome_utility_messages.h" +#include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; using content::UtilityProcessHost; @@ -32,6 +34,8 @@ void SafeJsonParser::StartWorkOnIOThread() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); UtilityProcessHost* host = UtilityProcessHost::Create(this, base::MessageLoopProxy::current().get()); + host->SetName(l10n_util::GetStringUTF16( + IDS_UTILITY_PROCESS_JSON_PARSER_NAME)); host->Send(new ChromeUtilityMsg_ParseJSON(unsafe_json_)); } diff --git a/extensions/browser/sandboxed_unpacker.cc b/extensions/browser/sandboxed_unpacker.cc index 518cde7c0808..e22109a79bb6 100644 --- a/extensions/browser/sandboxed_unpacker.cc +++ b/extensions/browser/sandboxed_unpacker.cc @@ -348,6 +348,8 @@ void SandboxedUnpacker::StartProcessOnIOThread( const base::FilePath& temp_crx_path) { UtilityProcessHost* host = UtilityProcessHost::Create(this, unpacker_io_task_runner_.get()); + host->SetName( + l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_EXTENSION_UNPACKER_NAME)); // Grant the subprocess access to the entire subdir the extension file is // in, so that it can unpack to that dir. host->SetExposedDir(temp_crx_path.DirName()); diff --git a/extensions/browser/updater/safe_manifest_parser.cc b/extensions/browser/updater/safe_manifest_parser.cc index f40fc138d43e..05c75a955967 100644 --- a/extensions/browser/updater/safe_manifest_parser.cc +++ b/extensions/browser/updater/safe_manifest_parser.cc @@ -13,6 +13,8 @@ #include "content/public/common/content_switches.h" #include "extensions/common/extension_utility_messages.h" #include "ipc/ipc_message_macros.h" +#include "grit/extensions_strings.h" +#include "ui/base/l10n/l10n_util.h" using content::BrowserThread; @@ -45,6 +47,8 @@ void SafeManifestParser::ParseInSandbox() { content::UtilityProcessHost* host = content::UtilityProcessHost::Create( this, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get()); + host->SetName( + l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_MANIFEST_PARSER_NAME)); host->Send(new ExtensionUtilityMsg_ParseUpdateManifest(xml_)); } diff --git a/extensions/extensions_strings.grd b/extensions/extensions_strings.grd index 0bcf8d9e72a7..4dce69946ee7 100644 --- a/extensions/extensions_strings.grd +++ b/extensions/extensions_strings.grd @@ -472,6 +472,14 @@ Can not unpack extension. To safely unpack an extension, there must be a path to your profile directory that does not contain a symlink. No such path exists for your profile. + + + + Extension Unpacker + + + Extension Manifest Parser + -- 2.11.4.GIT