Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 } | |
| OLD | NEW |