diff options
author | marshall@chromium.org <marshall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-06 16:05:13 +0000 |
---|---|---|
committer | marshall@chromium.org <marshall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-06 16:05:13 +0000 |
commit | 6f2b39bccfbb74a7633deff531a33f03efe9accf (patch) | |
tree | 4e27e58cc514dd3d553f790bb0ca299b33245e2c /chrome_frame/test/net | |
parent | b3cc0c25614566f1261b9c3759d6a076e327fd6c (diff) | |
download | chromium_src-6f2b39bccfbb74a7633deff531a33f03efe9accf.zip chromium_src-6f2b39bccfbb74a7633deff531a33f03efe9accf.tar.gz chromium_src-6f2b39bccfbb74a7633deff531a33f03efe9accf.tar.bz2 |
Support sharing of ContentMain and BrowserMain code with embedded use cases.
For the browser use case it is convenient to have a single ContentMain entry point function that handles all initialization, run and shutdown. For embedded use cases it is often necessary to integrate with existing application message loops where initialization and shutdown must be handled separately.
To support sharing of this code the following changes were required:
1. Refactor the ContentMain function to create a ContentMainRunner class containing separate initialization, run and shutdown functions.
2. Refactor the BrowserMain function and BrowserMainLoop class to create a BrowserMainRunner class containing separate initialization, run and shutdown functions.
3. Add a new BrowserMainParts::GetMainMessageLoop method. This is necessary to support creation of a custom MessageLoop implementation while sharing BrowserMainRunner initialization and shutdown code.
BUG=112507
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9190018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/net')
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.cc | 6 | ||||
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc index d81a2a2..5a7a0af 100644 --- a/chrome_frame/test/net/fake_external_tab.cc +++ b/chrome_frame/test/net/fake_external_tab.cc @@ -49,7 +49,7 @@ #include "chrome_frame/test/simulate_input.h" #include "chrome_frame/test/win_event_receiver.h" #include "chrome_frame/utils.h" -#include "content/app/content_main.h" +#include "content/public/app/content_main.h" #include "content/public/app/startup_helper_win.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" @@ -613,6 +613,10 @@ void CFUrlRequestUnittestRunner::PreEarlyInitialization() { FilterDisabledTests(); } +MessageLoop* CFUrlRequestUnittestRunner::GetMainMessageLoop() { + return NULL; +} + int CFUrlRequestUnittestRunner::PreCreateThreads() { fake_chrome_.reset(new FakeExternalTab()); fake_chrome_->Initialize(); diff --git a/chrome_frame/test/net/fake_external_tab.h b/chrome_frame/test/net/fake_external_tab.h index 0ed4f78..d7e726c7 100644 --- a/chrome_frame/test/net/fake_external_tab.h +++ b/chrome_frame/test/net/fake_external_tab.h @@ -102,6 +102,7 @@ class CFUrlRequestUnittestRunner virtual void PreEarlyInitialization() OVERRIDE; virtual void PostEarlyInitialization() OVERRIDE {} virtual void PreMainMessageLoopStart() OVERRIDE {} + virtual MessageLoop* GetMainMessageLoop() OVERRIDE; virtual void PostMainMessageLoopStart() OVERRIDE {} virtual void ToolkitInitialized() OVERRIDE {} virtual int PreCreateThreads() OVERRIDE; |