diff options
-rw-r--r-- | chrome/browser/DEPS | 6 | ||||
-rw-r--r-- | chrome/browser/browser_shutdown.cc | 1 | ||||
-rw-r--r-- | chrome/browser/chrome_content_browser_client.cc | 1 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_service.cc | 12 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/renderer_host/web_cache_manager_browsertest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/sync/tools/DEPS | 2 | ||||
-rw-r--r-- | chrome/browser/sync/tools/sync_listen_notifications.cc | 8 | ||||
-rw-r--r-- | chrome/browser/ui/browser_browsertest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/visitedlink/visitedlink_unittest.cc | 34 | ||||
-rw-r--r-- | content/browser/plugin_service_impl.cc | 14 | ||||
-rw-r--r-- | content/browser/plugin_service_impl.h | 14 | ||||
-rw-r--r-- | content/public/browser/plugin_service.h | 9 |
13 files changed, 42 insertions, 65 deletions
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index c9f356b..754340d 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS @@ -34,7 +34,6 @@ include_rules = [ "+content/browser/accessibility/browser_accessibility_manager.h", "+content/browser/accessibility/browser_accessibility_state.h", "+content/browser/appcache/chrome_appcache_service.h", - "+content/browser/browser_thread_impl.h", "+content/browser/browser_url_handler.h", "+content/browser/cert_store.h", "+content/browser/child_process_security_policy.h", @@ -54,9 +53,6 @@ include_rules = [ "+content/browser/download/drag_download_util.h", "+content/browser/download/interrupt_reasons.h", "+content/browser/download/mhtml_generation_manager.h", - "+content/browser/download/mock_download_file.h", - "+content/browser/download/mock_download_item.h", - "+content/browser/download/mock_download_manager.h", "+content/browser/file_system/browser_file_system_helper.h", "+content/browser/find_pasteboard.h", "+content/browser/font_list_async.h", @@ -78,7 +74,6 @@ include_rules = [ "+content/browser/net/url_request_mock_http_job.h", "+content/browser/net/url_request_slow_download_job.h", "+content/browser/net/url_request_slow_http_job.h", - "+content/browser/plugin_process_host.h", "+content/browser/plugin_service_filter.h", "+content/browser/quota_permission_context.h", "+content/browser/renderer_host/backing_store.h", @@ -91,7 +86,6 @@ include_rules = [ "+content/browser/renderer_host/media/media_stream_manager.h", "+content/browser/renderer_host/mock_render_process_host.h", "+content/browser/renderer_host/render_process_host_browsertest.h", - "+content/browser/renderer_host/render_process_host_impl.h", "+content/browser/renderer_host/render_sandbox_host_linux.h", "+content/browser/renderer_host/render_view_host.h", "+content/browser/renderer_host/render_view_host_factory.h", diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index 995ded5..0626aae 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc @@ -34,7 +34,6 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/common/switch_utils.h" -#include "content/browser/plugin_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host.h" #include "content/public/browser/browser_thread.h" diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 54da16a..f431f6e 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -68,7 +68,6 @@ #include "content/browser/child_process_security_policy.h" #include "content/browser/gpu/gpu_data_manager.h" #include "content/browser/gpu/gpu_process_host.h" -#include "content/browser/plugin_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/resource_context.h" #include "content/browser/ssl/ssl_cert_error_handler.h" diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 6fe5f1e..84397982 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -92,7 +92,6 @@ #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" -#include "content/browser/plugin_process_host.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/devtools_agent_host_registry.h" #include "content/public/browser/devtools_manager.h" @@ -145,13 +144,6 @@ static const int kOmniboxIconPaddingRight = 0; const char* kNaClPluginMimeType = "application/x-nacl"; -static void ForceShutdownPlugin(const FilePath& plugin_path) { - PluginProcessHost* plugin = - PluginService::GetInstance()->FindNpapiPluginProcess(plugin_path); - if (plugin) - plugin->ForceShutdown(); -} - static bool IsSyncableExtension(const Extension& extension) { return extension.GetSyncType() == Extension::SYNC_TYPE_EXTENSION; } @@ -1158,9 +1150,7 @@ void ExtensionService::NotifyExtensionUnloaded( bool plugins_changed = false; for (size_t i = 0; i < extension->plugins().size(); ++i) { const Extension::PluginInfo& plugin = extension->plugins()[i]; - if (!BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - base::Bind(&ForceShutdownPlugin, plugin.path))) - NOTREACHED(); + PluginService::GetInstance()->ForcePluginShutdown(plugin.path); PluginService::GetInstance()->RefreshPlugins(); PluginService::GetInstance()->RemoveExtraPluginPath(plugin.path); plugins_changed = true; diff --git a/chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc b/chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc index 6598717..eb140c2 100644 --- a/chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc +++ b/chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc @@ -10,8 +10,8 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/url_constants.h" #include "chrome/test/base/ui_test_utils.h" -#include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/renderer_host/render_view_host.h" +#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host_delegate.h" namespace { diff --git a/chrome/browser/renderer_host/web_cache_manager_browsertest.cc b/chrome/browser/renderer_host/web_cache_manager_browsertest.cc index 4d9dac7..ce912cb 100644 --- a/chrome/browser/renderer_host/web_cache_manager_browsertest.cc +++ b/chrome/browser/renderer_host/web_cache_manager_browsertest.cc @@ -10,7 +10,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" -#include "content/browser/renderer_host/render_process_host_impl.h" +#include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/result_codes.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/sync/tools/DEPS b/chrome/browser/sync/tools/DEPS index 5fa3c59..877f421 100644 --- a/chrome/browser/sync/tools/DEPS +++ b/chrome/browser/sync/tools/DEPS @@ -1,6 +1,4 @@ include_rules = [ - # sync_tools needs to manage its own BrowserThreads. - "+content/browser", # sync_tools depends on the google cache invalidation API. "+google/cacheinvalidation", # sync_tools depends on libjingle. diff --git a/chrome/browser/sync/tools/sync_listen_notifications.cc b/chrome/browser/sync/tools/sync_listen_notifications.cc index 32055af..c5836ab 100644 --- a/chrome/browser/sync/tools/sync_listen_notifications.cc +++ b/chrome/browser/sync/tools/sync_listen_notifications.cc @@ -23,7 +23,7 @@ #include "chrome/browser/sync/syncable/model_type_payload_map.h" #include "chrome/test/base/test_url_request_context_getter.h" #include "content/public/browser/browser_thread.h" -#include "content/browser/browser_thread_impl.h" +#include "content/test/test_browser_thread.h" using content::BrowserThread; @@ -100,11 +100,11 @@ int main(int argc, char* argv[]) { logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); MessageLoop ui_loop; - content::BrowserThreadImpl ui_thread(BrowserThread::UI, &ui_loop); - content::BrowserThreadImpl io_thread(BrowserThread::IO); + content::TestBrowserThread ui_thread(BrowserThread::UI, &ui_loop); + content::TestBrowserThread io_thread(BrowserThread::IO); base::Thread::Options options; options.message_loop_type = MessageLoop::TYPE_IO; - io_thread.StartWithOptions(options); + io_thread.StartIOThread(); // Parse command line. const CommandLine& command_line = *CommandLine::ForCurrentProcess(); diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index bb8e7dd..ebb7a88 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -41,13 +41,13 @@ #include "chrome/common/url_constants.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" -#include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/interstitial_page.h" #include "content/public/browser/favicon_status.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/common/page_transition_types.h" diff --git a/chrome/browser/visitedlink/visitedlink_unittest.cc b/chrome/browser/visitedlink/visitedlink_unittest.cc index 6525d8b..f0b4f7f 100644 --- a/chrome/browser/visitedlink/visitedlink_unittest.cc +++ b/chrome/browser/visitedlink/visitedlink_unittest.cc @@ -18,7 +18,7 @@ #include "chrome/renderer/visitedlink_slave.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_profile.h" -#include "content/browser/renderer_host/render_process_host_impl.h" +#include "content/browser/renderer_host/mock_render_process_host.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" #include "content/test/test_browser_thread.h" @@ -499,11 +499,11 @@ class VisitCountingProfile : public TestingProfile { }; // Stub out as little as possible, borrowing from RenderProcessHost. -class VisitRelayingRenderProcessHost : public RenderProcessHostImpl { +class VisitRelayingRenderProcessHost : public MockRenderProcessHost { public: explicit VisitRelayingRenderProcessHost( content::BrowserContext* browser_context) - : RenderProcessHostImpl(browser_context) { + : MockRenderProcessHost(browser_context), widgets_(0) { content::NotificationService::current()->Notify( content::NOTIFICATION_RENDERER_PROCESS_CREATED, content::Source<RenderProcessHost>(this), @@ -516,23 +516,11 @@ class VisitRelayingRenderProcessHost : public RenderProcessHostImpl { content::NotificationService::NoDetails()); } - virtual bool Init(bool is_accessibility_enabled) { - return true; - } - - virtual void CancelResourceRequests(int render_widget_id) { - } - - virtual void CrossSiteSwapOutACK(const ViewMsg_SwapOut_Params& params) { - } + virtual void WidgetRestored() OVERRIDE { widgets_++; } + virtual void WidgetHidden() OVERRIDE { widgets_--; } + virtual int VisibleWidgetCount() const OVERRIDE { return widgets_; } - virtual bool WaitForPaintMsg(int render_widget_id, - const base::TimeDelta& max_delay, - IPC::Message* msg) { - return false; - } - - virtual bool Send(IPC::Message* msg) { + virtual bool Send(IPC::Message* msg) OVERRIDE { VisitCountingProfile* counting_profile = static_cast<VisitCountingProfile*>( Profile::FromBrowserContext(GetBrowserContext())); @@ -550,11 +538,9 @@ class VisitRelayingRenderProcessHost : public RenderProcessHostImpl { return true; } - virtual void SetBackgrounded(bool backgrounded) { - backgrounded_ = backgrounded; - } - private: + int widgets_; + DISALLOW_COPY_AND_ASSIGN(VisitRelayingRenderProcessHost); }; @@ -579,9 +565,7 @@ class VisitedLinkEventsTest : public ChromeRenderViewHostTestHarness { : ui_thread_(BrowserThread::UI, &message_loop_), file_thread_(BrowserThread::FILE, &message_loop_) {} virtual ~VisitedLinkEventsTest() {} - virtual void SetFactoryMode() {} virtual void SetUp() { - SetFactoryMode(); rvh_factory_.set_render_process_host_factory(&vc_rph_factory_); browser_context_.reset(new VisitCountingProfile()); ChromeRenderViewHostTestHarness::SetUp(); diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index fad5d5e..397ac1e 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -613,6 +613,20 @@ content::PluginServiceFilter* PluginServiceImpl::GetFilter() { return filter_; } +void PluginServiceImpl::ForcePluginShutdown(const FilePath& plugin_path) { + if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::Bind(&PluginServiceImpl::ForcePluginShutdown, + base::Unretained(this), plugin_path)); + return; + } + + PluginProcessHost* plugin = FindNpapiPluginProcess(plugin_path); + if (plugin) + plugin->ForceShutdown(); +} + void PluginServiceImpl::RefreshPlugins() { plugin_list_->RefreshPlugins(); } diff --git a/content/browser/plugin_service_impl.h b/content/browser/plugin_service_impl.h index fc96968..4b74b58 100644 --- a/content/browser/plugin_service_impl.h +++ b/content/browser/plugin_service_impl.h @@ -68,8 +68,6 @@ class CONTENT_EXPORT PluginServiceImpl // content::PluginService implementation: virtual void Init() OVERRIDE; virtual void StartWatchingPlugins() OVERRIDE; - virtual PluginProcessHost* FindNpapiPluginProcess( - const FilePath& plugin_path) OVERRIDE; virtual bool GetPluginInfoArray( const GURL& url, const std::string& mime_type, @@ -95,6 +93,7 @@ class CONTENT_EXPORT PluginServiceImpl const FilePath& plugin_path) OVERRIDE; virtual void SetFilter(content::PluginServiceFilter* filter) OVERRIDE; virtual content::PluginServiceFilter* GetFilter() OVERRIDE; + virtual void ForcePluginShutdown(const FilePath& plugin_path) OVERRIDE; virtual void RefreshPlugins() OVERRIDE; virtual void AddExtraPluginPath(const FilePath& path) OVERRIDE; virtual void AddExtraPluginDir(const FilePath& path) OVERRIDE; @@ -107,10 +106,6 @@ class CONTENT_EXPORT PluginServiceImpl virtual void SetPluginListForTesting( webkit::npapi::PluginList* plugin_list) OVERRIDE; - // Like FindNpapiPluginProcess but for Pepper. - PpapiPluginProcessHost* FindPpapiPluginProcess(const FilePath& plugin_path); - PpapiPluginProcessHost* FindPpapiBrokerProcess(const FilePath& broker_path); - // Returns the plugin process host corresponding to the plugin process that // has been started by this service. This will start a process to host the // 'plugin_path' if needed. If the process fails to start, the return value @@ -157,6 +152,13 @@ class CONTENT_EXPORT PluginServiceImpl const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; + // Returns the plugin process host corresponding to the plugin process that + // has been started by this service. Returns NULL if no process has been + // started. + PluginProcessHost* FindNpapiPluginProcess(const FilePath& plugin_path); + PpapiPluginProcessHost* FindPpapiPluginProcess(const FilePath& plugin_path); + PpapiPluginProcessHost* FindPpapiBrokerProcess(const FilePath& broker_path); + void RegisterPepperPlugins(); // Function that is run on the FILE thread to load the plugins synchronously. diff --git a/content/public/browser/plugin_service.h b/content/public/browser/plugin_service.h index 9a7985a..b1ff942 100644 --- a/content/public/browser/plugin_service.h +++ b/content/public/browser/plugin_service.h @@ -63,12 +63,6 @@ class PluginService { // Starts watching for changes in the list of installed plug-ins. virtual void StartWatchingPlugins() = 0; - // Returns the plugin process host corresponding to the plugin process that - // has been started by this service. Returns NULL if no process has been - // started. - virtual PluginProcessHost* FindNpapiPluginProcess( - const FilePath& plugin_path) = 0; - // Gets the plugin in the list of plugins that matches the given url and mime // type. Returns true if the data is frome a stale plugin list, false if it // is up to date. This can be called from any thread. @@ -116,6 +110,9 @@ class PluginService { virtual void SetFilter(PluginServiceFilter* filter) = 0; virtual PluginServiceFilter* GetFilter() = 0; + // If the plugin with the given path is running, cleanly shuts it down. + virtual void ForcePluginShutdown(const FilePath& plugin_path) = 0; + // The following functions are wrappers around webkit::npapi::PluginList. // These must be used instead of those in order to ensure that we have a // single global list in the component build and so that we don't |