OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 DesktopNotificationServiceFactory::GetForProfile(profile); | 255 DesktopNotificationServiceFactory::GetForProfile(profile); |
256 prerender::PrerenderManager* prerender_manager = | 256 prerender::PrerenderManager* prerender_manager = |
257 profile->GetPrerenderManager(); | 257 profile->GetPrerenderManager(); |
258 if (prerender_manager) | 258 if (prerender_manager) |
259 params->prerender_manager = prerender_manager->AsWeakPtr(); | 259 params->prerender_manager = prerender_manager->AsWeakPtr(); |
260 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); | 260 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); |
261 | 261 |
262 params->proxy_config_service.reset( | 262 params->proxy_config_service.reset( |
263 ProxyServiceFactory::CreateProxyConfigService( | 263 ProxyServiceFactory::CreateProxyConfigService( |
264 profile->GetProxyConfigTracker())); | 264 profile->GetProxyConfigTracker())); |
265 params->profile_id = profile->GetRuntimeId(); | 265 params->profile = profile; |
266 profile_params_.reset(params.release()); | 266 profile_params_.reset(params.release()); |
267 } | 267 } |
268 | 268 |
269 ProfileIOData::RequestContext::RequestContext() {} | 269 ProfileIOData::RequestContext::RequestContext() {} |
270 ProfileIOData::RequestContext::~RequestContext() {} | 270 ProfileIOData::RequestContext::~RequestContext() {} |
271 | 271 |
272 ProfileIOData::AppRequestContext::AppRequestContext(const std::string& app_id) | 272 ProfileIOData::AppRequestContext::AppRequestContext(const std::string& app_id) |
273 : app_id_(app_id) {} | 273 : app_id_(app_id) {} |
274 ProfileIOData::AppRequestContext::~AppRequestContext() { | 274 ProfileIOData::AppRequestContext::~AppRequestContext() { |
275 DCHECK(ContainsKey(profile_io_data()->app_request_context_map_, app_id_)); | 275 DCHECK(ContainsKey(profile_io_data()->app_request_context_map_, app_id_)); |
(...skipping 10 matching lines...) Expand all Loading... |
286 net::HttpTransactionFactory* http_factory) { | 286 net::HttpTransactionFactory* http_factory) { |
287 http_factory_.reset(http_factory); | 287 http_factory_.reset(http_factory); |
288 set_http_transaction_factory(http_factory); | 288 set_http_transaction_factory(http_factory); |
289 } | 289 } |
290 | 290 |
291 ProfileIOData::ProfileParams::ProfileParams() | 291 ProfileIOData::ProfileParams::ProfileParams() |
292 : is_incognito(false), | 292 : is_incognito(false), |
293 clear_local_state_on_exit(false), | 293 clear_local_state_on_exit(false), |
294 io_thread(NULL), | 294 io_thread(NULL), |
295 notification_service(NULL), | 295 notification_service(NULL), |
296 profile_id(Profile::kInvalidProfileId) {} | 296 profile(NULL) {} |
297 ProfileIOData::ProfileParams::~ProfileParams() {} | 297 ProfileIOData::ProfileParams::~ProfileParams() {} |
298 | 298 |
299 ProfileIOData::ProfileIOData(bool is_incognito) | 299 ProfileIOData::ProfileIOData(bool is_incognito) |
300 : initialized_(false), | 300 : initialized_(false), |
301 ALLOW_THIS_IN_INITIALIZER_LIST(resource_context_(this)) { | 301 ALLOW_THIS_IN_INITIALIZER_LIST(resource_context_(this)) { |
302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
303 } | 303 } |
304 | 304 |
305 ProfileIOData::~ProfileIOData() { | 305 ProfileIOData::~ProfileIOData() { |
306 // If we have never initialized ProfileIOData, then Handle may hold the only | 306 // If we have never initialized ProfileIOData, then Handle may hold the only |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 extensions_request_context_ = new RequestContext; | 431 extensions_request_context_ = new RequestContext; |
432 weak_extensions_request_context_ = extensions_request_context_->GetWeakPtr(); | 432 weak_extensions_request_context_ = extensions_request_context_->GetWeakPtr(); |
433 | 433 |
434 profile_params_->appcache_service->set_request_context(main_request_context_); | 434 profile_params_->appcache_service->set_request_context(main_request_context_); |
435 | 435 |
436 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); | 436 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); |
437 | 437 |
438 network_delegate_.reset(new ChromeNetworkDelegate( | 438 network_delegate_.reset(new ChromeNetworkDelegate( |
439 io_thread_globals->extension_event_router_forwarder.get(), | 439 io_thread_globals->extension_event_router_forwarder.get(), |
440 profile_params_->extension_info_map, | 440 profile_params_->extension_info_map, |
441 profile_params_->profile_id, | 441 profile_params_->profile, |
442 &enable_referrers_)); | 442 &enable_referrers_)); |
443 | 443 |
444 dns_cert_checker_.reset( | 444 dns_cert_checker_.reset( |
445 CreateDnsCertProvenanceChecker(io_thread_globals->dnsrr_resolver.get(), | 445 CreateDnsCertProvenanceChecker(io_thread_globals->dnsrr_resolver.get(), |
446 main_request_context_)); | 446 main_request_context_)); |
447 | 447 |
448 proxy_service_.reset( | 448 proxy_service_.reset( |
449 ProxyServiceFactory::CreateProxyService( | 449 ProxyServiceFactory::CreateProxyService( |
450 io_thread->net_log(), | 450 io_thread->net_log(), |
451 io_thread_globals->proxy_script_fetcher_context.get(), | 451 io_thread_globals->proxy_script_fetcher_context.get(), |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 context->set_blob_storage_context(profile_params_->blob_storage_context); | 539 context->set_blob_storage_context(profile_params_->blob_storage_context); |
540 context->set_file_system_context(profile_params_->file_system_context); | 540 context->set_file_system_context(profile_params_->file_system_context); |
541 context->set_extension_info_map(profile_params_->extension_info_map); | 541 context->set_extension_info_map(profile_params_->extension_info_map); |
542 } | 542 } |
543 | 543 |
544 void ProfileIOData::ShutdownOnUIThread() { | 544 void ProfileIOData::ShutdownOnUIThread() { |
545 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 545 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
546 enable_referrers_.Destroy(); | 546 enable_referrers_.Destroy(); |
547 clear_local_state_on_exit_.Destroy(); | 547 clear_local_state_on_exit_.Destroy(); |
548 } | 548 } |
OLD | NEW |