diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-16 15:48:24 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-16 15:48:24 +0000 |
commit | 0de85e7ef0cad4627c7a3bae9cb389087b242154 (patch) | |
tree | f83645726b5f55ca451fd02af44513d22b9773e5 /chrome | |
parent | 73137ef6d22efe0c188c9401f7104e92722c0c66 (diff) | |
download | chromium_src-0de85e7ef0cad4627c7a3bae9cb389087b242154.zip chromium_src-0de85e7ef0cad4627c7a3bae9cb389087b242154.tar.gz chromium_src-0de85e7ef0cad4627c7a3bae9cb389087b242154.tar.bz2 |
Remove last dependencies on chrome\common from chrome\plugin.
TBR=avi
Review URL: http://codereview.chromium.org/6677064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78372 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/thumbnail_generator.cc | 2 | ||||
-rw-r--r-- | chrome/chrome_common.gypi | 2 | ||||
-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 | ||||
-rw-r--r-- | chrome/plugin/plugin_channel.cc | 2 | ||||
-rw-r--r-- | chrome/plugin/plugin_main.cc | 7 | ||||
-rw-r--r-- | chrome/plugin/plugin_thread.cc | 25 | ||||
-rw-r--r-- | chrome/plugin/webplugin_delegate_stub.cc | 2 | ||||
-rw-r--r-- | chrome/plugin/webplugin_proxy.cc | 2 |
12 files changed, 37 insertions, 87 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index fc7ed5c..2e8e475 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -107,7 +107,7 @@ #if defined(OS_WIN) #include <objbase.h> -#include "chrome/common/section_util_win.h" +#include "content/common/section_util_win.h" #endif using WebKit::WebCache; diff --git a/chrome/browser/tab_contents/thumbnail_generator.cc b/chrome/browser/tab_contents/thumbnail_generator.cc index c721838..4cd4d22 100644 --- a/chrome/browser/tab_contents/thumbnail_generator.cc +++ b/chrome/browser/tab_contents/thumbnail_generator.cc @@ -31,7 +31,7 @@ #include "ui/gfx/skbitmap_operations.h" #if defined(OS_WIN) -#include "chrome/common/section_util_win.h" +#include "content/common/section_util_win.h" #endif // Overview diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index 3f035a9..fdd5c0b 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -99,8 +99,6 @@ 'common/safebrowsing_messages.h', 'common/sandbox_policy.cc', 'common/sandbox_policy.h', - 'common/section_util_win.cc', - 'common/section_util_win.h', 'common/serialized_script_value.cc', 'common/serialized_script_value.h', 'common/set_process_title.cc', 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_ diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc index 333f99a..10151ad 100644 --- a/chrome/plugin/plugin_channel.cc +++ b/chrome/plugin/plugin_channel.cc @@ -10,11 +10,11 @@ #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" #include "build/build_config.h" -#include "chrome/common/chrome_switches.h" #include "chrome/plugin/plugin_thread.h" #include "chrome/plugin/webplugin_delegate_stub.h" #include "chrome/plugin/webplugin_proxy.h" #include "content/common/child_process.h" +#include "content/common/content_switches.h" #include "content/common/plugin_messages.h" #include "webkit/plugins/npapi/plugin_instance.h" diff --git a/chrome/plugin/plugin_main.cc b/chrome/plugin/plugin_main.cc index 92cf96f..4ec2c08 100644 --- a/chrome/plugin/plugin_main.cc +++ b/chrome/plugin/plugin_main.cc @@ -13,12 +13,9 @@ #include "base/message_loop.h" #include "base/string_util.h" #include "base/threading/platform_thread.h" -#include "chrome/common/chrome_constants.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/common/default_plugin.h" -#include "chrome/common/logging_chrome.h" #include "chrome/plugin/plugin_thread.h" #include "content/common/child_process.h" +#include "content/common/content_switches.h" #include "content/common/hi_res_timer_manager.h" #include "content/common/main_function_params.h" #include "ui/base/system_monitor/system_monitor.h" @@ -163,8 +160,6 @@ int PluginMain(const MainFunctionParams& parameters) { } #endif - chrome::RegisterInternalDefaultPlugin(); - MessageLoop::current()->Run(); } diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 66e780a..d0692c8 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -19,10 +19,11 @@ #include "base/lazy_instance.h" #include "base/process_util.h" #include "base/threading/thread_local.h" -#include "chrome/common/chrome_switches.h" #include "chrome/plugin/npobject_util.h" #include "chrome/renderer/render_thread.h" #include "content/common/child_process.h" +#include "content/common/content_client.h" +#include "content/common/content_switches.h" #include "content/common/child_process_messages.h" #include "content/common/plugin_messages.h" #include "ipc/ipc_channel_handle.h" @@ -37,12 +38,6 @@ #if defined(USE_X11) #include "ui/base/x/x11_util.h" -#elif 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 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls( @@ -84,21 +79,11 @@ PluginThread::PluginThread() scoped_refptr<webkit::npapi::PluginLib> plugin( webkit::npapi::PluginLib::CreatePluginLib(plugin_path_)); - if (plugin.get()) { + if (plugin.get()) plugin->NP_Initialize(); -#if defined(OS_MACOSX) - base::mac::ScopedCFTypeRef<CFStringRef> plugin_name( - base::SysUTF16ToCFStringRef(plugin->plugin_info().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("%@ (%@)"), - plugin_name.get(), app_name.get())); - base::mac::SetProcessName(process_name); -#endif - } + content::GetContentClient()->PluginProcessStarted( + plugin.get() ? plugin->plugin_info().name : string16()); // Certain plugins, such as flash, steal the unhandled exception filter // thus we never get crash reports when they fault. This call fixes it. diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc index ff7d55e..b87fe22 100644 --- a/chrome/plugin/webplugin_delegate_stub.cc +++ b/chrome/plugin/webplugin_delegate_stub.cc @@ -7,12 +7,12 @@ #include "build/build_config.h" #include "base/command_line.h" -#include "chrome/common/chrome_switches.h" #include "chrome/plugin/npobject_stub.h" #include "chrome/plugin/plugin_channel.h" #include "chrome/plugin/plugin_thread.h" #include "chrome/plugin/webplugin_proxy.h" #include "content/common/content_client.h" +#include "content/common/content_switches.h" #include "content/common/plugin_messages.h" #include "third_party/npapi/bindings/npapi.h" #include "third_party/npapi/bindings/npruntime.h" diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index bc223dd..8b1be0f 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -29,7 +29,7 @@ #endif #if defined(OS_WIN) -#include "chrome/common/section_util_win.h" +#include "content/common/section_util_win.h" #include "ui/gfx/gdi_util.h" #endif |