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

Issue 1733008: Delete and recreate the sync database if it is corrupt. (Closed)

Created:
10 years, 8 months ago by albertb
Modified:
9 years, 3 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., ncarter (slow), ben+cc_chromium.org, tim (not reviewing), idana
Visibility:
Public.

Description

Delete and recreate the sync database if it is corrupt. BUG=40020 TEST=DirectoryBackingStoreTest.Corruption Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=45712

Patch Set 1 #

Patch Set 2 : Close the sqlite db before deleting it #

Patch Set 3 : Remove the tabs visual studio helpfully added #

Total comments: 2

Patch Set 4 : Use scoped_sqlite_db_ptr #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -4 lines) Patch
M chrome/browser/sync/syncable/directory_backing_store.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/sync/syncable/directory_backing_store.cc View 1 2 3 5 chunks +15 lines, -3 lines 2 comments Download
M chrome/browser/sync/syncable/directory_backing_store_unittest.cc View 1 2 2 chunks +24 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
albertb
Lei/Tim, I added some tests to Lei's patch (http://codereview.chromium.org/1711006). I don't really like the EXPECT_DEATH ...
10 years, 8 months ago (2010-04-21 22:37:13 UTC) #1
Lei Zhang
LGTM
10 years, 8 months ago (2010-04-21 22:45:23 UTC) #2
albertb
Lei/Tim, It looks like the patch was flaky on XP because the DBS still held ...
10 years, 8 months ago (2010-04-22 19:42:27 UTC) #3
albertb
Ping?
10 years, 8 months ago (2010-04-26 17:38:53 UTC) #4
tim (not reviewing)
http://codereview.chromium.org/1733008/diff/11001/12001 File chrome/browser/sync/syncable/directory_backing_store.cc (right): http://codereview.chromium.org/1733008/diff/11001/12001#newcode188 chrome/browser/sync/syncable/directory_backing_store.cc:188: sqlite3_close(*handle); can we use sqlite_utils::scoped_sqlite_db_ptr in sqlite_utils.h?
10 years, 8 months ago (2010-04-26 18:06:58 UTC) #5
albertb
http://codereview.chromium.org/1733008/diff/11001/12001 File chrome/browser/sync/syncable/directory_backing_store.cc (right): http://codereview.chromium.org/1733008/diff/11001/12001#newcode188 chrome/browser/sync/syncable/directory_backing_store.cc:188: sqlite3_close(*handle); On 2010/04/26 18:06:58, timsteele wrote: > can we ...
10 years, 8 months ago (2010-04-26 21:30:29 UTC) #6
tim (not reviewing)
LGTM w/ one question http://codereview.chromium.org/1733008/diff/17001/18001 File chrome/browser/sync/syncable/directory_backing_store.cc (right): http://codereview.chromium.org/1733008/diff/17001/18001#newcode211 chrome/browser/sync/syncable/directory_backing_store.cc:211: scoped_handle.release(); this is necessary?
10 years, 8 months ago (2010-04-27 14:25:03 UTC) #7
albertb
10 years, 8 months ago (2010-04-27 15:05:41 UTC) #8
http://codereview.chromium.org/1733008/diff/17001/18001
File chrome/browser/sync/syncable/directory_backing_store.cc (right):

http://codereview.chromium.org/1733008/diff/17001/18001#newcode211
chrome/browser/sync/syncable/directory_backing_store.cc:211:
scoped_handle.release();
On 2010/04/27 14:25:03, timsteele wrote:
> this is necessary?

Yes. If the scoped ptr holds a valid db handle, it calls sqlite3_close when it
goes out of scope.

Powered by Google App Engine
This is Rietveld 408576698