Chromium Code Reviews| 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" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 void RecordAction(const base::UserMetricsAction& action) { | 15 void RecordAction(const base::UserMetricsAction& action) { |
| 16 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | |
| 17 BrowserThread::PostTask( | |
| 18 BrowserThread::UI, | |
| 19 FROM_HERE, | |
| 20 base::Bind(&RecordAction, action)); | |
| 21 return; | |
| 22 } | |
| 23 | |
| 24 base::RecordAction(action); | 16 base::RecordAction(action); |
| 25 } | 17 } |
| 26 | 18 |
| 27 void RecordComputedAction(const std::string& action) { | 19 void RecordComputedAction(const std::string& action) { |
| 28 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | |
| 29 BrowserThread::PostTask( | |
| 30 BrowserThread::UI, | |
| 31 FROM_HERE, | |
| 32 base::Bind(&RecordComputedAction, action)); | |
| 33 return; | |
| 34 } | |
| 35 | |
| 36 base::RecordComputedAction(action); | 20 base::RecordComputedAction(action); |
| 37 } | 21 } |
|
Ilya Sherman
2016/04/06 02:36:29
These methods seem like they could be removed enti
beaudoin
2016/04/06 15:06:13
Yes. Will do. Since it affects a lot more files I
Ilya Sherman
2016/04/06 21:48:48
Fair enough. Could you please file a bug and add
beaudoin
2016/04/07 18:12:34
Done.
Filed as: crbug.com/601483
| |
| 38 | 22 |
| 39 } // namespace content | 23 } // namespace content |
| OLD | NEW |