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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 9963107: Persist sessionStorage on disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review (pkasting) Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 #include "chrome/browser/web_resource/promo_resource_service.h" 77 #include "chrome/browser/web_resource/promo_resource_service.h"
78 #include "chrome/browser/webdata/web_data_service.h" 78 #include "chrome/browser/webdata/web_data_service.h"
79 #include "chrome/common/chrome_constants.h" 79 #include "chrome/common/chrome_constants.h"
80 #include "chrome/common/chrome_notification_types.h" 80 #include "chrome/common/chrome_notification_types.h"
81 #include "chrome/common/chrome_paths_internal.h" 81 #include "chrome/common/chrome_paths_internal.h"
82 #include "chrome/common/chrome_switches.h" 82 #include "chrome/common/chrome_switches.h"
83 #include "chrome/common/chrome_version_info.h" 83 #include "chrome/common/chrome_version_info.h"
84 #include "chrome/common/pref_names.h" 84 #include "chrome/common/pref_names.h"
85 #include "chrome/common/url_constants.h" 85 #include "chrome/common/url_constants.h"
86 #include "content/public/browser/browser_thread.h" 86 #include "content/public/browser/browser_thread.h"
87 #include "content/public/browser/dom_storage_context.h"
87 #include "content/public/browser/host_zoom_map.h" 88 #include "content/public/browser/host_zoom_map.h"
88 #include "content/public/browser/notification_service.h" 89 #include "content/public/browser/notification_service.h"
89 #include "content/public/browser/render_process_host.h" 90 #include "content/public/browser/render_process_host.h"
90 #include "content/public/browser/user_metrics.h" 91 #include "content/public/browser/user_metrics.h"
91 #include "grit/chromium_strings.h" 92 #include "grit/chromium_strings.h"
92 #include "grit/generated_resources.h" 93 #include "grit/generated_resources.h"
93 #include "ui/base/l10n/l10n_util.h" 94 #include "ui/base/l10n/l10n_util.h"
94 95
95 #if defined(ENABLE_CONFIGURATION_POLICY) 96 #if defined(ENABLE_CONFIGURATION_POLICY)
96 #include "chrome/browser/policy/browser_policy_connector.h" 97 #include "chrome/browser/policy/browser_policy_connector.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 prefs_.reset(PrefService::CreatePrefService( 307 prefs_.reset(PrefService::CreatePrefService(
307 GetPrefFilePath(), 308 GetPrefFilePath(),
308 policy_service_.get(), 309 policy_service_.get(),
309 new ExtensionPrefStore( 310 new ExtensionPrefStore(
310 ExtensionPrefValueMapFactory::GetForProfile(this), false), 311 ExtensionPrefValueMapFactory::GetForProfile(this), false),
311 false)); 312 false));
312 OnPrefsLoaded(true); 313 OnPrefsLoaded(true);
313 } else { 314 } else {
314 NOTREACHED(); 315 NOTREACHED();
315 } 316 }
317
318 if (command_line->HasSwitch(switches::kEnableRestoreSessionState)) {
319 content::BrowserContext::GetDefaultDOMStorageContext(this)->
320 SetSaveSessionStorageOnDisk();
321 }
316 } 322 }
317 323
318 void ProfileImpl::DoFinalInit(bool is_new_profile) { 324 void ProfileImpl::DoFinalInit(bool is_new_profile) {
319 PrefService* prefs = GetPrefs(); 325 PrefService* prefs = GetPrefs();
320 pref_change_registrar_.Init(prefs); 326 pref_change_registrar_.Init(prefs);
321 pref_change_registrar_.Add(prefs::kGoogleServicesUsername, this); 327 pref_change_registrar_.Add(prefs::kGoogleServicesUsername, this);
322 pref_change_registrar_.Add(prefs::kDefaultZoomLevel, this); 328 pref_change_registrar_.Add(prefs::kDefaultZoomLevel, this);
323 pref_change_registrar_.Add(prefs::kProfileAvatarIndex, this); 329 pref_change_registrar_.Add(prefs::kProfileAvatarIndex, this);
324 pref_change_registrar_.Add(prefs::kProfileName, this); 330 pref_change_registrar_.Add(prefs::kProfileName, this);
325 331
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 if (!path.empty()) 1091 if (!path.empty())
1086 *cache_path = path; 1092 *cache_path = path;
1087 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1093 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1088 prefs_->GetInteger(prefs::kDiskCacheSize); 1094 prefs_->GetInteger(prefs::kDiskCacheSize);
1089 } 1095 }
1090 1096
1091 base::Callback<ChromeURLDataManagerBackend*(void)> 1097 base::Callback<ChromeURLDataManagerBackend*(void)>
1092 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { 1098 ProfileImpl::GetChromeURLDataManagerBackendGetter() const {
1093 return io_data_.GetChromeURLDataManagerBackendGetter(); 1099 return io_data_.GetChromeURLDataManagerBackendGetter();
1094 } 1100 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698