Skip to content

Commit

Permalink
webview: improve CookieManager migration.
Browse files Browse the repository at this point in the history
We need to create the Default directory before attempting to copy the
old cookie database there, as if the CookieManager is being started
before the rest of Chromium the AwBrowserContext has not yet had a
chance to ensure the directory exists.

Also remove the temporary code which deletes the journal resulting from
the incomplete migration, since it's been a number of releases since the
incomplete migration happened; very few apps should still be in this
state.

Change-Id: If5e96b3fbbefd2e123c93b92833281f0afde188c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2295747
Reviewed-by: Anna Malova <amalova@chromium.org>
Commit-Queue: Richard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788170}
  • Loading branch information
tornewuff authored and Commit Bot committed Jul 14, 2020
1 parent b710acd commit 86681a1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions android_webview/browser/cookie_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,9 @@ void CookieManager::MigrateCookieStorePath() {
GetPathInAppDirectory("Default/Cookies-journal");

if (base::PathExists(old_cookie_store_path)) {
base::CreateDirectory(cookie_store_path_.DirName());
base::Move(old_cookie_store_path, cookie_store_path_);
base::Move(old_cookie_journal_path, new_cookie_journal_path);
} else {
// Some users got an incomplete version of this migration where the journal
// was not moved. Delete the old journal if it exists, as we can't merge
// them.
// TODO(torne): remove this in a future release (M81?)
base::DeleteFile(old_cookie_journal_path, false);
}
}

Expand Down

0 comments on commit 86681a1

Please sign in to comment.