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

Issue 600104: Actually delete databases in CookiesTreeModel. (Closed)

Created:
10 years, 10 months ago by jochen (gone - plz use gerrit)
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, darin+cc_chromium.org, Paweł Hajdan Jr., ben+cc_chromium.org, John Grabowski, amit, brettw+cc_chromium.org, fbarchard, Alpha Left Google, Erik does not do reviews, jam, stuartmorgan, tim (not reviewing), Paul Godavari, ncarter (slow), dpranke+watch_chromium.org, pam+watch_chromium.org, awong, Timur Iskhodzhanov, scherkus (not reviewing), not_the_right_glider, idana, dank, Aaron Boodman
Visibility:
Public.

Description

Actually delete databases in CookiesTreeModel. BUG=34633 TEST=delete a database while it's opened in the renderer Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=39346

Patch Set 1 #

Total comments: 20

Patch Set 2 : public for testshell #

Total comments: 22

Patch Set 3 : update #

Total comments: 6

Patch Set 4 : add unittests #

Patch Set 5 : updates #

Patch Set 6 : use a filehandle instead of filename #

Patch Set 7 : convert BOOl to bool... #

Total comments: 10

Patch Set 8 : fixed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+296 lines, -80 lines) Patch
M base/file_util.h View 4 5 6 7 2 chunks +4 lines, -1 line 0 comments Download
M base/file_util_posix.cc View 3 chunks +9 lines, -1 line 0 comments Download
M base/file_util_unittest.cc View 4 5 6 7 2 chunks +25 lines, -1 line 0 comments Download
M base/file_util_win.cc View 4 5 6 2 chunks +11 lines, -1 line 0 comments Download
M base/time.h View 3 chunks +9 lines, -1 line 0 comments Download
M base/time_posix.cc View 2 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/browsing_data_database_helper.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/browsing_data_database_helper.cc View 1 2 4 chunks +7 lines, -8 lines 0 comments Download
M chrome/browser/cookies_tree_model.cc View 1 2 5 chunks +13 lines, -6 lines 0 comments Download
M chrome/browser/cookies_tree_model_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/views/options/cookies_view.cc View 1 chunk +3 lines, -7 lines 0 comments Download
M webkit/database/database_tracker.h View 1 2 3 7 chunks +27 lines, -17 lines 0 comments Download
M webkit/database/database_tracker.cc View 1 2 3 4 5 6 7 7 chunks +72 lines, -31 lines 0 comments Download
M webkit/database/database_tracker_unittest.cc View 1 2 3 4 5 6 7 5 chunks +103 lines, -3 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
jochen (gone - plz use gerrit)
please review. besides connecting the browsing data database helper to the database tracker this also ...
10 years, 10 months ago (2010-02-12 20:10:54 UTC) #1
jochen (gone - plz use gerrit)
I need to wait until tryservers catch the correct revision... will restart tryjobs then. On ...
10 years, 10 months ago (2010-02-12 20:13:33 UTC) #2
michaeln
sweet :) http://codereview.chromium.org/600104/diff/1/2 File chrome/browser/browsing_data_database_helper.cc (right): http://codereview.chromium.org/600104/diff/1/2#newcode106 chrome/browser/browsing_data_database_helper.cc:106: scoped_refptr<webkit_database::DatabaseTracker> tracker_; why take a reference here? ...
10 years, 10 months ago (2010-02-12 21:01:25 UTC) #3
jochen (gone - plz use gerrit)
some replies... I'm boarding now. http://codereview.chromium.org/600104/diff/1/2 File chrome/browser/browsing_data_database_helper.cc (right): http://codereview.chromium.org/600104/diff/1/2#newcode106 chrome/browser/browsing_data_database_helper.cc:106: scoped_refptr<webkit_database::DatabaseTracker> tracker_; So the ...
10 years, 10 months ago (2010-02-12 21:09:56 UTC) #4
michaeln
> So the tracker doesn't get deleted before it notified us. Maybe not necessary? Don't ...
10 years, 10 months ago (2010-02-12 21:21:17 UTC) #5
Peter Kasting
I'm not really qualified to review the substance of this; that said, it looked sane ...
10 years, 10 months ago (2010-02-12 21:22:39 UTC) #6
dumi
http://codereview.chromium.org/600104/diff/10/1010 File chrome/browser/browsing_data_database_helper.cc (right): http://codereview.chromium.org/600104/diff/10/1010#newcode119 chrome/browser/browsing_data_database_helper.cc:119: callback) != net::ERR_IO_PENDING) should use {} here, since the ...
10 years, 10 months ago (2010-02-12 21:40:27 UTC) #7
Peter Kasting
http://codereview.chromium.org/600104/diff/10/1010 File chrome/browser/browsing_data_database_helper.cc (right): http://codereview.chromium.org/600104/diff/10/1010#newcode119 chrome/browser/browsing_data_database_helper.cc:119: callback) != net::ERR_IO_PENDING) On 2010/02/12 21:40:27, dumi wrote: > ...
10 years, 10 months ago (2010-02-12 21:41:57 UTC) #8
dumi
http://codereview.chromium.org/600104/diff/10/1016 File webkit/database/database_tracker.h (right): http://codereview.chromium.org/600104/diff/10/1016#newcode179 webkit/database/database_tracker.h:179: bool DeleteOrigin(const string16& origin_identifier); forgot to mention that we ...
10 years, 10 months ago (2010-02-12 21:43:14 UTC) #9
jochen (gone - plz use gerrit)
http://codereview.chromium.org/600104/diff/1/2 File chrome/browser/browsing_data_database_helper.cc (right): http://codereview.chromium.org/600104/diff/1/2#newcode106 chrome/browser/browsing_data_database_helper.cc:106: scoped_refptr<webkit_database::DatabaseTracker> tracker_; I removed this callback and allow a ...
10 years, 10 months ago (2010-02-15 16:40:12 UTC) #10
michaeln
http://codereview.chromium.org/600104/diff/2005/3008 File webkit/database/database_tracker.cc (right): http://codereview.chromium.org/600104/diff/2005/3008#newcode111 webkit/database/database_tracker.cc:111: std::set<net::CompletionCallback*> to_be_deleted; i'd have used a std::vector<> here... std::vector<> ...
10 years, 10 months ago (2010-02-15 21:18:08 UTC) #11
michaeln
Also, I think the original intent behind DeleteOrigin() was to hook that up to a ...
10 years, 10 months ago (2010-02-15 21:38:10 UTC) #12
jochen (gone - plz use gerrit)
On 2010/02/15 21:38:10, michaeln wrote: > Also, I think the original intent behind DeleteOrigin() was ...
10 years, 10 months ago (2010-02-15 21:55:38 UTC) #13
Peter Kasting
http://codereview.chromium.org/600104/diff/10/1015 File webkit/database/database_tracker.cc (right): http://codereview.chromium.org/600104/diff/10/1015#newcode111 webkit/database/database_tracker.cc:111: PendingCompletionMap::iterator callback = deletion_callbacks_.begin(); On 2010/02/15 16:40:15, jochen wrote: ...
10 years, 10 months ago (2010-02-15 22:28:30 UTC) #14
michaeln
> > 1) What does happen on that ui gesture? Does that end up calling ...
10 years, 10 months ago (2010-02-16 00:59:39 UTC) #15
dumi
On 2010/02/15 21:55:38, jochen wrote: > On 2010/02/15 21:38:10, michaeln wrote: > > Also, I ...
10 years, 10 months ago (2010-02-16 20:15:39 UTC) #16
jochen (gone - plz use gerrit)
ping
10 years, 10 months ago (2010-02-17 19:19:08 UTC) #17
michaeln
10 years, 10 months ago (2010-02-17 19:41:23 UTC) #18
LGTM, modulo try happiness a few very minor things to look at

http://codereview.chromium.org/600104/diff/13001/14001
File base/file_util.h (right):

http://codereview.chromium.org/600104/diff/13001/14001#newcode333
base/file_util.h:333: bool GetFileInfo(const std::wstring& file_path, FileInfo*
info);
style: probably should add a blank line here (when in rome rule)

http://codereview.chromium.org/600104/diff/13001/14003
File base/file_util_unittest.cc (right):

http://codereview.chromium.org/600104/diff/13001/14003#newcode1406
base/file_util_unittest.cc:1406: // Observe that this timestamp is divisible by
two (seconds) - FAT stores
Maybe 'Note' instead of 'Observe', when i read this comment i was expecting the
test code to make that observation before understanding that it was a note to
the reader :)

http://codereview.chromium.org/600104/diff/13001/14012
File webkit/database/database_tracker.cc (left):

http://codereview.chromium.org/600104/diff/13001/14012#oldcode196
webkit/database/database_tracker.cc:196: // TODO(jochen): Delete journal files
associated with this database.
please keep the TODO about journal files here, you can put my name in it if you
like

http://codereview.chromium.org/600104/diff/13001/14012
File webkit/database/database_tracker.cc (right):

http://codereview.chromium.org/600104/diff/13001/14012#newcode110
webkit/database/database_tracker.cc:110:
dbs_to_be_deleted_.erase(origin_identifier);
maybe a blank line here to separate the completion callback logic from the other
logic

http://codereview.chromium.org/600104/diff/13001/14012#newcode119
webkit/database/database_tracker.cc:119:
callback->second.erase(origin_identifier);
i think you could call erase(dbiter) here to avoid searching again, although, it
is more clear what's going on by saying erase(origin)

maybe dbiter could use a better name, 'found_ori' ?

http://codereview.chromium.org/600104/diff/13001/14012#newcode459
webkit/database/database_tracker.cc:459:
to_be_deleted[*ori].insert(db->database_name);
style: since these if and else clause are both one-liners, these should not have
brackets

http://codereview.chromium.org/600104/diff/13001/14012#newcode470
webkit/database/database_tracker.cc:470: ori != to_be_deleted.end(); ++ori)
style: this for loop body should have brackets

http://codereview.chromium.org/600104/diff/13001/14014
File webkit/database/database_tracker_unittest.cc (right):

http://codereview.chromium.org/600104/diff/13001/14014#newcode75
webkit/database/database_tracker_unittest.cc:75: TEST(DatabaseTrackerTest,
DeleteOpenDatabase) {
thnx for a adding the tests

http://codereview.chromium.org/600104/diff/13001/14014#newcode117
webkit/database/database_tracker_unittest.cc:117: EXPECT_EQ(net::ERR_IO_PENDING,
result);
maybe assert that the callback has not yet been invoked?

http://codereview.chromium.org/600104/diff/13001/14014#newcode136
webkit/database/database_tracker_unittest.cc:136: 
nit: there's an extra blank line here that can be removed

Powered by Google App Engine
This is Rietveld 408576698