diff options
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/chrome_content_client.cc | 26 | ||||
-rw-r--r-- | chrome/common/chrome_content_client.h | 2 | ||||
-rw-r--r-- | chrome/common/section_util_win.cc | 29 | ||||
-rw-r--r-- | chrome/common/section_util_win.h | 23 |
4 files changed, 26 insertions, 54 deletions
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc index 1c1b2d6..381c127 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc @@ -5,6 +5,15 @@ #include "chrome/common/chrome_content_client.h" #include "chrome/common/child_process_logging.h" +#include "chrome/common/default_plugin.h" + +#if defined(OS_MACOSX) +#include "base/mac/mac_util.h" +#include "base/mac/scoped_cftyperef.h" +#include "base/sys_string_conversions.h" +#include "grit/chromium_strings.h" +#include "ui/base/l10n/l10n_util.h" +#endif namespace chrome { @@ -16,7 +25,22 @@ void ChromeContentClient::SetGpuInfo(const GPUInfo& gpu_info) { child_process_logging::SetGpuInfo(gpu_info); } -void ChromeContentClient::PluginProcessStarted() { +void ChromeContentClient::PluginProcessStarted(const string16& plugin_name) { +#if defined(OS_MACOSX) + base::mac::ScopedCFTypeRef<CFStringRef> cf_plugin_name( + base::SysUTF16ToCFStringRef(plugin_name)); + base::mac::ScopedCFTypeRef<CFStringRef> app_name( + base::SysUTF16ToCFStringRef( + l10n_util::GetStringUTF16(IDS_SHORT_PLUGIN_APP_NAME))); + base::mac::ScopedCFTypeRef<CFStringRef> process_name( + CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%@ (%@)"), + cf_plugin_name.get(), app_name.get())); + base::mac::SetProcessName(process_name); +#endif + +#if !defined(NACL_WIN64) // We don't link this in the NaCl 64 bit binary. + chrome::RegisterInternalDefaultPlugin(); +#endif } } // namespace chrome diff --git a/chrome/common/chrome_content_client.h b/chrome/common/chrome_content_client.h index 786ce96..92ceac0 100644 --- a/chrome/common/chrome_content_client.h +++ b/chrome/common/chrome_content_client.h @@ -14,7 +14,7 @@ class ChromeContentClient : public content::ContentClient { public: virtual void SetActiveURL(const GURL& url); virtual void SetGpuInfo(const GPUInfo& gpu_info); - virtual void PluginProcessStarted(); + virtual void PluginProcessStarted(const string16& plugin_name); }; } // namespace chrome diff --git a/chrome/common/section_util_win.cc b/chrome/common/section_util_win.cc deleted file mode 100644 index 449151c..0000000 --- a/chrome/common/section_util_win.cc +++ /dev/null @@ -1,29 +0,0 @@ -// 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/section_util_win.h" - -namespace chrome { - -HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only) { - HANDLE valid_section = NULL; - DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ; - if (!read_only) - access |= FILE_MAP_WRITE; - DuplicateHandle(process, section, GetCurrentProcess(), &valid_section, access, - FALSE, 0); - return valid_section; -} - -HANDLE GetSectionForProcess(HANDLE section, HANDLE process, bool read_only) { - HANDLE valid_section = NULL; - DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ; - if (!read_only) - access |= FILE_MAP_WRITE; - DuplicateHandle(GetCurrentProcess(), section, process, &valid_section, access, - FALSE, 0); - return valid_section; -} - -} // namespace chrome diff --git a/chrome/common/section_util_win.h b/chrome/common/section_util_win.h deleted file mode 100644 index a3c849e..0000000 --- a/chrome/common/section_util_win.h +++ /dev/null @@ -1,23 +0,0 @@ -// 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_SECTION_UTIL_WIN_H_ -#define CHROME_COMMON_SECTION_UTIL_WIN_H_ -#pragma once - -#include <windows.h> - -namespace chrome { - -// Duplicates a section handle from another process to the current process. -// Returns the new valid handle if the function succeed. NULL otherwise. -HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only); - -// Duplicates a section handle from the current process for use in another -// process. Returns the new valid handle or NULL on failure. -HANDLE GetSectionForProcess(HANDLE section, HANDLE process, bool read_only); - -} // namespace chrome - -#endif // CHROME_COMMON_SECTION_UTIL_WIN_H_ |