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

Issue 1129383003: Adds support for multiple thumbnail files on Single iframe NTP, fallback to the best one that opens. (Closed)

Created:
5 years, 7 months ago by fserb
Modified:
5 years, 7 months ago
Reviewers:
Mathieu, beaudoin, huangs
CC:
chromium-reviews, skanuj+watch_chromium.org, melevin+watch_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
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adds support for multiple thumbnail files on Single iframe NTP, fallback to the best one that opens. BUG=486879 Committed: https://crrev.com/bbdef2a03b74719929213b97f032077374806eca Cr-Commit-Position: refs/heads/master@{#329261}

Patch Set 1 #

Total comments: 20

Patch Set 2 : #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -18 lines) Patch
M chrome/browser/resources/local_ntp/most_visited_single.js View 1 3 chunks +85 lines, -18 lines 12 comments Download

Messages

Total messages: 15 (4 generated)
Mathieu
lgtm, mostly comments about lack of comments :) https://codereview.chromium.org/1129383003/diff/1/chrome/browser/resources/local_ntp/most_visited_single.js File chrome/browser/resources/local_ntp/most_visited_single.js (right): https://codereview.chromium.org/1129383003/diff/1/chrome/browser/resources/local_ntp/most_visited_single.js#newcode385 chrome/browser/resources/local_ntp/most_visited_single.js:385: nit: ...
5 years, 7 months ago (2015-05-11 20:27:24 UTC) #3
Mathieu
https://codereview.chromium.org/1129383003/diff/1/chrome/browser/resources/local_ntp/most_visited_single.js File chrome/browser/resources/local_ntp/most_visited_single.js (right): https://codereview.chromium.org/1129383003/diff/1/chrome/browser/resources/local_ntp/most_visited_single.js#newcode424 chrome/browser/resources/local_ntp/most_visited_single.js:424: i.src = data.thumbnailUrl[t]; does it completely poop out if ...
5 years, 7 months ago (2015-05-11 20:28:59 UTC) #4
huangs
Comments on variable names. https://chromiumcodereview.appspot.com/1129383003/diff/1/chrome/browser/resources/local_ntp/most_visited_single.js File chrome/browser/resources/local_ntp/most_visited_single.js (right): https://chromiumcodereview.appspot.com/1129383003/diff/1/chrome/browser/resources/local_ntp/most_visited_single.js#newcode281 chrome/browser/resources/local_ntp/most_visited_single.js:281: data.thumbnailUrl = [data.thumbnailUrl]; This is ...
5 years, 7 months ago (2015-05-11 20:31:16 UTC) #5
fserb
https://codereview.chromium.org/1129383003/diff/1/chrome/browser/resources/local_ntp/most_visited_single.js File chrome/browser/resources/local_ntp/most_visited_single.js (right): https://codereview.chromium.org/1129383003/diff/1/chrome/browser/resources/local_ntp/most_visited_single.js#newcode281 chrome/browser/resources/local_ntp/most_visited_single.js:281: data.thumbnailUrl = [data.thumbnailUrl]; On 2015/05/11 20:31:16, huangs wrote: > ...
5 years, 7 months ago (2015-05-11 20:39:57 UTC) #6
huangs
Questions about the flow. https://chromiumcodereview.appspot.com/1129383003/diff/20001/chrome/browser/resources/local_ntp/most_visited_single.js File chrome/browser/resources/local_ntp/most_visited_single.js (right): https://chromiumcodereview.appspot.com/1129383003/diff/20001/chrome/browser/resources/local_ntp/most_visited_single.js#newcode372 chrome/browser/resources/local_ntp/most_visited_single.js:372: img.addEventListener('error', countLoad); Remove this, and ...
5 years, 7 months ago (2015-05-11 21:07:30 UTC) #7
huangs
More comments. https://chromiumcodereview.appspot.com/1129383003/diff/20001/chrome/browser/resources/local_ntp/most_visited_single.js File chrome/browser/resources/local_ntp/most_visited_single.js (right): https://chromiumcodereview.appspot.com/1129383003/diff/20001/chrome/browser/resources/local_ntp/most_visited_single.js#newcode278 chrome/browser/resources/local_ntp/most_visited_single.js:278: if (args.rid) { Should there be some ...
5 years, 7 months ago (2015-05-11 21:27:11 UTC) #8
huangs
LGTM.
5 years, 7 months ago (2015-05-11 21:28:29 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1129383003/20001
5 years, 7 months ago (2015-05-11 21:56:05 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 7 months ago (2015-05-11 22:44:03 UTC) #13
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/bbdef2a03b74719929213b97f032077374806eca Cr-Commit-Position: refs/heads/master@{#329261}
5 years, 7 months ago (2015-05-11 22:44:48 UTC) #14
fserb
5 years, 7 months ago (2015-05-19 19:02:15 UTC) #15
Message was sent while issue was closed.
https://codereview.chromium.org/1129383003/diff/20001/chrome/browser/resource...
File chrome/browser/resources/local_ntp/most_visited_single.js (right):

https://codereview.chromium.org/1129383003/diff/20001/chrome/browser/resource...
chrome/browser/resources/local_ntp/most_visited_single.js:278: if (args.rid) {
On 2015/05/11 21:27:11, huangs wrote:
> Should there be some code to allow server NTP to populate more items into
> data.thumbnailUrls?

Acknowledged.

https://codereview.chromium.org/1129383003/diff/20001/chrome/browser/resource...
chrome/browser/resources/local_ntp/most_visited_single.js:372:
img.addEventListener('error', countLoad);
On 2015/05/11 21:07:30, huangs wrote:
> Remove this, and just call countLoad() from within the handler?

Acknowledged.

https://codereview.chromium.org/1129383003/diff/20001/chrome/browser/resource...
chrome/browser/resources/local_ntp/most_visited_single.js:397: var loadBestImage
= function() {
On 2015/05/11 21:07:30, huangs wrote:
> It seems the first image loaded will just dominate, so if there are multiple
> successes then we'd have a race condition?

Acknowledged.

https://codereview.chromium.org/1129383003/diff/20001/chrome/browser/resource...
chrome/browser/resources/local_ntp/most_visited_single.js:397: var loadBestImage
= function() {
On 2015/05/11 21:27:11, huangs wrote:
> Ah NVM; the "null" ensures first best image gets loaded.

Acknowledged.

https://codereview.chromium.org/1129383003/diff/20001/chrome/browser/resource...
chrome/browser/resources/local_ntp/most_visited_single.js:416: var acceptImage =
function(idx, url) {
On 2015/05/11 21:27:11, huangs wrote:
> I'd suggest removing acceptImage() and rejectImage(), but have
> 
> var loadBestImage = function(idx, value) {
>   results[idx] = value;
>   ...
> };
> 
> then later, have
> 
> image.onload = loadBestImage.bind(loadBestImage, i, data.thumbnailUrls[i]);
> image.onerror = loadBestImage.bind(loadBestImage, i, null);
> 
> and for the "else" case have
> loadBestImage(i, null);

Done.

https://codereview.chromium.org/1129383003/diff/20001/chrome/browser/resource...
chrome/browser/resources/local_ntp/most_visited_single.js:450:
img.addEventListener('error', countLoad);
On 2015/05/11 21:07:30, huangs wrote:
> Remove this, and just call countLoad() from within the handler?

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698