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

Issue 2838833005: Move NewTabPage.LogoShownTime metrics recording into LogoBridge (Closed)

Created:
3 years, 8 months ago by fhorschig
Modified:
3 years, 8 months ago
Reviewers:
Marc Treib
CC:
chromium-reviews, noyau+watch_chromium.org, ntp-dev+reviews_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Move NewTabPage.LogoShownTime metrics recording into LogoBridge In order to record NTP.LogoShownTime for timely refreshes only, there would be many JNI callbacks in the bridge's implementation necessary. Therefore, this CL moves the recording into the C++ side of the bridge and implements the originally intended behavior of the metric. BUG=713166

Patch Set 1 #

Patch Set 2 : Remove file without real changes #

Total comments: 2

Patch Set 3 : Remove state from LoadTimeMetricsRecorder #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -20 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoDelegateImpl.java View 4 chunks +0 lines, -11 lines 0 comments Download
M chrome/browser/android/logo_bridge.h View 1 2 4 chunks +21 lines, -1 line 0 comments Download
M chrome/browser/android/logo_bridge.cc View 1 2 9 chunks +54 lines, -5 lines 0 comments Download
M components/doodle/doodle_service.h View 1 chunk +3 lines, -1 line 0 comments Download
M components/doodle/doodle_service.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M components/doodle/doodle_service_unittest.cc View 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
fhorschig
Hi Marc, this is the alternative CL referenced in https://codereview.chromium.org/2833473002/. It is not completely tested ...
3 years, 8 months ago (2017-04-26 16:44:50 UTC) #2
tschumann
https://codereview.chromium.org/2838833005/diff/20001/chrome/browser/android/logo_bridge.h File chrome/browser/android/logo_bridge.h (right): https://codereview.chromium.org/2838833005/diff/20001/chrome/browser/android/logo_bridge.h#newcode40 chrome/browser/android/logo_bridge.h:40: class LoadTimeMetricRecorder { this seems overly complicated to me. ...
3 years, 8 months ago (2017-04-27 06:09:17 UTC) #3
fhorschig
3 years, 8 months ago (2017-04-27 11:16:14 UTC) #5
Message was sent while issue was closed.
As discussed, we will go for the originally discussed measuring in the UI:
https://codereview.chromium.org/2833473002/

Therefore, I close this CL for now.
(I took the 2min to extract the state anyway. 
Just so we have a clean reference for this alternative approach.)

https://codereview.chromium.org/2838833005/diff/20001/chrome/browser/android/...
File chrome/browser/android/logo_bridge.h (right):

https://codereview.chromium.org/2838833005/diff/20001/chrome/browser/android/...
chrome/browser/android/logo_bridge.h:40: class LoadTimeMetricRecorder {
On 2017/04/27 06:09:17, tschumann wrote:
> this seems overly complicated to me. Why do we need to maintain so much state?
> What are we abstracting here?
>
> I guess the main question is why do we have a long-lived metric-recorder (as a
> member) and not one per request. In the end, it's all about capturing a start
> time and deciding whether to log it or not, based on conditions we already
> know... (at the places where we now call the recorder).
> 
> The more state we can make request-scoped (i.e. not outlive the request), the
> simpler the solution would get (e.g., one-time callbacks instead of registered
> observers; per-request objects (passed through parameters) instead of members.
> Happy to discuss offline.

I moved the state out of the class. 
Although this CL should be abandoned soon as we discussed to do this in the UI.

Powered by Google App Engine
This is Rietveld 408576698