diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-15 20:27:35 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-15 20:27:35 +0000 |
commit | da13e896a39a8fa7adeb7ea0c3345f62fbcbac86 (patch) | |
tree | dae375b63afd1a52c6a5449d62b2d1882b50fe7f | |
parent | f242f222bbba36f1df1392ddf0717c4a584c286f (diff) | |
download | chromium_src-da13e896a39a8fa7adeb7ea0c3345f62fbcbac86.zip chromium_src-da13e896a39a8fa7adeb7ea0c3345f62fbcbac86.tar.gz chromium_src-da13e896a39a8fa7adeb7ea0c3345f62fbcbac86.tar.bz2 |
Make ContentBrowserClient not be owned by ContentClient, so that the latter doesn't have to include a header from the former. Also tighten up DEPS checking so that we ensure that content\common doesn't depend on any other content directory.
Review URL: http://codereview.chromium.org/6695029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78273 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser_main.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_content_client.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_content_client.h | 5 | ||||
-rw-r--r-- | chrome/test/browser_with_test_window_test.cc | 4 | ||||
-rw-r--r-- | chrome/test/browser_with_test_window_test.h | 2 | ||||
-rw-r--r-- | content/DEPS | 5 | ||||
-rw-r--r-- | content/browser/DEPS | 4 | ||||
-rw-r--r-- | content/browser/renderer_host/test_render_view_host.cc | 4 | ||||
-rw-r--r-- | content/browser/renderer_host/test_render_view_host.h | 2 | ||||
-rw-r--r-- | content/browser/tab_contents/render_view_host_manager.cc | 1 | ||||
-rw-r--r-- | content/common/content_client.h | 11 | ||||
-rw-r--r-- | content/worker/DEPS | 2 |
12 files changed, 30 insertions, 17 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 59522f0..ac58f16 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -1477,8 +1477,8 @@ int BrowserMain(const MainFunctionParams& parameters) { // Override the default ContentBrowserClient to let Chrome participate in // content logic. Must be done before any tabs are created. - content::GetContentClient()->set_browser_client( - new chrome::ChromeContentBrowserClient()); + chrome::ChromeContentBrowserClient browser_client; + content::GetContentClient()->set_browser_client(&browser_client); // Tests should be able to tune login manager before showing it. // Thus only show login manager in normal (non-testing) mode. diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc index eeba233..7e53a77 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc @@ -15,4 +15,7 @@ void ChromeContentClient::SetGpuInfo(const GPUInfo& gpu_info) { child_process_logging::SetGpuInfo(gpu_info); } +void ChromeContentClient::PluginProcessStarted() { +} + } // namespace chrome diff --git a/chrome/common/chrome_content_client.h b/chrome/common/chrome_content_client.h index 8c91fca..786ce96 100644 --- a/chrome/common/chrome_content_client.h +++ b/chrome/common/chrome_content_client.h @@ -12,12 +12,9 @@ namespace chrome { class ChromeContentClient : public content::ContentClient { public: - // Sets the URL that is logged if the child process crashes. Use GURL() to - // clear the URL. virtual void SetActiveURL(const GURL& url); - - // Sets the data on the gpu to send along with crash reports. virtual void SetGpuInfo(const GPUInfo& gpu_info); + virtual void PluginProcessStarted(); }; } // namespace chrome diff --git a/chrome/test/browser_with_test_window_test.cc b/chrome/test/browser_with_test_window_test.cc index 0cc73b4..dcea7a3 100644 --- a/chrome/test/browser_with_test_window_test.cc +++ b/chrome/test/browser_with_test_window_test.cc @@ -8,7 +8,6 @@ #include <ole2.h> #endif // defined(OS_WIN) -#include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" @@ -36,8 +35,7 @@ void BrowserWithTestWindowTest::SetUp() { // NOTE: I have a feeling we're going to want virtual methods for creating // these, as such they're in SetUp instead of the constructor. profile_.reset(new TestingProfile()); - content::GetContentClient()->set_browser_client( - new chrome::ChromeContentBrowserClient()); + content::GetContentClient()->set_browser_client(&browser_client_); browser_.reset(new Browser(Browser::TYPE_NORMAL, profile())); window_.reset(new TestBrowserWindow(browser())); browser_->set_window(window_.get()); diff --git a/chrome/test/browser_with_test_window_test.h b/chrome/test/browser_with_test_window_test.h index 150b6e55..2340585 100644 --- a/chrome/test/browser_with_test_window_test.h +++ b/chrome/test/browser_with_test_window_test.h @@ -7,6 +7,7 @@ #pragma once #include "base/message_loop.h" +#include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/ui/browser.h" #include "chrome/test/test_browser_window.h" #include "chrome/test/testing_browser_process_test.h" @@ -94,6 +95,7 @@ class BrowserWithTestWindowTest : public TestingBrowserProcessTest { BrowserThread file_thread_; scoped_ptr<TestingProfile> profile_; + chrome::ChromeContentBrowserClient browser_client_; scoped_ptr<TestBrowserWindow> window_; scoped_ptr<Browser> browser_; diff --git a/content/DEPS b/content/DEPS index a5184fb..f815d36 100644 --- a/content/DEPS +++ b/content/DEPS @@ -7,6 +7,11 @@ include_rules = [ # When the src\content refactoring is complete, this will be unnecessary (and # in fact, a layering violation). "+chrome", + + # The subdirectories in content/ will manually allow their own include + # directories in content/ so we disallow all of them. + "-content", + "+content/common", "+grit", "+gpu", diff --git a/content/browser/DEPS b/content/browser/DEPS new file mode 100644 index 0000000..ed03eca --- /dev/null +++ b/content/browser/DEPS @@ -0,0 +1,4 @@ +include_rules = [
+ "+content/gpu", # For single-process mode.
+]
+
diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc index ac1caae..3f4f200 100644 --- a/content/browser/renderer_host/test_render_view_host.cc +++ b/content/browser/renderer_host/test_render_view_host.cc @@ -3,7 +3,6 @@ // found in the LICENSE file. #include "chrome/browser/browser_url_handler.h" -#include "chrome/browser/chrome_content_browser_client.h" #include "chrome/common/dom_storage_common.h" #include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" @@ -342,8 +341,7 @@ void RenderViewHostTestHarness::Reload() { void RenderViewHostTestHarness::SetUp() { // Initialize Chrome's ContentBrowserClient here, since we won't go through // BrowserMain. - content::GetContentClient()->set_browser_client( - new chrome::ChromeContentBrowserClient()); + content::GetContentClient()->set_browser_client(&browser_client_); contents_.reset(CreateTestTabContents()); } diff --git a/content/browser/renderer_host/test_render_view_host.h b/content/browser/renderer_host/test_render_view_host.h index cce4a27..6e70731 100644 --- a/content/browser/renderer_host/test_render_view_host.h +++ b/content/browser/renderer_host/test_render_view_host.h @@ -10,6 +10,7 @@ #include "base/gtest_prod_util.h" #include "base/message_loop.h" #include "build/build_config.h" +#include "chrome/browser/chrome_content_browser_client.h" #include "chrome/common/page_transition_types.h" #include "content/browser/renderer_host/mock_render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" @@ -302,6 +303,7 @@ class RenderViewHostTestHarness : public testing::Test { MockRenderProcessHostFactory rph_factory_; TestRenderViewHostFactory rvh_factory_; + chrome::ChromeContentBrowserClient browser_client_; scoped_ptr<TestTabContents> contents_; DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); diff --git a/content/browser/tab_contents/render_view_host_manager.cc b/content/browser/tab_contents/render_view_host_manager.cc index 0b49c33..51f5894 100644 --- a/content/browser/tab_contents/render_view_host_manager.cc +++ b/content/browser/tab_contents/render_view_host_manager.cc @@ -11,6 +11,7 @@ #include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" #include "chrome/common/url_constants.h" +#include "content/browser/content_browser_client.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/browser/renderer_host/render_view_host_factory.h" diff --git a/content/common/content_client.h b/content/common/content_client.h index 542b770..3b4599b 100644 --- a/content/common/content_client.h +++ b/content/common/content_client.h @@ -8,8 +8,8 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" -#include "content/browser/content_browser_client.h" +class ContentBrowserClient; class GURL; struct GPUInfo; @@ -30,10 +30,10 @@ class ContentClient { // Gets or sets the embedder API for participating in browser logic. // The client must be set early, before any content code is called. ContentBrowserClient* browser_client() { - return browser_client_.get(); + return browser_client_; } void set_browser_client(ContentBrowserClient* client) { - browser_client_.reset(client); + browser_client_ = client; } // Sets the URL that is logged if the child process crashes. Use GURL() to @@ -43,8 +43,11 @@ class ContentClient { // Sets the data on the gpu to send along with crash reports. virtual void SetGpuInfo(const GPUInfo& gpu_info) {} + // Notifies that a plugin process has started. + virtual void PluginProcessStarted() {} + private: - scoped_ptr<ContentBrowserClient> browser_client_; + ContentBrowserClient* browser_client_; }; } // namespace content diff --git a/content/worker/DEPS b/content/worker/DEPS index 31730d3..69dde6e 100644 --- a/content/worker/DEPS +++ b/content/worker/DEPS @@ -1,6 +1,6 @@ include_rules = [
"+chrome/app", # For UI test
- "+chrome/browser/worker_host", # For UI test.
+ "+content/browser/worker_host", # For UI test.
"+sandbox/src",
"+webkit/appcache",
"+webkit/glue",
|