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

Issue 9371008: Nuke from orbit corrupt websql databases. (Closed)

Created:
8 years, 10 months ago by michaeln
Modified:
8 years, 10 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

Nuke from orbit corrupt websql databases. BUG=98939 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=122651

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 11

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+164 lines, -8 lines) Patch
M content/browser/renderer_host/database_message_filter.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/renderer_host/database_message_filter.cc View 1 2 3 3 chunks +9 lines, -1 line 0 comments Download
M content/common/database_messages.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M content/common/web_database_observer_impl.h View 1 2 3 1 chunk +8 lines, -6 lines 0 comments Download
M content/common/web_database_observer_impl.cc View 1 2 3 7 chunks +20 lines, -0 lines 0 comments Download
M webkit/database/database_tracker.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M webkit/database/database_tracker.cc View 1 2 3 2 chunks +19 lines, -0 lines 0 comments Download
M webkit/database/database_tracker_unittest.cc View 1 2 3 6 chunks +96 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
michaeln
ptal
8 years, 10 months ago (2012-02-10 00:30:12 UTC) #1
Scott Hess - ex-Googler
http://codereview.chromium.org/9371008/diff/2004/content/common/web_database_observer_impl.cc File content/common/web_database_observer_impl.cc (right): http://codereview.chromium.org/9371008/diff/2004/content/common/web_database_observer_impl.cc#newcode155 content/common/web_database_observer_impl.cc:155: const WebDatabase& database, int error) { Do you have ...
8 years, 10 months ago (2012-02-10 23:34:07 UTC) #2
michaeln
https://chromiumcodereview.appspot.com/9371008/diff/2004/content/common/web_database_observer_impl.cc File content/common/web_database_observer_impl.cc (right): https://chromiumcodereview.appspot.com/9371008/diff/2004/content/common/web_database_observer_impl.cc#newcode155 content/common/web_database_observer_impl.cc:155: const WebDatabase& database, int error) { On 2012/02/10 23:34:07, ...
8 years, 10 months ago (2012-02-11 00:34:20 UTC) #3
Scott Hess - ex-Googler
8 years, 10 months ago (2012-02-11 19:48:23 UTC) #4
LGTM, but as noted, I'm not completely convinced about using a generic-sounding
callback which only receives a fraction of the errors.

https://chromiumcodereview.appspot.com/9371008/diff/2004/content/common/web_d...
File content/common/web_database_observer_impl.cc (right):

https://chromiumcodereview.appspot.com/9371008/diff/2004/content/common/web_d...
content/common/web_database_observer_impl.cc:155: const WebDatabase& database,
int error) {
On 2012/02/11 00:34:20, michaeln wrote:
> On 2012/02/10 23:34:07, shess wrote:
> > Do you have a histogram out there to tell the relative occurrence of errors?

> If
> > not, this would be a great place to land one...
> 
> Yes, see histograms scattered in this file.

<decoding> surprisingly few SQLITE_CORRUPT cases!  I wonder how SQLITE_CANTOPEN
is coming into play, here...

https://chromiumcodereview.appspot.com/9371008/diff/2004/webkit/database/data...
File webkit/database/database_tracker.cc (right):

https://chromiumcodereview.appspot.com/9371008/diff/2004/webkit/database/data...
webkit/database/database_tracker.cc:193: if (error == SQLITE_CORRUPT || error ==
SQLITE_NOTADB) {
On 2012/02/11 00:34:20, michaeln wrote:
> On 2012/02/10 23:34:07, shess wrote:
> > The sender also has this guard.  It is definitely needed here, but maybe it
> > would make sense to not have the check in the sender (forward all errors,
and
> > let the policy decision be made in one place).
> 
> That could be, but i'm avoiding necessary messaging with the test in the
> renderer. This stuff is called per statement in the renderer.

OK.  In that case, perhaps document that this is security filtering but
otherwise redundant, so that someone doesn't accidentally expect to see other
errors, here.  I'm mixed as to whether that would be better as else
{NOTREACHED();} though.

Another option might be to forward only for error != SQLITE_OK.

Can the client schedule deletes already?  It might make sense to just have the
client do it, then.

https://chromiumcodereview.appspot.com/9371008/diff/2004/webkit/database/data...
File webkit/database/database_tracker_unittest.cc (right):

https://chromiumcodereview.appspot.com/9371008/diff/2004/webkit/database/data...
webkit/database/database_tracker_unittest.cc:904:
tracker->RemoveObserver(&observer);
On 2012/02/11 00:34:20, michaeln wrote:
> On 2012/02/10 23:34:07, shess wrote:
> > Any possibility of an end-to-end test, where you create an actual database
and
> > allow a query against it to cause everything to work?
> 
> An end-to-end test is probably doable as a ui test or a browser test, but i
> haven't put that together such a framework.  I'm doing local testing for now.

Makes sense.

Powered by Google App Engine
This is Rietveld 408576698