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

Side by Side Diff: chrome/browser/rappor_recorder_impl.cc

Issue 2376403003: Convert RapporRecorder to use mojo. (Closed)
Patch Set: Convert RapporRecorder to use mojo. Created 4 years, 2 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/rappor_recorder_impl.h"
6
7 #include "chrome/browser/browser_process.h"
8 #include "components/rappor/rappor_utils.h"
9 #include "content/public/browser/browser_thread.h"
10 #include "mojo/public/cpp/bindings/strong_binding.h"
11
12 RapporRecorderImpl::RapporRecorderImpl() = default;
13
14 RapporRecorderImpl::~RapporRecorderImpl() = default;
15
16 // static
17 void RapporRecorderImpl::Create(mojom::RapporRecorderRequest request) {
18 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
19 mojo::MakeStrongBinding(base::MakeUnique<RapporRecorderImpl>(),
20 std::move(request));
21 }
22
23 void RapporRecorderImpl::RecordRappor(const std::string& metric,
24 const std::string& sample) {
25 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
26 rappor::SampleString(g_browser_process->rappor_service(), metric,
Sam McNally 2016/10/05 09:17:25 I think it's possible g_browser_process could be n
nigeltao1 2016/10/06 04:49:37 Done.
27 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, sample);
28 }
29
30 void RapporRecorderImpl::RecordRapporURL(const std::string& metric,
31 const GURL& sample) {
32 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
33 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
34 metric, sample);
35 }
OLDNEW
« no previous file with comments | « chrome/browser/rappor_recorder_impl.h ('k') | chrome/browser/renderer_host/chrome_render_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698