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

Side by Side Diff: components/domain_reliability/config.h

Issue 1497803004: Domain Reliability: Add sample_rate field to Beacon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_DOMAIN_RELIABILITY_CONFIG_H_ 5 #ifndef COMPONENTS_DOMAIN_RELIABILITY_CONFIG_H_
6 #define COMPONENTS_DOMAIN_RELIABILITY_CONFIG_H_ 6 #define COMPONENTS_DOMAIN_RELIABILITY_CONFIG_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 14 matching lines...) Expand all
25 public: 25 public:
26 DomainReliabilityConfig(); 26 DomainReliabilityConfig();
27 ~DomainReliabilityConfig(); 27 ~DomainReliabilityConfig();
28 28
29 // Uses the JSONValueConverter to parse the JSON for a config into a struct. 29 // Uses the JSONValueConverter to parse the JSON for a config into a struct.
30 static scoped_ptr<const DomainReliabilityConfig> FromJSON( 30 static scoped_ptr<const DomainReliabilityConfig> FromJSON(
31 const base::StringPiece& json); 31 const base::StringPiece& json);
32 32
33 bool IsValid() const; 33 bool IsValid() const;
34 34
35 bool DecideIfShouldReportRequest(bool success) const; 35 bool DecideIfShouldReportRequest(bool success, double* sample_rate_out)
jkarlin 2015/12/07 14:57:27 I would prefer you added: double GetSampleRate(bo
Deprecated (see juliatuttle) 2015/12/07 20:17:57 Done.
36 const;
36 37
37 // Registers with the JSONValueConverter so it will know how to convert the 38 // Registers with the JSONValueConverter so it will know how to convert the
38 // JSON for a config into the struct. 39 // JSON for a config into the struct.
39 static void RegisterJSONConverter( 40 static void RegisterJSONConverter(
40 base::JSONValueConverter<DomainReliabilityConfig>* converter); 41 base::JSONValueConverter<DomainReliabilityConfig>* converter);
41 42
42 GURL origin; 43 GURL origin;
43 bool include_subdomains; 44 bool include_subdomains;
44 ScopedVector<GURL> collectors; 45 ScopedVector<GURL> collectors;
45 46
46 double success_sample_rate; 47 double success_sample_rate;
47 double failure_sample_rate; 48 double failure_sample_rate;
48 ScopedVector<std::string> path_prefixes; 49 ScopedVector<std::string> path_prefixes;
49 50
50 private: 51 private:
51 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityConfig); 52 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityConfig);
52 }; 53 };
53 54
54 } // namespace domain_reliability 55 } // namespace domain_reliability
55 56
56 #endif // COMPONENTS_DOMAIN_RELIABILITY_CONFIG_H_ 57 #endif // COMPONENTS_DOMAIN_RELIABILITY_CONFIG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698