diff options
author | mmenke <mmenke@chromium.org> | 2016-02-01 10:42:10 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-01 18:43:52 +0000 |
commit | 18dd8baa0e72d8d144189094e206e672d6974379 (patch) | |
tree | c161c22f29848db74b5dd6ea82099be0c8eb07e7 /android_webview | |
parent | 9313abf0d061aa68fd205bb22bf63bd5d039ae58 (diff) | |
download | chromium_src-18dd8baa0e72d8d144189094e206e672d6974379.zip chromium_src-18dd8baa0e72d8d144189094e206e672d6974379.tar.gz chromium_src-18dd8baa0e72d8d144189094e206e672d6974379.tar.bz2 |
Add an optional list of schemes to content::CookieConfig.
This reduces the number of components that have to call
GetCookieMonster to set the list.
Android Webview still depends on GetCookieMonster + setting
schemes. I'm thinking we'll eventually replace that by
lazily initializing the CookieStore on first access, with
a wrapper (We already need a cross-thread wrapper, so one
that also does lazy init isn't exactly a huge increase in
complexity).
Also removed CookieMonster::SetEnableFileScheme, which was
only declared on Android, for use by Webview. Webview now
explicitly sets all the schemes it wants instead.
TBR=phajdan.jr@chromium.org
BUG=579653
Review URL: https://codereview.chromium.org/1636383003
Cr-Commit-Position: refs/heads/master@{#372704}
Diffstat (limited to 'android_webview')
-rw-r--r-- | android_webview/native/cookie_manager.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/android_webview/native/cookie_manager.cc b/android_webview/native/cookie_manager.cc index fac2ab9..08f8246 100644 --- a/android_webview/native/cookie_manager.cc +++ b/android_webview/native/cookie_manager.cc @@ -5,6 +5,7 @@ #include "android_webview/native/cookie_manager.h" #include <utility> +#include <vector> #include "android_webview/browser/aw_browser_context.h" #include "android_webview/browser/aw_cookie_access_policy.h" @@ -509,7 +510,22 @@ void CookieManager::SetAcceptFileSchemeCookies(bool accept) { } void CookieManager::SetAcceptFileSchemeCookiesLocked(bool accept) { - cookie_monster_->SetEnableFileScheme(accept); + // There are some unknowns about how to correctly handle file:// cookies, + // and our implementation for this is not robust. http://crbug.com/582985 + // + // TODO(mmenke): This call should be removed once we can deprecate and remove + // the Android WebView 'CookieManager::setAcceptFileSchemeCookies' method. + // Until then, note that this is just not a great idea. + std::vector<std::string> schemes; + schemes.insert(schemes.begin(), + net::CookieMonster::kDefaultCookieableSchemes, + net::CookieMonster::kDefaultCookieableSchemes + + net::CookieMonster::kDefaultCookieableSchemesCount); + + if (accept) + schemes.push_back(url::kFileScheme); + + cookie_monster_->SetCookieableSchemes(schemes); } } // namespace |