Chromium Code Reviews| Index: components/rappor/rappor_utils.cc |
| diff --git a/components/rappor/rappor_utils.cc b/components/rappor/rappor_utils.cc |
| index 89e4576b7ba30837fe5ba8e2d3e947fbfb5efd02..5ee673f1dfe147bf8f04bea697c7ec5c402a964e 100644 |
| --- a/components/rappor/rappor_utils.cc |
| +++ b/components/rappor/rappor_utils.cc |
| @@ -45,4 +45,16 @@ void SampleDomainAndRegistryFromGURL(RapporService* rappor_service, |
| GetDomainAndRegistrySampleFromGURL(gurl)); |
| } |
| +void TrySampleDomainAndRegistryWithDefaultService(const std::string& metric, |
|
ddorwin
2016/11/28 21:45:42
Since we don't even check whether there is a defau
billorr
2016/11/28 23:13:03
Done.
|
| + const GURL& gurl) { |
| + RapporService* defaultService = TryGetDefaultService(); |
| + SampleDomainAndRegistryFromGURL(defaultService, metric, gurl); |
| +} |
| + |
| +RapporService* TryGetDefaultService() { |
| + return (GetDefaultService != nullptr) ? GetDefaultService() : nullptr; |
| +} |
| + |
| +RapporService* (*GetDefaultService)() = nullptr; |
| + |
| } // namespace rappor |