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

Issue 2141933002: Split NTP_TILE_LOADED event. (Closed)

Created:
4 years, 5 months ago by sfiera
Modified:
4 years, 5 months ago
Reviewers:
Marc Treib
CC:
chromium-reviews, dbeam+watch-ntp_chromium.org, skanuj+watch_chromium.org, melevin+watch_chromium.org, ntp-dev+reviews_chromium.org, dhollowa+watch_chromium.org, dougw+watch_chromium.org, donnd+watch_chromium.org, jfweitz+watch_chromium.org, David Black, arv+watch_chromium.org, samarth+watch_chromium.org, kmadhusu+watch_chromium.org, Jered, pedrosimonetti+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Split NTP_TILE_LOADED event. Multi-iframe NTP continues to use it, but no longer logs statistics for load time and number of tiles. This happens only for external NTPs, where the load time and number of tiles are not fully under our control anyway. Single-iframe NTP now uses NTP_ALL_TILES_LOADED. When this is logged, we emit statistics, ensuring that we log a load time and number of tiles exactly once per NTP (well, unless the user closes the page or navigates away without the page having finished loading). BUG=625990 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/9448453348b63120430d305312fcd894a9ff7f65 Cr-Commit-Position: refs/heads/master@{#405087}

Patch Set 1 #

Patch Set 2 : #

Total comments: 13

Patch Set 3 : #

Patch Set 4 : #

Total comments: 2

Patch Set 5 : #

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -170 lines) Patch
M chrome/browser/resources/local_ntp/most_visited_single.js View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/browser_instant_controller.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/search/instant_controller.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/search/instant_controller.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/ui/search/instant_tab.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/search/instant_tab.cc View 1 chunk +0 lines, -11 lines 0 comments Download
M chrome/browser/ui/search/search_tab_helper.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/search/search_tab_helper.cc View 1 chunk +0 lines, -21 lines 0 comments Download
M chrome/browser/ui/search/search_tab_helper_unittest.cc View 1 2 1 chunk +0 lines, -40 lines 0 comments Download
M chrome/browser/ui/webui/ntp/ntp_user_data_logger.h View 1 2 3 5 chunks +2 lines, -23 lines 0 comments Download
M chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc View 1 2 3 4 5 3 chunks +19 lines, -49 lines 0 comments Download
M chrome/browser/ui/webui/ntp/ntp_user_data_logger_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/common/search/ntp_logging_events.h View 1 chunk +7 lines, -2 lines 0 comments Download

Messages

Total messages: 35 (19 generated)
sfiera
4 years, 5 months ago (2016-07-12 12:20:57 UTC) #9
sfiera
Removed the two failing tests--the thing that they test (SearchTabHelper notifies NTPUserDataLogger directly, without an ...
4 years, 5 months ago (2016-07-12 12:38:13 UTC) #12
Marc Treib
Yay! https://codereview.chromium.org/2141933002/diff/20001/chrome/browser/resources/local_ntp/most_visited_single.js File chrome/browser/resources/local_ntp/most_visited_single.js (right): https://codereview.chromium.org/2141933002/diff/20001/chrome/browser/resources/local_ntp/most_visited_single.js#newcode26 chrome/browser/resources/local_ntp/most_visited_single.js:26: // A NTP Tile has finished loading (successfully ...
4 years, 5 months ago (2016-07-12 12:40:09 UTC) #13
sfiera
https://codereview.chromium.org/2141933002/diff/20001/chrome/browser/resources/local_ntp/most_visited_single.js File chrome/browser/resources/local_ntp/most_visited_single.js (right): https://codereview.chromium.org/2141933002/diff/20001/chrome/browser/resources/local_ntp/most_visited_single.js#newcode26 chrome/browser/resources/local_ntp/most_visited_single.js:26: // A NTP Tile has finished loading (successfully or ...
4 years, 5 months ago (2016-07-12 13:21:21 UTC) #14
Marc Treib
lgtm https://codereview.chromium.org/2141933002/diff/20001/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc File chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc (right): https://codereview.chromium.org/2141933002/diff/20001/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc#newcode109 chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc:109: case NTP_TILE: On 2016/07/12 13:21:21, sfiera wrote: > ...
4 years, 5 months ago (2016-07-12 13:39:01 UTC) #17
sfiera
https://codereview.chromium.org/2141933002/diff/20001/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc File chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc (right): https://codereview.chromium.org/2141933002/diff/20001/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc#newcode109 chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc:109: case NTP_TILE: On 2016/07/12 13:39:01, Marc Treib wrote: > ...
4 years, 5 months ago (2016-07-12 14:10:25 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2141933002/100001
4 years, 5 months ago (2016-07-13 08:10:34 UTC) #25
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 5 months ago (2016-07-13 08:44:14 UTC) #26
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-13 08:44:35 UTC) #27
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/9448453348b63120430d305312fcd894a9ff7f65 Cr-Commit-Position: refs/heads/master@{#405087}
4 years, 5 months ago (2016-07-13 08:47:20 UTC) #29
sfiera
This broke NewTabPage.LoadTime.Startup. I guess the old code caused the NTPUserDataLogger to exist earlier, but ...
4 years, 5 months ago (2016-07-13 13:33:14 UTC) #30
Marc Treib
On 2016/07/13 13:33:14, sfiera wrote: > This broke NewTabPage.LoadTime.Startup. I guess the old code caused ...
4 years, 5 months ago (2016-07-13 13:43:38 UTC) #31
sfiera
On 2016/07/13 13:43:38, Marc Treib wrote: > On 2016/07/13 13:33:14, sfiera wrote: > > This ...
4 years, 5 months ago (2016-07-13 13:49:20 UTC) #32
Marc Treib
On 2016/07/13 13:49:20, sfiera wrote: > On 2016/07/13 13:43:38, Marc Treib wrote: > > On ...
4 years, 5 months ago (2016-07-13 14:00:30 UTC) #33
sfiera
On 2016/07/13 14:00:30, Marc Treib wrote: > On 2016/07/13 13:49:20, sfiera wrote: > > On ...
4 years, 5 months ago (2016-07-13 14:23:16 UTC) #34
Marc Treib
4 years, 5 months ago (2016-07-13 14:28:09 UTC) #35
Message was sent while issue was closed.
On 2016/07/13 14:23:16, sfiera wrote:
> On 2016/07/13 14:00:30, Marc Treib wrote:
> > On 2016/07/13 13:49:20, sfiera wrote:
> > > On 2016/07/13 13:43:38, Marc Treib wrote:
> > > > On 2016/07/13 13:33:14, sfiera wrote:
> > > > > This broke NewTabPage.LoadTime.Startup. I guess the old code caused
the
> > > > > NTPUserDataLogger to exist earlier, but now it's not created until the
> the
> > > NTP
> > > > > JS is already loaded and running, which is considered after startup.
> > > > > 
> > > > > I don't know how to preserve the metric with this situation.
> > > > 
> > > > Hm, so we really need the NTPUserDataLogger instance to be created as
soon
> > as
> > > > the tab is opened. Looks like that would only have worked by accident
> > > before...
> > > > out of curiosity, do you know which of the GetOrCreateFromWebContents
> calls
> > it
> > > > was that created the thing?
> > > 
> > > I think it would have to have been the most-visited-items-changed hook
(the
> > only
> > > other external one being tab-deactivated).
> > > 
> > > > Anyway, can't we just create the thing from, say,
> > > > SearchTabHelper::OnTabActivated?
> > > 
> > > I'll give it a try. That would have the side-effect of creating it on tabs
> > that
> > > will never have an NTP (URL opened in new tab), which eats just a little
> more
> > > memory...
> > 
> > Also, NTPUserDataLogger currently still relies on only being called for
actual
> > NTPs, right?
> 
> Hmm. There will still be things that "shouldn't happen" if it is called for a
> non-NTP. For example, we'll pick up the initial page as "ntp_url_" and reset
our
> stats whenever the user navigates back to that page. On the other hand,
nothing
> outside the NTP JS is able to trigger those stats to be logged anymore, so
none
> of the bad behavior will be observable.
> 
> Somehow, we must know whether a tab is being created as an NTP tab or not,
> right?

Check the URL, I guess (if any of the "IsNTP" functions actually does what we
need)? I vaguely remember seeing code somewhere that essentially did
OpenTab("chrome://newtab"), so I don't think there's anything much nicer.

Powered by Google App Engine
This is Rietveld 408576698