| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/public/browser/user_metrics.h" | 5 #include "content/public/browser/user_metrics.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/metrics/user_metrics.h" | 10 #include "base/metrics/user_metrics.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 BrowserThread::PostTask( | 29 BrowserThread::PostTask( |
| 30 BrowserThread::UI, | 30 BrowserThread::UI, |
| 31 FROM_HERE, | 31 FROM_HERE, |
| 32 base::Bind(&RecordComputedAction, action)); | 32 base::Bind(&RecordComputedAction, action)); |
| 33 return; | 33 return; |
| 34 } | 34 } |
| 35 | 35 |
| 36 base::RecordComputedAction(action); | 36 base::RecordComputedAction(action); |
| 37 } | 37 } |
| 38 | 38 |
| 39 CONTENT_EXPORT void RecordRappor( |
| 40 const std::string& metric, |
| 41 const std::string& sample) { |
| 42 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 43 BrowserThread::PostTask( |
| 44 BrowserThread::UI, |
| 45 FROM_HERE, |
| 46 base::Bind(&RecordRappor, metric, sample)); |
| 47 return; |
| 48 } |
| 49 |
| 50 base::RecordRappor(metric, sample); |
| 51 } |
| 52 |
| 39 } // namespace content | 53 } // namespace content |
| OLD | NEW |