diff options
25 files changed, 96 insertions, 96 deletions
diff --git a/chrome/browser/mach_broker_mac.cc b/chrome/browser/mach_broker_mac.cc index e311895..f7707c7 100644 --- a/chrome/browser/mach_broker_mac.cc +++ b/chrome/browser/mach_broker_mac.cc @@ -11,10 +11,10 @@ #include "base/sys_string_conversions.h" #include "base/threading/platform_thread.h" #include "chrome/browser/extensions/extension_host.h" -#include "chrome/common/child_process_info.h" #include "chrome/common/chrome_switches.h" #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/render_process_host.h" +#include "content/common/child_process_info.h" #include "content/common/notification_service.h" namespace { diff --git a/chrome/browser/memory_details.h b/chrome/browser/memory_details.h index 9333b56..81d5796 100644 --- a/chrome/browser/memory_details.h +++ b/chrome/browser/memory_details.h @@ -11,7 +11,7 @@ #include "base/process_util.h" #include "base/ref_counted.h" #include "base/string16.h" -#include "chrome/common/child_process_info.h" +#include "content/common/child_process_info.h" // We collect data about each browser process. A browser may // have multiple processes (of course!). Even IE has multiple diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index b3d24f3..a09ebf2 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -174,13 +174,13 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url_model.h" -#include "chrome/common/child_process_info.h" #include "chrome/common/child_process_logging.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/guid.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #include "content/browser/renderer_host/render_process_host.h" +#include "content/common/child_process_info.h" #include "content/common/notification_service.h" #include "libxml/xmlwriter.h" #include "webkit/plugins/npapi/plugin_list.h" diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 31679d0..c58eef8 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -49,7 +49,6 @@ #include "chrome/browser/visitedlink/visitedlink_master.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/child_process_info.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_icon_set.h" #include "chrome/common/gpu_messages.h" @@ -90,6 +89,7 @@ #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" #include "content/browser/speech/speech_input_dispatcher_host.h" #include "content/browser/worker_host/worker_message_filter.h" +#include "content/common/child_process_info.h" #include "content/common/child_process_messages.h" #include "content/common/notification_service.h" #include "content/common/resource_messages.h" diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc index 07ef872..bc9f344 100644 --- a/chrome/browser/service/service_process_control.cc +++ b/chrome/browser/service/service_process_control.cc @@ -13,11 +13,11 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/io_thread.h" #include "chrome/browser/upgrade_detector.h" -#include "chrome/common/child_process_host.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/service_messages.h" #include "chrome/common/service_process_util.h" #include "content/browser/browser_thread.h" +#include "content/common/child_process_host.h" #include "content/common/notification_service.h" #include "ui/base/ui_base_switches.h" diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc index 1917d00..e2e5d14 100644 --- a/chrome/browser/task_manager/task_manager_resource_providers.cc +++ b/chrome/browser/task_manager/task_manager_resource_providers.cc @@ -642,7 +642,7 @@ TaskManagerChildProcessResource::~TaskManagerChildProcessResource() { // TaskManagerResource methods: string16 TaskManagerChildProcessResource::GetTitle() const { if (title_.empty()) - title_ = child_process_.GetLocalizedTitle(); + title_ = GetLocalizedTitle(); return title_; } @@ -693,6 +693,60 @@ void TaskManagerChildProcessResource::SetSupportNetworkUsage() { network_usage_support_ = true; } +string16 TaskManagerChildProcessResource::GetLocalizedTitle() const { + string16 title = WideToUTF16Hack(child_process_.name()); + if (child_process_.type() == ChildProcessInfo::PLUGIN_PROCESS && + title.empty()) { + title = l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UNKNOWN_PLUGIN_NAME); + } + + // Explicitly mark name as LTR if there is no strong RTL character, + // to avoid the wrong concatenation result similar to "!Yahoo! Mail: the + // best web-based Email: NIGULP", in which "NIGULP" stands for the Hebrew + // or Arabic word for "plugin". + base::i18n::AdjustStringForLocaleDirection(&title); + + switch (child_process_.type()) { + case ChildProcessInfo::UTILITY_PROCESS: + return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX); + + case ChildProcessInfo::PROFILE_IMPORT_PROCESS: + return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX); + + case ChildProcessInfo::GPU_PROCESS: + return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_GPU_PREFIX); + + case ChildProcessInfo::NACL_BROKER_PROCESS: + return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NACL_BROKER_PREFIX); + + case ChildProcessInfo::PLUGIN_PROCESS: + case ChildProcessInfo::PPAPI_PLUGIN_PROCESS: { + return l10n_util::GetStringFUTF16( + IDS_TASK_MANAGER_PLUGIN_PREFIX, title, + WideToUTF16Hack(child_process_.version())); + } + + case ChildProcessInfo::NACL_LOADER_PROCESS: + return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_NACL_PREFIX, title); + + case ChildProcessInfo::WORKER_PROCESS: + return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_WORKER_PREFIX, title); + + // These types don't need display names or get them from elsewhere. + case ChildProcessInfo::BROWSER_PROCESS: + case ChildProcessInfo::RENDER_PROCESS: + case ChildProcessInfo::ZYGOTE_PROCESS: + case ChildProcessInfo::SANDBOX_HELPER_PROCESS: + NOTREACHED(); + break; + + case ChildProcessInfo::UNKNOWN_PROCESS: + NOTREACHED() << "Need localized name for child process type."; + } + + return title; +} + //////////////////////////////////////////////////////////////////////////////// // TaskManagerChildProcessResourceProvider class //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/task_manager/task_manager_resource_providers.h b/chrome/browser/task_manager/task_manager_resource_providers.h index c1ce1eb..2f2972e 100644 --- a/chrome/browser/task_manager/task_manager_resource_providers.h +++ b/chrome/browser/task_manager/task_manager_resource_providers.h @@ -13,9 +13,9 @@ #include "base/compiler_specific.h" #include "base/process_util.h" #include "chrome/browser/task_manager/task_manager.h" -#include "chrome/common/child_process_info.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "content/common/child_process_info.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" class BackgroundContents; @@ -224,6 +224,10 @@ class TaskManagerChildProcessResource : public TaskManager::Resource { int process_id() const { return pid_; } private: + // Returns a localized title for the child process. For example, a plugin + // process would be "Plug-in: Flash" when name is "Flash". + string16 GetLocalizedTitle() const; + ChildProcessInfo child_process_; int pid_; mutable string16 title_; diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index f1a6c1c..fa8295b 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -31,8 +31,6 @@ 'common/auto_start_linux.h', 'common/autofill_messages.h', 'common/bindings_policy.h', - 'common/child_process_info.cc', - 'common/child_process_info.h', 'common/child_process_logging.h', 'common/child_process_logging_linux.cc', 'common/child_process_logging_mac.mm', @@ -219,8 +217,6 @@ 'common/automation_messages_internal.h', 'common/badge_util.cc', 'common/badge_util.h', - 'common/child_process_host.cc', - 'common/child_process_host.h', 'common/chrome_descriptors.h', 'common/chrome_plugin_api.h', 'common/chrome_plugin_lib.cc', diff --git a/chrome/common/debug_flags.h b/chrome/common/debug_flags.h index 9671e47..2f68aee 100644 --- a/chrome/common/debug_flags.h +++ b/chrome/common/debug_flags.h @@ -6,7 +6,7 @@ #define CHROME_COMMON_DEBUG_FLAGS_H__ #pragma once -#include "chrome/common/child_process_info.h" +#include "content/common/child_process_info.h" class CommandLine; diff --git a/chrome/common/sandbox_policy.cc b/chrome/common/sandbox_policy.cc index ca6efd0..319f181 100644 --- a/chrome/common/sandbox_policy.cc +++ b/chrome/common/sandbox_policy.cc @@ -17,11 +17,11 @@ #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/win/windows_version.h" -#include "chrome/common/child_process_info.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/debug_flags.h" +#include "content/common/child_process_info.h" #include "sandbox/src/sandbox.h" static sandbox::BrokerServices* g_broker_services = NULL; diff --git a/chrome/common/service_process_util.cc b/chrome/common/service_process_util.cc index 89e9e9a..8120a28 100644 --- a/chrome/common/service_process_util.cc +++ b/chrome/common/service_process_util.cc @@ -17,12 +17,12 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "base/version.h" -#include "chrome/common/child_process_host.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/service_process_util.h" +#include "content/common/child_process_host.h" #if !defined(OS_MACOSX) diff --git a/chrome/common/service_process_util_mac.mm b/chrome/common/service_process_util_mac.mm index 0f5746f..75b4b2a 100644 --- a/chrome/common/service_process_util_mac.mm +++ b/chrome/common/service_process_util_mac.mm @@ -18,10 +18,10 @@ #include "base/sys_string_conversions.h" #include "base/threading/thread_restrictions.h" #include "base/version.h" -#include "chrome/common/child_process_host.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" +#include "content/common/child_process_host.h" #include "third_party/GTM/Foundation/GTMServiceManagement.h" namespace { diff --git a/chrome/service/service_child_process_host.h b/chrome/service/service_child_process_host.h index b69d3db..6834a0d 100644 --- a/chrome/service/service_child_process_host.h +++ b/chrome/service/service_child_process_host.h @@ -7,8 +7,8 @@ #pragma once #include "base/process.h" -#include "chrome/common/child_process_host.h" -#include "chrome/common/child_process_info.h" +#include "content/common/child_process_host.h" +#include "content/common/child_process_info.h" // Plugins/workers and other child processes that live on the IO thread should diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc index 0539c7e..e6cd724 100644 --- a/chrome/test/automation/proxy_launcher.cc +++ b/chrome/test/automation/proxy_launcher.cc @@ -15,7 +15,6 @@ #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/common/automation_constants.h" -#include "chrome/common/child_process_info.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/debug_flags.h" @@ -26,6 +25,7 @@ #include "chrome/test/test_switches.h" #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/ui/ui_test.h" +#include "content/common/child_process_info.h" namespace { diff --git a/content/browser/browser_child_process_host.h b/content/browser/browser_child_process_host.h index f57ec5f..2010a79 100644 --- a/content/browser/browser_child_process_host.h +++ b/content/browser/browser_child_process_host.h @@ -8,10 +8,10 @@ #include <list> -#include "chrome/common/child_process_host.h" -#include "chrome/common/child_process_info.h" #include "content/browser/child_process_launcher.h" #include "content/browser/renderer_host/resource_message_filter.h" +#include "content/common/child_process_host.h" +#include "content/common/child_process_info.h" class ResourceDispatcherHost; diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index dcda00c..de62ee9 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -77,7 +77,7 @@ #include "base/file_descriptor_posix.h" #endif #if defined(OS_WIN) -#include "chrome/common/child_process_host.h" +#include "content/common/child_process_host.h" #endif #if defined(USE_NSS) #include "chrome/browser/ui/crypto_module_password_dialog.h" diff --git a/content/browser/renderer_host/render_process_host.cc b/content/browser/renderer_host/render_process_host.cc index 113236d..66c3db3 100644 --- a/content/browser/renderer_host/render_process_host.cc +++ b/content/browser/renderer_host/render_process_host.cc @@ -6,11 +6,11 @@ #include "base/rand_util.h" #include "base/sys_info.h" -#include "chrome/common/child_process_info.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/notification_service.h" #include "content/browser/browser_thread.h" #include "content/browser/child_process_security_policy.h" +#include "content/common/child_process_info.h" namespace { diff --git a/content/browser/renderer_host/resource_dispatcher_host.h b/content/browser/renderer_host/resource_dispatcher_host.h index 7b5cf3c..12fca85 100644 --- a/content/browser/renderer_host/resource_dispatcher_host.h +++ b/content/browser/renderer_host/resource_dispatcher_host.h @@ -22,9 +22,9 @@ #include "base/observer_list.h" #include "base/scoped_ptr.h" #include "base/timer.h" -#include "chrome/common/child_process_info.h" #include "chrome/common/notification_type.h" #include "content/browser/renderer_host/resource_queue.h" +#include "content/common/child_process_info.h" #include "ipc/ipc_message.h" #include "net/url_request/url_request.h" #include "webkit/glue/resource_type.h" diff --git a/content/browser/renderer_host/resource_dispatcher_host_request_info.h b/content/browser/renderer_host/resource_dispatcher_host_request_info.h index 2322c43..13b6fa2 100644 --- a/content/browser/renderer_host/resource_dispatcher_host_request_info.h +++ b/content/browser/renderer_host/resource_dispatcher_host_request_info.h @@ -10,7 +10,7 @@ #include "base/basictypes.h" #include "base/time.h" -#include "chrome/common/child_process_info.h" +#include "content/common/child_process_info.h" #include "net/base/load_states.h" #include "net/url_request/url_request.h" #include "webkit/glue/resource_type.h" diff --git a/content/browser/renderer_host/resource_message_filter.h b/content/browser/renderer_host/resource_message_filter.h index efc6aa0..e3a6833 100644 --- a/content/browser/renderer_host/resource_message_filter.h +++ b/content/browser/renderer_host/resource_message_filter.h @@ -6,8 +6,8 @@ #define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_MESSAGE_FILTER_H_ #include "base/scoped_ptr.h" -#include "chrome/common/child_process_info.h" #include "content/browser/browser_message_filter.h" +#include "content/common/child_process_info.h" class ChromeURLRequestContext; class ResourceDispatcherHost; diff --git a/chrome/common/child_process_host.cc b/content/common/child_process_host.cc index 8fa711b..c1dce2e 100644 --- a/chrome/common/child_process_host.cc +++ b/content/common/child_process_host.cc @@ -1,15 +1,15 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/child_process_host.h" +#include "content/common/child_process_host.h" #include "base/command_line.h" #include "base/file_path.h" #include "base/metrics/histogram.h" #include "base/path_service.h" #include "base/third_party/dynamic_annotations/dynamic_annotations.h" -#include "chrome/common/child_process_info.h" +#include "content/common/child_process_info.h" #include "content/common/child_process_messages.h" #include "content/common/content_paths.h" #include "content/common/content_switches.h" diff --git a/chrome/common/child_process_host.h b/content/common/child_process_host.h index 08f585e..67b14b5 100644 --- a/chrome/common/child_process_host.h +++ b/content/common/child_process_host.h @@ -1,9 +1,9 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_CHILD_PROCESS_HOST_H_ -#define CHROME_COMMON_CHILD_PROCESS_HOST_H_ +#ifndef CONTENT_COMMON_CHILD_PROCESS_HOST_H_ +#define CONTENT_COMMON_CHILD_PROCESS_HOST_H_ #pragma once #include <string> @@ -17,7 +17,7 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" -#include "chrome/common/notification_type.h" +#include "content/common/notification_type.h" #include "ipc/ipc_channel_proxy.h" class CommandLine; @@ -123,4 +123,4 @@ class ChildProcessHost : public IPC::Channel::Listener, DISALLOW_COPY_AND_ASSIGN(ChildProcessHost); }; -#endif // CHROME_COMMON_CHILD_PROCESS_HOST_H_ +#endif // CONTENT_COMMON_CHILD_PROCESS_HOST_H_ diff --git a/chrome/common/child_process_info.cc b/content/common/child_process_info.cc index 9084646..4775d7b 100644 --- a/chrome/common/child_process_info.cc +++ b/content/common/child_process_info.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/child_process_info.h" +#include "content/common/child_process_info.h" #include <limits> @@ -13,8 +13,6 @@ #include "base/rand_util.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "grit/generated_resources.h" -#include "ui/base/l10n/l10n_util.h" ChildProcessInfo::ChildProcessInfo(ProcessType type, int id) : type_(type), @@ -119,58 +117,6 @@ std::string ChildProcessInfo::GetFullTypeNameInEnglish( return GetTypeNameInEnglish(type); } - -string16 ChildProcessInfo::GetLocalizedTitle() const { - string16 title = WideToUTF16Hack(name_); - if (type_ == ChildProcessInfo::PLUGIN_PROCESS && title.empty()) - title = l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UNKNOWN_PLUGIN_NAME); - - // Explicitly mark name as LTR if there is no strong RTL character, - // to avoid the wrong concatenation result similar to "!Yahoo! Mail: the - // best web-based Email: NIGULP", in which "NIGULP" stands for the Hebrew - // or Arabic word for "plugin". - base::i18n::AdjustStringForLocaleDirection(&title); - - switch (type_) { - case ChildProcessInfo::UTILITY_PROCESS: - return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX); - - case ChildProcessInfo::PROFILE_IMPORT_PROCESS: - return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX); - - case ChildProcessInfo::GPU_PROCESS: - return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_GPU_PREFIX); - - case ChildProcessInfo::NACL_BROKER_PROCESS: - return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NACL_BROKER_PREFIX); - - case ChildProcessInfo::PLUGIN_PROCESS: - case ChildProcessInfo::PPAPI_PLUGIN_PROCESS: - return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_PLUGIN_PREFIX, - title, - WideToUTF16Hack(version_)); - - case ChildProcessInfo::NACL_LOADER_PROCESS: - return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_NACL_PREFIX, title); - - case ChildProcessInfo::WORKER_PROCESS: - return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_WORKER_PREFIX, title); - - // These types don't need display names or get them from elsewhere. - case BROWSER_PROCESS: - case RENDER_PROCESS: - case ZYGOTE_PROCESS: - case SANDBOX_HELPER_PROCESS: - NOTREACHED(); - break; - - case UNKNOWN_PROCESS: - NOTREACHED() << "Need localized name for child process type."; - } - - return title; -} - std::string ChildProcessInfo::GenerateRandomChannelID(void* instance) { // Note: the string must start with the current process id, this is how // child processes determine the pid of the parent. diff --git a/chrome/common/child_process_info.h b/content/common/child_process_info.h index 8d4e60e..e36ee52 100644 --- a/chrome/common/child_process_info.h +++ b/content/common/child_process_info.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_CHILD_PROCESS_INFO_H_ -#define CHROME_COMMON_CHILD_PROCESS_INFO_H_ +#ifndef CONTENT_COMMON_CHILD_PROCESS_INFO_H_ +#define CONTENT_COMMON_CHILD_PROCESS_INFO_H_ #pragma once #include <string> @@ -85,10 +85,6 @@ class ChildProcessInfo { static std::string GetTypeNameInEnglish(ProcessType type); static std::string GetRendererTypeNameInEnglish(RendererProcessType type); - // Returns a localized title for the child process. For example, a plugin - // process would be "Plug-in: Flash" when name is "Flash". - string16 GetLocalizedTitle() const; - // We define the < operator so that the ChildProcessInfo can be used as a key // in a std::map. bool operator <(const ChildProcessInfo& rhs) const { @@ -138,4 +134,4 @@ class ChildProcessInfo { mutable base::Process process_; }; -#endif // CHROME_COMMON_CHILD_PROCESS_INFO_H_ +#endif // CONTENT_COMMON_CHILD_PROCESS_INFO_H_ diff --git a/content/content_common.gypi b/content/content_common.gypi index 0925ebb..314487e 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -17,6 +17,10 @@ 'sources': [ 'common/child_process.cc', 'common/child_process.h', + 'common/child_process_host.cc', + 'common/child_process_host.h', + 'common/child_process_info.cc', + 'common/child_process_info.h', 'common/child_process_messages.h', 'common/child_thread.cc', 'common/child_thread.h', |