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