| OLD | NEW |
| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 UserMetricsAction("ClearSiteDataOnExitEnabled")); | 350 UserMetricsAction("ClearSiteDataOnExitEnabled")); |
| 351 } else { | 351 } else { |
| 352 content::RecordAction( | 352 content::RecordAction( |
| 353 UserMetricsAction("ClearSiteDataOnExitDisabled")); | 353 UserMetricsAction("ClearSiteDataOnExitDisabled")); |
| 354 } | 354 } |
| 355 | 355 |
| 356 InstantController::RecordMetrics(this); | 356 InstantController::RecordMetrics(this); |
| 357 | 357 |
| 358 FilePath cookie_path = GetPath(); | 358 FilePath cookie_path = GetPath(); |
| 359 cookie_path = cookie_path.Append(chrome::kCookieFilename); | 359 cookie_path = cookie_path.Append(chrome::kCookieFilename); |
| 360 FilePath origin_bound_cert_path = GetPath(); | 360 FilePath server_bound_cert_path = GetPath(); |
| 361 origin_bound_cert_path = | 361 server_bound_cert_path = |
| 362 origin_bound_cert_path.Append(chrome::kOBCertFilename); | 362 server_bound_cert_path.Append(chrome::kOBCertFilename); |
| 363 FilePath cache_path = base_cache_path_; | 363 FilePath cache_path = base_cache_path_; |
| 364 int cache_max_size; | 364 int cache_max_size; |
| 365 GetCacheParameters(false, &cache_path, &cache_max_size); | 365 GetCacheParameters(false, &cache_path, &cache_max_size); |
| 366 cache_path = GetCachePath(cache_path); | 366 cache_path = GetCachePath(cache_path); |
| 367 | 367 |
| 368 FilePath media_cache_path = base_cache_path_; | 368 FilePath media_cache_path = base_cache_path_; |
| 369 int media_cache_max_size; | 369 int media_cache_max_size; |
| 370 GetCacheParameters(true, &media_cache_path, &media_cache_max_size); | 370 GetCacheParameters(true, &media_cache_path, &media_cache_max_size); |
| 371 media_cache_path = GetMediaCachePath(media_cache_path); | 371 media_cache_path = GetMediaCachePath(media_cache_path); |
| 372 | 372 |
| 373 FilePath extensions_cookie_path = GetPath(); | 373 FilePath extensions_cookie_path = GetPath(); |
| 374 extensions_cookie_path = | 374 extensions_cookie_path = |
| 375 extensions_cookie_path.Append(chrome::kExtensionsCookieFilename); | 375 extensions_cookie_path.Append(chrome::kExtensionsCookieFilename); |
| 376 | 376 |
| 377 FilePath app_path = GetPath().Append(chrome::kIsolatedAppStateDirname); | 377 FilePath app_path = GetPath().Append(chrome::kIsolatedAppStateDirname); |
| 378 | 378 |
| 379 SessionStartupPref startup_pref = | 379 SessionStartupPref startup_pref = |
| 380 BrowserInit::GetSessionStartupPref(*CommandLine::ForCurrentProcess(), | 380 BrowserInit::GetSessionStartupPref(*CommandLine::ForCurrentProcess(), |
| 381 this); | 381 this); |
| 382 bool restore_old_session_cookies = | 382 bool restore_old_session_cookies = |
| 383 session_restore_enabled_ && | 383 session_restore_enabled_ && |
| 384 (!DidLastSessionExitCleanly() || | 384 (!DidLastSessionExitCleanly() || |
| 385 startup_pref.type == SessionStartupPref::LAST); | 385 startup_pref.type == SessionStartupPref::LAST); |
| 386 | 386 |
| 387 InitHostZoomMap(); | 387 InitHostZoomMap(); |
| 388 | 388 |
| 389 // Make sure we initialize the ProfileIOData after everything else has been | 389 // Make sure we initialize the ProfileIOData after everything else has been |
| 390 // initialized that we might be reading from the IO thread. | 390 // initialized that we might be reading from the IO thread. |
| 391 | 391 |
| 392 io_data_.Init(cookie_path, origin_bound_cert_path, cache_path, | 392 io_data_.Init(cookie_path, server_bound_cert_path, cache_path, |
| 393 cache_max_size, media_cache_path, media_cache_max_size, | 393 cache_max_size, media_cache_path, media_cache_max_size, |
| 394 extensions_cookie_path, app_path, predictor_, | 394 extensions_cookie_path, app_path, predictor_, |
| 395 g_browser_process->local_state(), | 395 g_browser_process->local_state(), |
| 396 g_browser_process->io_thread(), | 396 g_browser_process->io_thread(), |
| 397 restore_old_session_cookies); | 397 restore_old_session_cookies); |
| 398 | 398 |
| 399 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 399 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
| 400 PluginPrefs::GetForProfile(this), | 400 PluginPrefs::GetForProfile(this), |
| 401 io_data_.GetResourceContextNoInit()); | 401 io_data_.GetResourceContextNoInit()); |
| 402 | 402 |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 FilePath* cache_path, | 1355 FilePath* cache_path, |
| 1356 int* max_size) { | 1356 int* max_size) { |
| 1357 DCHECK(cache_path); | 1357 DCHECK(cache_path); |
| 1358 DCHECK(max_size); | 1358 DCHECK(max_size); |
| 1359 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1359 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
| 1360 if (!path.empty()) | 1360 if (!path.empty()) |
| 1361 *cache_path = path; | 1361 *cache_path = path; |
| 1362 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1362 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
| 1363 prefs_->GetInteger(prefs::kDiskCacheSize); | 1363 prefs_->GetInteger(prefs::kDiskCacheSize); |
| 1364 } | 1364 } |
| OLD | NEW |