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

Side by Side Diff: chrome/browser/android/ntp/most_visited_sites_bridge.cc

Issue 2136503002: NTP: Fix metrics recording race condition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@android_uma
Patch Set: rebase Created 4 years, 5 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/android/ntp/most_visited_sites_bridge.h" 5 #include "chrome/browser/android/ntp/most_visited_sites_bridge.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 base::android::JavaIntArrayToIntVector(env, jtile_types, &tile_types); 207 base::android::JavaIntArrayToIntVector(env, jtile_types, &tile_types);
208 base::android::JavaIntArrayToIntVector(env, jsources, &sources); 208 base::android::JavaIntArrayToIntVector(env, jsources, &sources);
209 209
210 most_visited_.RecordTileTypeMetrics(tile_types, sources); 210 most_visited_.RecordTileTypeMetrics(tile_types, sources);
211 } 211 }
212 212
213 void MostVisitedSitesBridge::RecordOpenedMostVisitedItem( 213 void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
214 JNIEnv* env, 214 JNIEnv* env,
215 const JavaParamRef<jobject>& obj, 215 const JavaParamRef<jobject>& obj,
216 jint index, 216 jint index,
217 jint tile_type) { 217 jint tile_type,
218 most_visited_.RecordOpenedMostVisitedItem(index, tile_type); 218 jint source) {
219 most_visited_.RecordOpenedMostVisitedItem(index, tile_type, source);
219 } 220 }
220 221
221 // static 222 // static
222 bool MostVisitedSitesBridge::Register(JNIEnv* env) { 223 bool MostVisitedSitesBridge::Register(JNIEnv* env) {
223 return RegisterNativesImpl(env); 224 return RegisterNativesImpl(env);
224 } 225 }
225 226
226 static jlong Init(JNIEnv* env, 227 static jlong Init(JNIEnv* env,
227 const JavaParamRef<jobject>& obj, 228 const JavaParamRef<jobject>& obj,
228 const JavaParamRef<jobject>& jprofile) { 229 const JavaParamRef<jobject>& jprofile) {
229 MostVisitedSitesBridge* most_visited_sites = 230 MostVisitedSitesBridge* most_visited_sites =
230 new MostVisitedSitesBridge( 231 new MostVisitedSitesBridge(
231 ProfileAndroid::FromProfileAndroid(jprofile)); 232 ProfileAndroid::FromProfileAndroid(jprofile));
232 return reinterpret_cast<intptr_t>(most_visited_sites); 233 return reinterpret_cast<intptr_t>(most_visited_sites);
233 } 234 }
OLDNEW
« no previous file with comments | « chrome/browser/android/ntp/most_visited_sites_bridge.h ('k') | components/ntp_tiles/most_visited_sites.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698