Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: chrome/test/testing_profile.cc

Issue 6292017: Extended: Add "system" URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Next iteration Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/testing_profile.cc
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
index 3839847742f1fe3273f031d7875ef8b6cefd0643..f70aa162a15029d3d8878d24e20c1bc67dab40a6 100644
--- a/chrome/test/testing_profile.cc
+++ b/chrome/test/testing_profile.cc
@@ -494,10 +494,14 @@ void TestingProfile::SetPrefService(PrefService* prefs) {
void TestingProfile::CreateTestingPrefService() {
DCHECK(!prefs_.get());
- testing_prefs_ = new TestingPrefService();
- prefs_.reset(testing_prefs_);
+ if (!prefs_.get()) {
+ testing_prefs_ = new TestingPrefService();
+ prefs_.reset(testing_prefs_);
+ }
Profile::RegisterUserPrefs(prefs_.get());
- browser::RegisterAllPrefs(prefs_.get(), prefs_.get());
+ if (!local_state_.get())
+ local_state_.reset(new TestingPrefService());
+ browser::RegisterAllPrefs(prefs_.get(), local_state_.get());
}
PrefService* TestingProfile::GetPrefs() {
@@ -507,6 +511,18 @@ PrefService* TestingProfile::GetPrefs() {
return prefs_.get();
}
+PrefService* TestingProfile::GetLocalState() {
+ if (!local_state_.get()) {
+ CreateTestingPrefService();
+ }
+ return local_state_.get();
+}
+
+void TestingProfile::SetLocalState(PrefService* local_state) {
+ DCHECK(!local_state_.get());
+ local_state_.reset(local_state);
+}
+
TemplateURLModel* TestingProfile::GetTemplateURLModel() {
return template_url_model_.get();
}
« chrome/browser/profiles/profile_io_data.cc ('K') | « chrome/test/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698