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

Issue 2948008: Fix missing thumbnails for new profile with TopSites. (Closed)

Created:
10 years, 5 months ago by Nik Shkrob
Modified:
9 years, 7 months ago
Reviewers:
brettw
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

Fix missing thumbnails for new profile with TopSites. Store a map of temporary thumbnails for unknown URLs. Also, remove accesses to thumbnail DB after the migration to TopSites. TEST=TopSitesTest BUG=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=52915

Patch Set 1 #

Patch Set 2 : Comments. #

Total comments: 6

Patch Set 3 : Reviewed. #

Patch Set 4 : After second review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -19 lines) Patch
M chrome/browser/history/history.h View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/history/history.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/history/thumbnail_database.h View 1 chunk +4 lines, -0 lines 0 comments Download
chrome/browser/history/thumbnail_database.cc View 1 2 10 chunks +29 lines, -3 lines 0 comments Download
chrome/browser/history/top_sites.h View 3 chunks +12 lines, -0 lines 0 comments Download
chrome/browser/history/top_sites.cc View 1 2 3 6 chunks +47 lines, -6 lines 0 comments Download
chrome/browser/history/top_sites_database.cc View 3 chunks +5 lines, -2 lines 0 comments Download
chrome/browser/history/top_sites_unittest.cc View 3 chunks +46 lines, -3 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Nik Shkrob
Please review.
10 years, 5 months ago (2010-07-13 16:47:45 UTC) #1
brettw
http://codereview.chromium.org/2948008/diff/2001/3003 File chrome/browser/history/thumbnail_database.cc (right): http://codereview.chromium.org/2948008/diff/2001/3003#newcode148 chrome/browser/history/thumbnail_database.cc:148: return true; // Not needed after migration to TopSites. ...
10 years, 5 months ago (2010-07-13 17:33:43 UTC) #2
Nik Shkrob
http://codereview.chromium.org/2948008/diff/2001/3003 File chrome/browser/history/thumbnail_database.cc (right): http://codereview.chromium.org/2948008/diff/2001/3003#newcode148 chrome/browser/history/thumbnail_database.cc:148: return true; // Not needed after migration to TopSites. ...
10 years, 5 months ago (2010-07-13 18:12:12 UTC) #3
brettw
10 years, 5 months ago (2010-07-13 18:19:45 UTC) #4
On Tue, Jul 13, 2010 at 11:12 AM,  <nshkrob@chromium.org> wrote:
>
> http://codereview.chromium.org/2948008/diff/2001/3003
> File chrome/browser/history/thumbnail_database.cc (right):
>
> http://codereview.chromium.org/2948008/diff/2001/3003#newcode148
> chrome/browser/history/thumbnail_database.cc:148: return true;  // Not
> needed after migration to TopSites.
> On 2010/07/13 17:33:43, brettw wrote:
>>
>> Do you still want to set the version number in this case? I wonder if
>
> a better
>>
>> approach to checking if the thumbnails table exists for each function
>
> call would
>>
>> be to set some local var in the class during init that's based on the
>
> version
>>
>> number. Then each function won't have to compile & execute a separate
>
> SQL
>>
>> statement to see if they should return early.
>
> Done.
>
> http://codereview.chromium.org/2948008/diff/2001/3004
> File chrome/browser/history/top_sites.cc (right):
>
> http://codereview.chromium.org/2948008/diff/2001/3004#newcode93
> chrome/browser/history/top_sites.cc:93: if(top_sites_.size() <
> kTopSitesNumber) {
> On 2010/07/13 17:33:43, brettw wrote:
>>
>> Style: Need space after "if".
>
> Done.
>
> http://codereview.chromium.org/2948008/diff/2001/3004#newcode332
> chrome/browser/history/top_sites.cc:332: if (GetCanonicalURL(mv.url) ==
> GetCanonicalURL(it->first)) {
> On 2010/07/13 17:33:43, brettw wrote:
>>
>> Wait, can't we use temp_thumbnails_map_.find(GetCanonicalURL(mv.url))
>
> to avoid
>>
>> iterating through every item in the map?
>
> No, because temp_thumbnails_map_ has non-canonical URLs. When we add a
> temp URL, we don't have the redirect chain yet.
> This is not very efficient, but temp_thumbnails_map_ should contain very
> few elements anyways.

I see. Can you add a comment to this effect. How about also computing
the canonical version of mv.url outside the inner loop so you don't
have to recompute it every time.

LGTM with this.

Brett

Powered by Google App Engine
This is Rietveld 408576698