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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 UserMetricsAction("ClearSiteDataOnExitEnabled")); | 323 UserMetricsAction("ClearSiteDataOnExitEnabled")); |
324 } else { | 324 } else { |
325 content::RecordAction( | 325 content::RecordAction( |
326 UserMetricsAction("ClearSiteDataOnExitDisabled")); | 326 UserMetricsAction("ClearSiteDataOnExitDisabled")); |
327 } | 327 } |
328 | 328 |
329 InstantController::RecordMetrics(this); | 329 InstantController::RecordMetrics(this); |
330 | 330 |
331 FilePath cookie_path = GetPath(); | 331 FilePath cookie_path = GetPath(); |
332 cookie_path = cookie_path.Append(chrome::kCookieFilename); | 332 cookie_path = cookie_path.Append(chrome::kCookieFilename); |
333 FilePath origin_bound_cert_path = GetPath(); | 333 FilePath server_bound_cert_path = GetPath(); |
334 origin_bound_cert_path = | 334 server_bound_cert_path = |
335 origin_bound_cert_path.Append(chrome::kOBCertFilename); | 335 server_bound_cert_path.Append(chrome::kOBCertFilename); |
336 FilePath cache_path = base_cache_path_; | 336 FilePath cache_path = base_cache_path_; |
337 int cache_max_size; | 337 int cache_max_size; |
338 GetCacheParameters(false, &cache_path, &cache_max_size); | 338 GetCacheParameters(false, &cache_path, &cache_max_size); |
339 cache_path = GetCachePath(cache_path); | 339 cache_path = GetCachePath(cache_path); |
340 | 340 |
341 FilePath media_cache_path = base_cache_path_; | 341 FilePath media_cache_path = base_cache_path_; |
342 int media_cache_max_size; | 342 int media_cache_max_size; |
343 GetCacheParameters(true, &media_cache_path, &media_cache_max_size); | 343 GetCacheParameters(true, &media_cache_path, &media_cache_max_size); |
344 media_cache_path = GetMediaCachePath(media_cache_path); | 344 media_cache_path = GetMediaCachePath(media_cache_path); |
345 | 345 |
346 FilePath extensions_cookie_path = GetPath(); | 346 FilePath extensions_cookie_path = GetPath(); |
347 extensions_cookie_path = | 347 extensions_cookie_path = |
348 extensions_cookie_path.Append(chrome::kExtensionsCookieFilename); | 348 extensions_cookie_path.Append(chrome::kExtensionsCookieFilename); |
349 | 349 |
350 FilePath app_path = GetPath().Append(chrome::kIsolatedAppStateDirname); | 350 FilePath app_path = GetPath().Append(chrome::kIsolatedAppStateDirname); |
351 | 351 |
352 SessionStartupPref startup_pref = | 352 SessionStartupPref startup_pref = |
353 BrowserInit::GetSessionStartupPref(*CommandLine::ForCurrentProcess(), | 353 BrowserInit::GetSessionStartupPref(*CommandLine::ForCurrentProcess(), |
354 this); | 354 this); |
355 bool restore_old_session_cookies = | 355 bool restore_old_session_cookies = |
356 session_restore_enabled_ && | 356 session_restore_enabled_ && |
357 (!DidLastSessionExitCleanly() || | 357 (!DidLastSessionExitCleanly() || |
358 startup_pref.type == SessionStartupPref::LAST); | 358 startup_pref.type == SessionStartupPref::LAST); |
359 | 359 |
360 InitHostZoomMap(); | 360 InitHostZoomMap(); |
361 | 361 |
362 // Make sure we initialize the ProfileIOData after everything else has been | 362 // Make sure we initialize the ProfileIOData after everything else has been |
363 // initialized that we might be reading from the IO thread. | 363 // initialized that we might be reading from the IO thread. |
364 | 364 |
365 io_data_.Init(cookie_path, origin_bound_cert_path, cache_path, | 365 io_data_.Init(cookie_path, server_bound_cert_path, cache_path, |
366 cache_max_size, media_cache_path, media_cache_max_size, | 366 cache_max_size, media_cache_path, media_cache_max_size, |
367 extensions_cookie_path, app_path, predictor_, | 367 extensions_cookie_path, app_path, predictor_, |
368 g_browser_process->local_state(), | 368 g_browser_process->local_state(), |
369 g_browser_process->io_thread(), | 369 g_browser_process->io_thread(), |
370 restore_old_session_cookies); | 370 restore_old_session_cookies); |
371 | 371 |
372 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 372 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
373 PluginPrefs::GetForProfile(this), | 373 PluginPrefs::GetForProfile(this), |
374 io_data_.GetResourceContextNoInit()); | 374 io_data_.GetResourceContextNoInit()); |
375 | 375 |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 FilePath* cache_path, | 1316 FilePath* cache_path, |
1317 int* max_size) { | 1317 int* max_size) { |
1318 DCHECK(cache_path); | 1318 DCHECK(cache_path); |
1319 DCHECK(max_size); | 1319 DCHECK(max_size); |
1320 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1320 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1321 if (!path.empty()) | 1321 if (!path.empty()) |
1322 *cache_path = path; | 1322 *cache_path = path; |
1323 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1323 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1324 prefs_->GetInteger(prefs::kDiskCacheSize); | 1324 prefs_->GetInteger(prefs::kDiskCacheSize); |
1325 } | 1325 } |
OLD | NEW |