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

Unified Diff: ios/web/user_metrics.cc

Issue 986743003: Upstream (most of) ios/web/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix namespace comment Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/url_util_unittest.cc ('k') | ios/web/web_state/js/crw_js_injection_receiver.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/user_metrics.cc
diff --git a/ios/web/user_metrics.cc b/ios/web/user_metrics.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b6ac484e6a7454b15aa60699725fa86625b3ecec
--- /dev/null
+++ b/ios/web/user_metrics.cc
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/web/public/user_metrics.h"
+
+#include <vector>
+
+#include "base/bind.h"
+#include "base/location.h"
+#include "base/metrics/user_metrics.h"
+#include "ios/web/public/web_thread.h"
+
+namespace web {
+
+void RecordAction(const base::UserMetricsAction& action) {
+ if (!WebThread::CurrentlyOn(WebThread::UI)) {
+ WebThread::PostTask(WebThread::UI, FROM_HERE,
+ base::Bind(&web::RecordAction, action));
+ return;
+ }
+
+ base::RecordAction(action);
+}
+
+void RecordComputedAction(const std::string& action) {
+ if (!WebThread::CurrentlyOn(WebThread::UI)) {
+ WebThread::PostTask(WebThread::UI, FROM_HERE,
+ base::Bind(&web::RecordComputedAction, action));
+ return;
+ }
+
+ base::RecordComputedAction(action);
+}
+
+} // namespace web
« no previous file with comments | « ios/web/url_util_unittest.cc ('k') | ios/web/web_state/js/crw_js_injection_receiver.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698