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

Issue 8533013: SessionRestore: Store session cookies and restore them if chrome crashes or auto-restarts. (Closed)

Created:
9 years, 1 month ago by marja
Modified:
9 years ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, erikwright (departed), wtc, Randy Smith (Not in Mondays), darin-cc_chromium.org, rkn
Visibility:
Public.

Description

Store session cookies and restore them if chrome crashes or autorestarts. The feature is behind a command line flag --enable-restore-session-state. BUG=1870 TEST=CookieMonsterTest.PersistSessionCookies, SQLitePersistentCookieStoreTest.Test(Dont)?LoadOldSessionCookies, SQLitePersistentCookieStoreTest.PersistHasExpiresAndIsPersistent Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=112970

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Total comments: 4

Patch Set 4 : Fix: restore only after restart / crash. #

Patch Set 5 : Use CookieMonster for storing the session cookies. #

Patch Set 6 : Refactoring + threading fixes. #

Patch Set 7 : Cleanup. #

Patch Set 8 : Fix: forget session cookies when needed. #

Patch Set 9 : Adding callbacks. #

Patch Set 10 : Restore session cookies before creating windows and tabs. #

Patch Set 11 : Threading oops. #

Patch Set 12 : CookieMonster::MergeSessionCookies. #

Patch Set 13 : Fix: only restore when the user clicks restore. #

Patch Set 14 : Cleanup. #

Total comments: 2

Patch Set 15 : New approach: CookieMonster has another SQLitePersistentCookieStore for session cookies. #

Patch Set 16 : . #

Patch Set 17 : . #

Patch Set 18 : . #

Patch Set 19 : Build fixes for tests. #

Patch Set 20 : Updated and added tests. #

Patch Set 21 : New approach again: store all cookies into the same SQLitePersistentCookieStore. #

Patch Set 22 : . #

Patch Set 23 : . #

Patch Set 24 : Fix: make sure cookie db is initialized when we need to clear session cookies. #

Patch Set 25 : restore / discard old session cookies. #

Patch Set 26 : no command line flag -> no-op. #

Patch Set 27 : InfoBar kludge. #

Patch Set 28 : . #

Patch Set 29 : . #

Total comments: 12

Patch Set 30 : Code review comments. #

Patch Set 31 : . #

Patch Set 32 : Fix (store initalization + session cookie deletion order) #

Patch Set 33 : . #

Patch Set 34 : . #

Patch Set 35 : . #

Total comments: 24

Patch Set 36 : Code review comments (the easy ones). #

Patch Set 37 : Change of approach: always restore after a crash, don't wait for infobar. #

Patch Set 38 : Cleanup. #

Patch Set 39 : Simplifying. #

Patch Set 40 : . #

Patch Set 41 : . #

Total comments: 10

Patch Set 42 : Code review + build fixes. #

Patch Set 43 : Code review comments + tests. #

Patch Set 44 : More tests. #

Patch Set 45 : Rebased. #

Total comments: 6

Patch Set 46 : Code review. #

Total comments: 2

Patch Set 47 : More tests. #

Patch Set 48 : Tiny style fix. #

Patch Set 49 : Test fix (tiny). #

Total comments: 2

Patch Set 50 : Code review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+376 lines, -36 lines) Patch
M chrome/browser/fast_shutdown_uitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/net/sqlite_persistent_cookie_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/net/sqlite_persistent_cookie_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 12 chunks +77 lines, -18 lines 0 comments Download
M chrome/browser/net/sqlite_persistent_cookie_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 5 chunks +164 lines, -4 lines 0 comments Download
M chrome/browser/profiles/profile.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 6 chunks +28 lines, -2 lines 0 comments Download
M chrome/browser/profiles/profile_impl_io_data.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/profiles/profile_impl_io_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 4 chunks +11 lines, -4 lines 0 comments Download
M chrome/browser/ui/browser_list.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 3 chunks +10 lines, -0 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 1 chunk +4 lines, -0 lines 0 comments Download
M net/base/cookie_monster.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 2 chunks +9 lines, -0 lines 0 comments Download
M net/base/cookie_monster.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 6 chunks +21 lines, -5 lines 0 comments Download
M net/base/cookie_monster_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 1 chunk +38 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
marja
Hi Jochen, Does this approach look ok & is this going to the right direction? ...
9 years, 1 month ago (2011-11-15 09:23:14 UTC) #1
jochen (gone - plz use gerrit)
On 2011/11/15 09:23:14, marja wrote: > Hi Jochen, > > Does this approach look ok ...
9 years, 1 month ago (2011-11-15 10:42:05 UTC) #2
jochen (gone - plz use gerrit)
http://codereview.chromium.org/8533013/diff/8/chrome/browser/sessions/session_service.cc File chrome/browser/sessions/session_service.cc (right): http://codereview.chromium.org/8533013/diff/8/chrome/browser/sessions/session_service.cc#newcode1189 chrome/browser/sessions/session_service.cc:1189: case kCommandSessionCookieCreated: { does this restore the cookies even ...
9 years, 1 month ago (2011-11-15 10:42:14 UTC) #3
erikwright (departed)
One concern I have is that this is unlikely to stay current with potential additions ...
9 years, 1 month ago (2011-11-15 14:41:25 UTC) #4
marja
Thanks for comments! In the current version, session cookies are stored in a separate CookieMonster. ...
9 years, 1 month ago (2011-11-17 12:54:46 UTC) #5
marja
Hi Jochen, Could you have another look at this? The latest version has CookieMonster::MergeSessionCookies() for ...
9 years, 1 month ago (2011-11-22 17:14:01 UTC) #6
jochen (gone - plz use gerrit)
the sqlite persistent cookie store has a loading logic that allows for priority loading cookies ...
9 years, 1 month ago (2011-11-22 17:46:53 UTC) #7
erikwright (departed)
I think this CL is quite problematic. Between the time that MergeSessionCookies is called and ...
9 years, 1 month ago (2011-11-22 18:49:38 UTC) #8
marja
The previous version was indeed horribly broken, thanks for pointing it out. I uploaded a ...
9 years, 1 month ago (2011-11-23 12:06:13 UTC) #9
jochen (gone - plz use gerrit)
http://codereview.chromium.org/8533013/diff/46019/chrome/browser/infobars/infobar_delegate.h File chrome/browser/infobars/infobar_delegate.h (right): http://codereview.chromium.org/8533013/diff/46019/chrome/browser/infobars/infobar_delegate.h#newcode78 chrome/browser/infobars/infobar_delegate.h:78: void InfoBarClosed(); why no make this a virtual method ...
9 years ago (2011-11-25 14:45:13 UTC) #10
marja
Thanks again for comments! http://codereview.chromium.org/8533013/diff/46019/chrome/browser/infobars/infobar_delegate.h File chrome/browser/infobars/infobar_delegate.h (right): http://codereview.chromium.org/8533013/diff/46019/chrome/browser/infobars/infobar_delegate.h#newcode78 chrome/browser/infobars/infobar_delegate.h:78: void InfoBarClosed(); On 2011/11/25 14:45:14, ...
9 years ago (2011-11-28 15:22:01 UTC) #11
jochen (gone - plz use gerrit)
http://codereview.chromium.org/8533013/diff/57001/net/base/cookie_monster.cc File net/base/cookie_monster.cc (right): http://codereview.chromium.org/8533013/diff/57001/net/base/cookie_monster.cc#newcode1928 net/base/cookie_monster.cc:1928: // We're setting a cookie, and there are session ...
9 years ago (2011-11-28 15:47:19 UTC) #12
erikwright (departed)
http://codereview.chromium.org/8533013/diff/57001/chrome/browser/net/sqlite_persistent_cookie_store.cc File chrome/browser/net/sqlite_persistent_cookie_store.cc (right): http://codereview.chromium.org/8533013/diff/57001/chrome/browser/net/sqlite_persistent_cookie_store.cc#newcode640 chrome/browser/net/sqlite_persistent_cookie_store.cc:640: sql::Transaction transaction(db_.get()); Please add a metric, recorded and reported ...
9 years ago (2011-11-28 16:18:16 UTC) #13
erikwright (departed)
Can you state for the record what the intended behaviour is in the following scenario: ...
9 years ago (2011-11-28 16:31:44 UTC) #14
marja
Hi, Thanks for comments! As discussed, the latest patch set changes the approach: Now we ...
9 years ago (2011-11-29 12:56:01 UTC) #15
jochen (gone - plz use gerrit)
much nicer! Now a test would make this super-awesome :)
9 years ago (2011-11-29 13:20:55 UTC) #16
erikwright (departed)
It's looking pretty good. Yes, some tests would probably be the next step. http://codereview.chromium.org/8533013/diff/62029/chrome/browser/net/sqlite_persistent_cookie_store.cc File ...
9 years ago (2011-11-29 13:43:22 UTC) #17
marja
Tests added, too. (Unit tests for CookieMonster & SQLPersistentCookieStore.) http://codereview.chromium.org/8533013/diff/62029/chrome/browser/net/sqlite_persistent_cookie_store.cc File chrome/browser/net/sqlite_persistent_cookie_store.cc (right): http://codereview.chromium.org/8533013/diff/62029/chrome/browser/net/sqlite_persistent_cookie_store.cc#newcode848 chrome/browser/net/sqlite_persistent_cookie_store.cc:848: ...
9 years ago (2011-11-29 14:58:20 UTC) #18
jochen (gone - plz use gerrit)
http://codereview.chromium.org/8533013/diff/68001/chrome/browser/net/sqlite_persistent_cookie_store.cc File chrome/browser/net/sqlite_persistent_cookie_store.cc (right): http://codereview.chromium.org/8533013/diff/68001/chrome/browser/net/sqlite_persistent_cookie_store.cc#newcode235 chrome/browser/net/sqlite_persistent_cookie_store.cc:235: static const int kCurrentVersionNumber = 5; can you add ...
9 years ago (2011-11-30 12:12:17 UTC) #19
marja
Thanks for comments! http://codereview.chromium.org/8533013/diff/68001/chrome/browser/net/sqlite_persistent_cookie_store.cc File chrome/browser/net/sqlite_persistent_cookie_store.cc (right): http://codereview.chromium.org/8533013/diff/68001/chrome/browser/net/sqlite_persistent_cookie_store.cc#newcode235 chrome/browser/net/sqlite_persistent_cookie_store.cc:235: static const int kCurrentVersionNumber = 5; ...
9 years ago (2011-11-30 12:57:48 UTC) #20
jochen (gone - plz use gerrit)
LGTM
9 years ago (2011-11-30 13:04:34 UTC) #21
erikwright (departed)
A small test addition requested. http://codereview.chromium.org/8533013/diff/68027/chrome/browser/net/sqlite_persistent_cookie_store.cc File chrome/browser/net/sqlite_persistent_cookie_store.cc (right): http://codereview.chromium.org/8533013/diff/68027/chrome/browser/net/sqlite_persistent_cookie_store.cc#newcode779 chrome/browser/net/sqlite_persistent_cookie_store.cc:779: add_smt.BindInt(9, po->cc().DoesExpire()); Add tests ...
9 years ago (2011-11-30 20:09:40 UTC) #22
marja
http://codereview.chromium.org/8533013/diff/68027/chrome/browser/net/sqlite_persistent_cookie_store.cc File chrome/browser/net/sqlite_persistent_cookie_store.cc (right): http://codereview.chromium.org/8533013/diff/68027/chrome/browser/net/sqlite_persistent_cookie_store.cc#newcode779 chrome/browser/net/sqlite_persistent_cookie_store.cc:779: add_smt.BindInt(9, po->cc().DoesExpire()); On 2011/11/30 20:09:40, erikwright wrote: > Add ...
9 years ago (2011-12-01 15:35:39 UTC) #23
erikwright (departed)
LGTM!
9 years ago (2011-12-01 17:39:29 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/marja@chromium.org/8533013/79016
9 years ago (2011-12-02 08:15:19 UTC) #25
commit-bot: I haz the power
Presubmit check for 8533013-79016 failed and returned exit status 1. Running presubmit commit checks ...
9 years ago (2011-12-02 08:15:27 UTC) #26
marja
Oops, OWNERS check. mirandac, could you review chrome/browser/profiles/* rdsmith, could you review / rubberstamp erikwrights ...
9 years ago (2011-12-02 08:22:27 UTC) #27
Randy Smith (Not in Mondays)
Rubberstamp LGTM chrome/browser/net.
9 years ago (2011-12-02 16:16:28 UTC) #28
Miranda Callahan
LGTM with added DCHECK. http://codereview.chromium.org/8533013/diff/84002/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): http://codereview.chromium.org/8533013/diff/84002/chrome/browser/profiles/profile_impl.cc#newcode173 chrome/browser/profiles/profile_impl.cc:173: url_request_context_getter->GetURLRequestContext()->cookie_store()-> Could you add a ...
9 years ago (2011-12-02 17:13:09 UTC) #29
marja
Thanks for review! http://codereview.chromium.org/8533013/diff/84002/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): http://codereview.chromium.org/8533013/diff/84002/chrome/browser/profiles/profile_impl.cc#newcode173 chrome/browser/profiles/profile_impl.cc:173: url_request_context_getter->GetURLRequestContext()->cookie_store()-> On 2011/12/02 17:13:10, Miranda Callahan ...
9 years ago (2011-12-05 08:40:16 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/marja@chromium.org/8533013/86001
9 years ago (2011-12-05 08:40:35 UTC) #31
commit-bot: I haz the power
9 years ago (2011-12-05 10:40:45 UTC) #32
Change committed as 112970

Powered by Google App Engine
This is Rietveld 408576698