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

Side by Side Diff: components/domain_reliability/google_configs.cc

Issue 2613223002: Remove ScopedVector from base::JSONValueConverter (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698