summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authormkwst <mkwst@chromium.org>2015-03-31 00:33:45 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-31 07:34:40 +0000
commitb73bf8aa4e868323e981623f4789dbe0ef16a1b6 (patch)
tree08cfc9ebda06b017538a8577a315f3397fc485d2 /net
parent13beeda042270ec899f86a806c563eca720370ec (diff)
downloadchromium_src-b73bf8aa4e868323e981623f4789dbe0ef16a1b6.zip
chromium_src-b73bf8aa4e868323e981623f4789dbe0ef16a1b6.tar.gz
chromium_src-b73bf8aa4e868323e981623f4789dbe0ef16a1b6.tar.bz2
Remove the '--enable-file-cookies' flag.
Discussed at https://groups.google.com/a/chromium.org/forum/#!topic/net-dev/47jdSKRnbqA. We can't drop the functionality entirely, as it's exposed as a public method on Android's WebView, but we can limit the functionality to Android and remove current callers. That's the approach this patch takes. BUG=470482 Review URL: https://codereview.chromium.org/976553002 Cr-Commit-Position: refs/heads/master@{#322991}
Diffstat (limited to 'net')
-rw-r--r--net/cookies/cookie_monster.cc25
-rw-r--r--net/cookies/cookie_monster.h24
2 files changed, 33 insertions, 16 deletions
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
index e10c947..e02dd56a 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -1340,14 +1340,6 @@ void CookieMonster::SetCookieableSchemes(const char* const schemes[],
schemes + num_schemes);
}
-void CookieMonster::SetEnableFileScheme(bool accept) {
- // This assumes "file" is always at the end of the array. See the comment
- // above kDefaultCookieableSchemes.
- int num_schemes = accept ? kDefaultCookieableSchemesCount
- : kDefaultCookieableSchemesCount - 1;
- SetCookieableSchemes(kDefaultCookieableSchemes, num_schemes);
-}
-
void CookieMonster::SetKeepExpiredCookies() {
keep_expired_cookies_ = true;
}
@@ -2350,6 +2342,23 @@ CookieMonster::AddCallbackForCookie(const GURL& gurl,
base::Bind(&RunAsync, base::MessageLoopProxy::current(), callback));
}
+#if defined(OS_ANDROID)
+void CookieMonster::SetEnableFileScheme(bool accept) {
+ // This assumes "file" is always at the end of the array. See the comment
+ // above kDefaultCookieableSchemes.
+ //
+ // TODO(mkwst): We're keeping this method around to support the
+ // 'CookieManager::setAcceptFileSchemeCookies' method on Android's WebView;
+ // if/when we can deprecate and remove that method, we can remove this one
+ // as well. Until then, we'll just ensure that the method has no effect on
+ // non-android systems.
+ int num_schemes = accept ? kDefaultCookieableSchemesCount
+ : kDefaultCookieableSchemesCount - 1;
+
+ SetCookieableSchemes(kDefaultCookieableSchemes, num_schemes);
+}
+#endif
+
void CookieMonster::RunCallbacks(const CanonicalCookie& cookie, bool removed) {
lock_.AssertAcquired();
CookieOptions opts;
diff --git a/net/cookies/cookie_monster.h b/net/cookies/cookie_monster.h
index 5633baf..73df004 100644
--- a/net/cookies/cookie_monster.h
+++ b/net/cookies/cookie_monster.h
@@ -210,14 +210,6 @@ class NET_EXPORT CookieMonster : public CookieStore {
// the instance (i.e. as part of the instance initialization process).
void SetCookieableSchemes(const char* const schemes[], size_t num_schemes);
- // Resets the list of cookieable schemes to kDefaultCookieableSchemes with or
- // without 'file' being included.
- //
- // There are some unknowns about how to correctly handle file:// cookies,
- // and our implementation for this is not robust enough. This allows you
- // to enable support, but it should only be used for testing. Bug 1157243.
- void SetEnableFileScheme(bool accept);
-
// Instructs the cookie monster to not delete expired cookies. This is used
// in cases where the cookie monster is used as a data structure to keep
// arbitrary cookies.
@@ -312,6 +304,22 @@ class NET_EXPORT CookieMonster : public CookieStore {
const std::string& name,
const CookieChangedCallback& callback) override;
+#if defined(OS_ANDROID)
+ // Resets the list of cookieable schemes to kDefaultCookieableSchemes with or
+ // without 'file' being included.
+ //
+ // There are some unknowns about how to correctly handle file:// cookies,
+ // and our implementation for this is not robust enough (Bug 1157243).
+ // This allows you to enable support, and is exposed as a public WebView
+ // API ('CookieManager::setAcceptFileSchemeCookies').
+ //
+ // TODO(mkwst): This method will be removed once we can deprecate and remove
+ // the Android WebView 'CookieManager::setAcceptFileSchemeCookies' method.
+ // Until then, this method only has effect on Android, and must not be used
+ // outside a WebView context.
+ void SetEnableFileScheme(bool accept);
+#endif
+
private:
// For queueing the cookie monster calls.
class CookieMonsterTask;