| 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_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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 bool IsDomainReliabilityMonitoringEnabled() { | 80 bool IsDomainReliabilityMonitoringEnabled() { |
| 81 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 81 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 82 if (command_line->HasSwitch(switches::kDisableDomainReliability)) | 82 if (command_line->HasSwitch(switches::kDisableDomainReliability)) |
| 83 return false; | 83 return false; |
| 84 if (command_line->HasSwitch(switches::kEnableDomainReliability)) | 84 if (command_line->HasSwitch(switches::kEnableDomainReliability)) |
| 85 return true; | 85 return true; |
| 86 return base::FieldTrialList::FindFullName("DomRel-Enable") == "enable"; | 86 return base::FieldTrialList::FindFullName("DomRel-Enable") == "enable"; |
| 87 } | 87 } |
| 88 | 88 |
| 89 const char* kDomainReliabilityUploadReporterString = "chrome"; |
| 90 |
| 89 } // namespace | 91 } // namespace |
| 90 | 92 |
| 91 using content::BrowserThread; | 93 using content::BrowserThread; |
| 92 | 94 |
| 93 ProfileImplIOData::Handle::Handle(Profile* profile) | 95 ProfileImplIOData::Handle::Handle(Profile* profile) |
| 94 : io_data_(new ProfileImplIOData), | 96 : io_data_(new ProfileImplIOData), |
| 95 profile_(profile), | 97 profile_(profile), |
| 96 initialized_(false) { | 98 initialized_(false) { |
| 97 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 98 DCHECK(profile); | 100 DCHECK(profile); |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 #endif | 498 #endif |
| 497 | 499 |
| 498 // Create a media request context based on the main context, but using a | 500 // Create a media request context based on the main context, but using a |
| 499 // media cache. It shares the same job factory as the main context. | 501 // media cache. It shares the same job factory as the main context. |
| 500 StoragePartitionDescriptor details(profile_path_, false); | 502 StoragePartitionDescriptor details(profile_path_, false); |
| 501 media_request_context_.reset(InitializeMediaRequestContext(main_context, | 503 media_request_context_.reset(InitializeMediaRequestContext(main_context, |
| 502 details)); | 504 details)); |
| 503 | 505 |
| 504 if (IsDomainReliabilityMonitoringEnabled()) { | 506 if (IsDomainReliabilityMonitoringEnabled()) { |
| 505 domain_reliability_monitor_.reset( | 507 domain_reliability_monitor_.reset( |
| 506 new domain_reliability::DomainReliabilityMonitor(main_context)); | 508 new domain_reliability::DomainReliabilityMonitor( |
| 509 main_context, kDomainReliabilityUploadReporterString)); |
| 507 domain_reliability_monitor_->AddBakedInConfigs(); | 510 domain_reliability_monitor_->AddBakedInConfigs(); |
| 508 network_delegate()->set_domain_reliability_monitor( | 511 network_delegate()->set_domain_reliability_monitor( |
| 509 domain_reliability_monitor_.get()); | 512 domain_reliability_monitor_.get()); |
| 510 } | 513 } |
| 511 | 514 |
| 512 lazy_params_.reset(); | 515 lazy_params_.reset(); |
| 513 } | 516 } |
| 514 | 517 |
| 515 void ProfileImplIOData:: | 518 void ProfileImplIOData:: |
| 516 InitializeExtensionsRequestContext(ProfileParams* profile_params) const { | 519 InitializeExtensionsRequestContext(ProfileParams* profile_params) const { |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 const base::Closure& completion) { | 735 const base::Closure& completion) { |
| 733 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 736 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 734 DCHECK(initialized()); | 737 DCHECK(initialized()); |
| 735 | 738 |
| 736 DCHECK(transport_security_state()); | 739 DCHECK(transport_security_state()); |
| 737 // Completes synchronously. | 740 // Completes synchronously. |
| 738 transport_security_state()->DeleteAllDynamicDataSince(time); | 741 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 739 DCHECK(http_server_properties_manager_); | 742 DCHECK(http_server_properties_manager_); |
| 740 http_server_properties_manager_->Clear(completion); | 743 http_server_properties_manager_->Clear(completion); |
| 741 } | 744 } |
| OLD | NEW |