diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-24 23:46:39 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-24 23:46:39 +0000 |
commit | 0070eab07191eaed49b945da7db9ba8e687612a5 (patch) | |
tree | fd0e54c831050a88393aa90c78af71ea6e259eb8 /chrome | |
parent | ca9b7dd291b73243b21c03c472544387f4886dae (diff) | |
download | chromium_src-0070eab07191eaed49b945da7db9ba8e687612a5.zip chromium_src-0070eab07191eaed49b945da7db9ba8e687612a5.tar.gz chromium_src-0070eab07191eaed49b945da7db9ba8e687612a5.tar.bz2 |
Give Mac plugin processes descriptive names for Activity Monitor
BUG=none
TEST=Open Activity Monitor, and visit a page with a plugin. The plugin process should show the name of the plugin.
Review URL: http://codereview.chromium.org/659007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39950 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 3 | ||||
-rw-r--r-- | chrome/plugin/DEPS | 1 | ||||
-rw-r--r-- | chrome/plugin/plugin_thread.cc | 20 |
3 files changed, 23 insertions, 1 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index f752ade..88bd250 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -348,8 +348,9 @@ void CommonSubprocessInit() { // and resources loaded. bool SubprocessNeedsResourceBundle(const std::string& process_type) { return -#if defined(OS_WIN) +#if defined(OS_WIN) || defined(OS_MACOSX) // Windows needs resources for the default/null plugin. + // Mac needs them for the plugin process name. process_type == switches::kPluginProcess || #endif #if defined(OS_POSIX) && !defined(OS_MACOSX) diff --git a/chrome/plugin/DEPS b/chrome/plugin/DEPS index 08fd485..3517180 100644 --- a/chrome/plugin/DEPS +++ b/chrome/plugin/DEPS @@ -6,5 +6,6 @@ include_rules = [ "+third_party/npapi", "+webkit/glue", "+webkit/glue/plugins", + "+grit", # For generated headers ] diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 0a9ef12..c46de35 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -27,6 +27,15 @@ #include "webkit/glue/webkit_glue.h" #include "webkit/glue/plugins/webplugin_delegate_impl.h" +#if defined(OS_MACOSX) +#include <CoreFoundation/CoreFoundation.h> +#include "app/l10n_util.h" +#include "base/mac_util.h" +#include "base/scoped_cftyperef.h" +#include "base/sys_string_conversions.h" +#include "grit/chromium_strings.h" +#endif + static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls( base::LINKER_INITIALIZED); @@ -79,6 +88,17 @@ PluginThread::PluginThread() plugin->NP_Initialize(); } +#if defined(OS_MACOSX) + scoped_cftyperef<CFStringRef> plugin_name(base::SysWideToCFStringRef( + plugin->plugin_info().name)); + scoped_cftyperef<CFStringRef> app_name(base::SysUTF16ToCFStringRef( + l10n_util::GetStringUTF16(IDS_SHORT_PLUGIN_APP_NAME))); + scoped_cftyperef<CFStringRef> process_name(CFStringCreateWithFormat( + kCFAllocatorDefault, NULL, CFSTR("%@ (%@)"), + plugin_name.get(), app_name.get())); + mac_util::SetProcessName(process_name); +#endif + // Certain plugins, such as flash, steal the unhandled exception filter // thus we never get crash reports when they fault. This call fixes it. message_loop()->set_exception_restoration(true); |