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

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: ...actually make sample_rate a double :P 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 double GetSampleRate(bool success) const;
jkarlin 2015/12/09 11:46:22 nit: s/success/request_successful/ would help clar
Deprecated (see juliatuttle) 2015/12/10 17:04:23 Done.
36 36
37 // Registers with the JSONValueConverter so it will know how to convert the 37 // Registers with the JSONValueConverter so it will know how to convert the
38 // JSON for a config into the struct. 38 // JSON for a config into the struct.
39 static void RegisterJSONConverter( 39 static void RegisterJSONConverter(
40 base::JSONValueConverter<DomainReliabilityConfig>* converter); 40 base::JSONValueConverter<DomainReliabilityConfig>* converter);
41 41
42 GURL origin; 42 GURL origin;
43 bool include_subdomains; 43 bool include_subdomains;
44 ScopedVector<GURL> collectors; 44 ScopedVector<GURL> collectors;
45 45
46 double success_sample_rate; 46 double success_sample_rate;
47 double failure_sample_rate; 47 double failure_sample_rate;
48 ScopedVector<std::string> path_prefixes; 48 ScopedVector<std::string> path_prefixes;
49 49
50 private: 50 private:
51 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityConfig); 51 DISALLOW_COPY_AND_ASSIGN(DomainReliabilityConfig);
52 }; 52 };
53 53
54 } // namespace domain_reliability 54 } // namespace domain_reliability
55 55
56 #endif // COMPONENTS_DOMAIN_RELIABILITY_CONFIG_H_ 56 #endif // COMPONENTS_DOMAIN_RELIABILITY_CONFIG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698