summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authoraltimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 11:37:21 +0000
committeraltimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 11:37:21 +0000
commit844a10004ee756dd8c4fa9c0c5e6ccadabd83b74 (patch)
treec25f0168789bca79d68982a3a0b9cd0d39286c81 /chrome_frame
parent9b464b9ca9cebbad516d537a742c2ea9c351a860 (diff)
downloadchromium_src-844a10004ee756dd8c4fa9c0c5e6ccadabd83b74.zip
chromium_src-844a10004ee756dd8c4fa9c0c5e6ccadabd83b74.tar.gz
chromium_src-844a10004ee756dd8c4fa9c0c5e6ccadabd83b74.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. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=81394 (patch set <= 25), but reverted. Review URL: http://codereview.chromium.org/6716025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/test/net/fake_external_tab.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc
index 9455c77..fda3504 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,9 @@ 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);
+
+ Profile* profile =
+ g_browser_process->profile_manager()->GetProfile(profile_path);
// Create the child threads.
g_browser_process->db_thread();
g_browser_process->file_thread();