| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/domain_reliability/google_configs.h" | 5 #include "components/domain_reliability/google_configs.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 544 |
| 545 std::unique_ptr<DomainReliabilityConfig> config( | 545 std::unique_ptr<DomainReliabilityConfig> config( |
| 546 new DomainReliabilityConfig()); | 546 new DomainReliabilityConfig()); |
| 547 config->origin = GURL("https://" + hostname + "/"); | 547 config->origin = GURL("https://" + hostname + "/"); |
| 548 config->include_subdomains = include_subdomains; | 548 config->include_subdomains = include_subdomains; |
| 549 config->collectors.clear(); | 549 config->collectors.clear(); |
| 550 if (params.include_origin_specific_collector) { | 550 if (params.include_origin_specific_collector) { |
| 551 GURL::Replacements replacements; | 551 GURL::Replacements replacements; |
| 552 replacements.SetPathStr(kGoogleOriginSpecificCollectorPathString); | 552 replacements.SetPathStr(kGoogleOriginSpecificCollectorPathString); |
| 553 config->collectors.push_back( | 553 config->collectors.push_back( |
| 554 new GURL(config->origin.ReplaceComponents(replacements))); | 554 base::MakeUnique<GURL>(config->origin.ReplaceComponents(replacements))); |
| 555 } | 555 } |
| 556 for (size_t i = 0; i < arraysize(kGoogleStandardCollectors); i++) | 556 for (size_t i = 0; i < arraysize(kGoogleStandardCollectors); i++) |
| 557 config->collectors.push_back(new GURL(kGoogleStandardCollectors[i])); | 557 config->collectors.push_back( |
| 558 base::MakeUnique<GURL>(kGoogleStandardCollectors[i])); |
| 558 config->success_sample_rate = 0.05; | 559 config->success_sample_rate = 0.05; |
| 559 config->failure_sample_rate = 1.00; | 560 config->failure_sample_rate = 1.00; |
| 560 config->path_prefixes.clear(); | 561 config->path_prefixes.clear(); |
| 561 return config; | 562 return config; |
| 562 } | 563 } |
| 563 | 564 |
| 564 } // namespace | 565 } // namespace |
| 565 | 566 |
| 566 // static | 567 // static |
| 567 void GetAllGoogleConfigs( | 568 void GetAllGoogleConfigs( |
| 568 std::vector<std::unique_ptr<DomainReliabilityConfig>>* configs_out) { | 569 std::vector<std::unique_ptr<DomainReliabilityConfig>>* configs_out) { |
| 569 configs_out->clear(); | 570 configs_out->clear(); |
| 570 | 571 |
| 571 for (auto& params : kGoogleConfigs) { | 572 for (auto& params : kGoogleConfigs) { |
| 572 configs_out->push_back(CreateGoogleConfig(params, false)); | 573 configs_out->push_back(CreateGoogleConfig(params, false)); |
| 573 if (params.duplicate_for_www) | 574 if (params.duplicate_for_www) |
| 574 configs_out->push_back(CreateGoogleConfig(params, true)); | 575 configs_out->push_back(CreateGoogleConfig(params, true)); |
| 575 } | 576 } |
| 576 } | 577 } |
| 577 | 578 |
| 578 } // namespace domain_reliability | 579 } // namespace domain_reliability |
| OLD | NEW |