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

Issue 560543002: [Top Sites] Encoding redirects field in TopSitesDatabase, and adding validations (Closed)

Created:
6 years, 3 months ago by huangs
Modified:
5 years, 9 months ago
CC:
chromium-reviews, browser-components-watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

[Top Sites] Encoding redirects field in TopSitesDatabase, and adding validations Previously the redirects field in TopSitesDatabase was encoded as a space-seprated list of URLs. Problem arises when data URLs such as "data:text/plain,this text has space" gets added. When decoded, non-URLs like "text" and "has" trigger DCHECK in URL() downstream, thereby crashing debug Chrome. In this CL we encode the redirects field as comma separated values (strings). For decoding, we keeping old space-delimited list as fallback. We are also migrating Top Sites database from v3 to v4. BUG=358034

Patch Set 1 #

Total comments: 16

Patch Set 2 : Setting database to v4, adding migration code. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+462 lines, -80 lines) Patch
M chrome/browser/history/top_sites_database.h View 1 3 chunks +30 lines, -2 lines 0 comments Download
M chrome/browser/history/top_sites_database.cc View 1 12 chunks +160 lines, -26 lines 0 comments Download
M chrome/browser/history/top_sites_database_unittest.cc View 1 10 chunks +263 lines, -43 lines 0 comments Download
M chrome/test/data/History/TopSites.v3.sql View 1 1 chunk +2 lines, -2 lines 0 comments Download
A + chrome/test/data/History/TopSites.v4.sql View 1 1 chunk +7 lines, -7 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
huangs
PTAL.
6 years, 3 months ago (2014-09-09 20:03:33 UTC) #2
huangs
+shess@, PTAL.
6 years, 3 months ago (2014-09-09 20:52:03 UTC) #4
beaudoin
https://codereview.chromium.org/560543002/diff/1/chrome/browser/history/top_sites_database.cc File chrome/browser/history/top_sites_database.cc (right): https://codereview.chromium.org/560543002/diff/1/chrome/browser/history/top_sites_database.cc#newcode61 chrome/browser/history/top_sites_database.cc:61: static const int kVersionNumber = 3; Aren't you changing ...
6 years, 3 months ago (2014-09-09 21:32:27 UTC) #5
Scott Hess - ex-Googler
I agree with the comment about bumping the version number and doing a migration. With ...
6 years, 3 months ago (2014-09-10 19:33:42 UTC) #6
huangs
This is a progress update. Notes: - The Recovery4 test does not work. The test ...
6 years, 3 months ago (2014-09-11 01:58:14 UTC) #7
huangs
5 years, 9 months ago (2015-03-06 18:48:05 UTC) #8
Abandoning this CL, since the main bug was fixed (imperfect solution but at
least no crashing), and proposed CSV method is not gaining support.

Powered by Google App Engine
This is Rietveld 408576698