summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authoraltimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 11:27:06 +0000
committeraltimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 11:27:06 +0000
commit334c59d927639aaae464f76b082a893b9fdf6987 (patch)
treef3e0a7ef15974751cbbbb32e2d075dc27088179f /chrome_frame
parentc813df0195b2c96d2265ad767d4848dd13818211 (diff)
downloadchromium_src-334c59d927639aaae464f76b082a893b9fdf6987.zip
chromium_src-334c59d927639aaae464f76b082a893b9fdf6987.tar.gz
chromium_src-334c59d927639aaae464f76b082a893b9fdf6987.tar.bz2
This CL implements alternative asynchronous methods for profile and preferences loading.
BUG=chromium-os:11104 TEST=UserProfileGotten (see "/tmp/login-times-sent") time doesn't increase, while UI jankness decreases. Review URL: http://codereview.chromium.org/6716025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81394 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/test/net/fake_external_tab.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc
index a4bd592..b2473d99 100644
--- a/chrome_frame/test/net/fake_external_tab.cc
+++ b/chrome_frame/test/net/fake_external_tab.cc
@@ -15,6 +15,7 @@
#include "base/file_util.h"
#include "base/file_version_info.h"
#include "base/i18n/icu_util.h"
+#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
@@ -102,6 +103,22 @@ bool SetFocusToAccessibleWindow(HWND hwnd) {
return ret;
}
+// Same as BrowserProcessImpl, but uses custom profile manager.
+class FakeBrowserProcessImpl : public BrowserProcessImpl {
+ public:
+ explicit FakeBrowserProcessImpl(const CommandLine& command_line)
+ : BrowserProcessImpl(command_line) {}
+
+ virtual ProfileManager* profile_manager() {
+ if (!profile_manager_.get())
+ profile_manager_.reset(new ProfileManagerWithoutInit);
+ return profile_manager_.get();
+ }
+
+ private:
+ scoped_ptr<ProfileManager> profile_manager_;
+};
+
} // namespace
@@ -213,7 +230,7 @@ void FakeExternalTab::Initialize() {
cmd->AppendSwitch(switches::kDisableWebResources);
cmd->AppendSwitch(switches::kSingleProcess);
- browser_process_.reset(new BrowserProcessImpl(*cmd));
+ browser_process_.reset(new FakeBrowserProcessImpl(*cmd));
// BrowserProcessImpl's constructor should set g_browser_process.
DCHECK(g_browser_process);
g_browser_process->SetApplicationLocale("en-US");
@@ -222,8 +239,8 @@ void FakeExternalTab::Initialize() {
browser::RegisterLocalState(browser_process_->local_state());
FilePath profile_path(ProfileManager::GetDefaultProfileDir(user_data()));
- Profile* profile = g_browser_process->profile_manager()->GetProfile(
- profile_path, false);
+ Profile* profile =
+ g_browser_process->profile_manager()->GetProfile(profile_path);
// Create the child threads.
g_browser_process->db_thread();
g_browser_process->file_thread();