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

Side by Side Diff: components/rappor/rappor_utils.cc

Issue 2526643002: Re-enable rappor for vrshell (Closed)
Patch Set: CR feedback Created 4 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
« no previous file with comments | « components/rappor/rappor_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/rappor/rappor_utils.h" 5 #include "components/rappor/rappor_utils.h"
6 6
7 #include "components/rappor/rappor_service.h" 7 #include "components/rappor/rappor_service.h"
8 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 8 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
9 #include "net/base/url_util.h" 9 #include "net/base/url_util.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
(...skipping 27 matching lines...) Expand all
38 const std::string& metric, 38 const std::string& metric,
39 const GURL& gurl) { 39 const GURL& gurl) {
40 if (!rappor_service) 40 if (!rappor_service)
41 return; 41 return;
42 rappor_service->RecordSample( 42 rappor_service->RecordSample(
43 metric, 43 metric,
44 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, 44 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE,
45 GetDomainAndRegistrySampleFromGURL(gurl)); 45 GetDomainAndRegistrySampleFromGURL(gurl));
46 } 46 }
47 47
48 RapporService* (*g_GetDefaultService)() = nullptr;
49
50 RapporService* GetDefaultService() {
51 return (g_GetDefaultService != nullptr) ? g_GetDefaultService() : nullptr;
52 }
53
54 void SetDefaultServiceAccessor(RapporService* (*getDefaultService)()) {
55 DCHECK(g_GetDefaultService == nullptr);
56 g_GetDefaultService = getDefaultService;
57 }
58
48 } // namespace rappor 59 } // namespace rappor
OLDNEW
« no previous file with comments | « components/rappor/rappor_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698