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

Side by Side Diff: chrome/browser/profiles/profile_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_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/content_settings/host_content_settings_map.h" 21 #include "chrome/browser/content_settings/host_content_settings_map.h"
22 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 22 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
23 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 23 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
24 #include "chrome/browser/download/download_service.h" 24 #include "chrome/browser/download/download_service.h"
25 #include "chrome/browser/download/download_service_factory.h" 25 #include "chrome/browser/download/download_service_factory.h"
26 #include "chrome/browser/extensions/extension_info_map.h" 26 #include "chrome/browser/extensions/extension_info_map.h"
27 #include "chrome/browser/extensions/extension_protocols.h" 27 #include "chrome/browser/extensions/extension_protocols.h"
28 #include "chrome/browser/extensions/extension_resource_protocols.h" 28 #include "chrome/browser/extensions/extension_resource_protocols.h"
29 #include "chrome/browser/extensions/extension_system.h" 29 #include "chrome/browser/extensions/extension_system.h"
30 #include "chrome/browser/io_thread.h" 30 #include "chrome/browser/io_thread.h"
31 #include "chrome/browser/net/cache_stats.h"
31 #include "chrome/browser/net/chrome_cookie_notification_details.h" 32 #include "chrome/browser/net/chrome_cookie_notification_details.h"
32 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" 33 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
33 #include "chrome/browser/net/chrome_net_log.h" 34 #include "chrome/browser/net/chrome_net_log.h"
34 #include "chrome/browser/net/chrome_network_delegate.h" 35 #include "chrome/browser/net/chrome_network_delegate.h"
35 #include "chrome/browser/net/http_server_properties_manager.h" 36 #include "chrome/browser/net/http_server_properties_manager.h"
36 #include "chrome/browser/net/proxy_service_factory.h" 37 #include "chrome/browser/net/proxy_service_factory.h"
37 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" 38 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
38 #include "chrome/browser/net/transport_security_persister.h" 39 #include "chrome/browser/net/transport_security_persister.h"
39 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 40 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
40 #include "chrome/browser/policy/url_blacklist_manager.h" 41 #include "chrome/browser/policy/url_blacklist_manager.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 #endif 209 #endif
209 210
210 initialized_on_UI_thread_ = true; 211 initialized_on_UI_thread_ = true;
211 212
212 // We need to make sure that content initializes its own data structures that 213 // We need to make sure that content initializes its own data structures that
213 // are associated with each ResourceContext because we might post this 214 // are associated with each ResourceContext because we might post this
214 // object to the IO thread after this function. 215 // object to the IO thread after this function.
215 BrowserContext::EnsureResourceContextInitialized(profile); 216 BrowserContext::EnsureResourceContextInitialized(profile);
216 } 217 }
217 218
218 ProfileIOData::AppRequestContext::AppRequestContext() {} 219 ProfileIOData::AppRequestContext::AppRequestContext(
220 chrome_browser_net::CacheStats* cache_stats)
221 : ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_APP,
222 cache_stats) {
223 }
219 224
220 void ProfileIOData::AppRequestContext::SetCookieStore( 225 void ProfileIOData::AppRequestContext::SetCookieStore(
221 net::CookieStore* cookie_store) { 226 net::CookieStore* cookie_store) {
222 cookie_store_ = cookie_store; 227 cookie_store_ = cookie_store;
223 set_cookie_store(cookie_store); 228 set_cookie_store(cookie_store);
224 } 229 }
225 230
226 void ProfileIOData::AppRequestContext::SetHttpTransactionFactory( 231 void ProfileIOData::AppRequestContext::SetHttpTransactionFactory(
227 net::HttpTransactionFactory* http_factory) { 232 net::HttpTransactionFactory* http_factory) {
228 http_factory_.reset(http_factory); 233 http_factory_.reset(http_factory);
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 447
443 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. 448 // TODO(jhawkins): Remove once crbug.com/102004 is fixed.
444 CHECK(initialized_on_UI_thread_); 449 CHECK(initialized_on_UI_thread_);
445 450
446 // TODO(jhawkins): Return to DCHECK once crbug.com/102004 is fixed. 451 // TODO(jhawkins): Return to DCHECK once crbug.com/102004 is fixed.
447 CHECK(profile_params_.get()); 452 CHECK(profile_params_.get());
448 453
449 IOThread* const io_thread = profile_params_->io_thread; 454 IOThread* const io_thread = profile_params_->io_thread;
450 IOThread::Globals* const io_thread_globals = io_thread->globals(); 455 IOThread::Globals* const io_thread_globals = io_thread->globals();
451 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 456 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
457 cache_stats_ = GetCacheStats(io_thread);
452 458
453 // Create the common request contexts. 459 // Create the common request contexts.
454 main_request_context_.reset(new ChromeURLRequestContext); 460 main_request_context_.reset(
455 extensions_request_context_.reset(new ChromeURLRequestContext); 461 new ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_MAIN,
462 cache_stats_));
463 extensions_request_context_.reset(
464 new ChromeURLRequestContext(
465 ChromeURLRequestContext::CONTEXT_TYPE_EXTENSIONS,
466 cache_stats_));
456 467
457 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); 468 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend);
458 469
459 network_delegate_.reset(new ChromeNetworkDelegate( 470 network_delegate_.reset(new ChromeNetworkDelegate(
460 io_thread_globals->extension_event_router_forwarder.get(), 471 io_thread_globals->extension_event_router_forwarder.get(),
461 profile_params_->extension_info_map, 472 profile_params_->extension_info_map,
462 url_blacklist_manager_.get(), 473 url_blacklist_manager_.get(),
463 profile_params_->profile, 474 profile_params_->profile,
464 profile_params_->cookie_settings, 475 profile_params_->cookie_settings,
465 &enable_referrers_)); 476 &enable_referrers_,
477 cache_stats_));
466 478
467 fraudulent_certificate_reporter_.reset( 479 fraudulent_certificate_reporter_.reset(
468 new chrome_browser_net::ChromeFraudulentCertificateReporter( 480 new chrome_browser_net::ChromeFraudulentCertificateReporter(
469 main_request_context_.get())); 481 main_request_context_.get()));
470 482
471 proxy_service_.reset( 483 proxy_service_.reset(
472 ProxyServiceFactory::CreateProxyService( 484 ProxyServiceFactory::CreateProxyService(
473 io_thread->net_log(), 485 io_thread->net_log(),
474 io_thread_globals->proxy_script_fetcher_context.get(), 486 io_thread_globals->proxy_script_fetcher_context.get(),
475 profile_params_->proxy_config_service.release(), 487 profile_params_->proxy_config_service.release(),
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 } 588 }
577 589
578 void ProfileIOData::set_server_bound_cert_service( 590 void ProfileIOData::set_server_bound_cert_service(
579 net::ServerBoundCertService* server_bound_cert_service) const { 591 net::ServerBoundCertService* server_bound_cert_service) const {
580 server_bound_cert_service_.reset(server_bound_cert_service); 592 server_bound_cert_service_.reset(server_bound_cert_service);
581 } 593 }
582 594
583 void ProfileIOData::DestroyResourceContext() { 595 void ProfileIOData::DestroyResourceContext() {
584 resource_context_.reset(); 596 resource_context_.reset();
585 } 597 }
598
599 chrome_browser_net::CacheStats* ProfileIOData::GetCacheStats(
600 IOThread* io_thread) const {
601 return io_thread->globals()->cache_stats.get();
602 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698