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

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

Issue 10736066: Adding histograms showing fraction of page load times (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
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_io_data.h" 5 #include "chrome/browser/profiles/profile_impl_io_data.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/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 DestroyResourceContext(); 260 DestroyResourceContext();
261 261
262 if (media_request_context_.get()) 262 if (media_request_context_.get())
263 media_request_context_->AssertNoURLRequests(); 263 media_request_context_->AssertNoURLRequests();
264 } 264 }
265 265
266 void ProfileImplIOData::LazyInitializeInternal( 266 void ProfileImplIOData::LazyInitializeInternal(
267 ProfileParams* profile_params) const { 267 ProfileParams* profile_params) const {
268 ChromeURLRequestContext* main_context = main_request_context(); 268 ChromeURLRequestContext* main_context = main_request_context();
269 ChromeURLRequestContext* extensions_context = extensions_request_context(); 269 ChromeURLRequestContext* extensions_context = extensions_request_context();
270 media_request_context_.reset(new ChromeURLRequestContext); 270 media_request_context_.reset(new ChromeURLRequestContext(
271 ChromeURLRequestContext::CONTEXT_TYPE_MEDIA, cache_stats()));
271 272
272 IOThread* const io_thread = profile_params->io_thread; 273 IOThread* const io_thread = profile_params->io_thread;
273 IOThread::Globals* const io_thread_globals = io_thread->globals(); 274 IOThread::Globals* const io_thread_globals = io_thread->globals();
274 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 275 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
275 // Only allow Record Mode if we are in a Debug build or where we are running 276 // Only allow Record Mode if we are in a Debug build or where we are running
276 // a cycle, and the user has limited control. 277 // a cycle, and the user has limited control.
277 bool record_mode = command_line.HasSwitch(switches::kRecordMode) && 278 bool record_mode = command_line.HasSwitch(switches::kRecordMode) &&
278 (chrome::kRecordModeEnabled || 279 (chrome::kRecordModeEnabled ||
279 command_line.HasSwitch(switches::kVisitURLs)); 280 command_line.HasSwitch(switches::kVisitURLs));
280 bool playback_mode = command_line.HasSwitch(switches::kPlaybackMode); 281 bool playback_mode = command_line.HasSwitch(switches::kPlaybackMode);
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 media_request_context_->set_job_factory(media_request_job_factory_.get()); 471 media_request_context_->set_job_factory(media_request_job_factory_.get());
471 extensions_context->set_job_factory(extensions_job_factory_.get()); 472 extensions_context->set_job_factory(extensions_job_factory_.get());
472 473
473 lazy_params_.reset(); 474 lazy_params_.reset();
474 } 475 }
475 476
476 ChromeURLRequestContext* 477 ChromeURLRequestContext*
477 ProfileImplIOData::InitializeAppRequestContext( 478 ProfileImplIOData::InitializeAppRequestContext(
478 ChromeURLRequestContext* main_context, 479 ChromeURLRequestContext* main_context,
479 const std::string& app_id) const { 480 const std::string& app_id) const {
480 AppRequestContext* context = new AppRequestContext; 481 AppRequestContext* context = new AppRequestContext(cache_stats());
481 482
482 // If this is for a guest process, we should not persist cookies and http 483 // If this is for a guest process, we should not persist cookies and http
483 // cache. 484 // cache.
484 bool guest_process = (app_id.find("guest-") != std::string::npos); 485 bool guest_process = (app_id.find("guest-") != std::string::npos);
485 486
486 // Copy most state from the main context. 487 // Copy most state from the main context.
487 context->CopyFrom(main_context); 488 context->CopyFrom(main_context);
488 489
489 FilePath app_path = app_path_.AppendASCII(app_id); 490 FilePath app_path = app_path_.AppendASCII(app_id);
490 FilePath cookie_path = app_path.Append(chrome::kCookieFilename); 491 FilePath cookie_path = app_path.Append(chrome::kCookieFilename);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( 578 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread(
578 base::Time time) { 579 base::Time time) {
579 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 580 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
580 LazyInitialize(); 581 LazyInitialize();
581 582
582 DCHECK(transport_security_state()); 583 DCHECK(transport_security_state());
583 transport_security_state()->DeleteSince(time); 584 transport_security_state()->DeleteSince(time);
584 DCHECK(http_server_properties_manager()); 585 DCHECK(http_server_properties_manager());
585 http_server_properties_manager()->Clear(); 586 http_server_properties_manager()->Clear();
586 } 587 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698