summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorbzanotti <bzanotti@chromium.org>2015-12-15 06:52:49 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-15 14:53:58 +0000
commitdef2982edb1814b13ca9dd03b619521231f65bf2 (patch)
tree1e1db17e41cfdbd60112682a37ea567398c15b8f /google_apis
parent3706ec03070f08a3578912f23c93fe9d407bbfb0 (diff)
downloadchromium_src-def2982edb1814b13ca9dd03b619521231f65bf2.zip
chromium_src-def2982edb1814b13ca9dd03b619521231f65bf2.tar.gz
chromium_src-def2982edb1814b13ca9dd03b619521231f65bf2.tar.bz2
Force Account Consistency off for Logout call on iOS.
The GaiaAuthFetcher Logout call needs Account Consistency to be disabled to work properly. On iOS, the state of Account Consistency is handled by cookies set on the various Google domains. Sadly, the cookie clearing request is not synchronized with the Logout call and there is a race between the two. This CL forces the cookie to be invalid during the Logout request to ensure the accounts will be cleared. The cookie will eventually be invalidated in the WKWebView cookie jar when AccountConsistencyService finishes. BUG=569501 Review URL: https://codereview.chromium.org/1522873002 Cr-Commit-Position: refs/heads/master@{#365248}
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gaia/gaia_auth_fetcher.cc6
-rw-r--r--google_apis/gaia/gaia_auth_fetcher.h6
2 files changed, 11 insertions, 1 deletions
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc
index 38e7802..be2e2e5 100644
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -195,6 +195,10 @@ void GaiaAuthFetcher::SetPendingFetch(bool pending_fetch) {
fetch_pending_ = pending_fetch;
}
+void GaiaAuthFetcher::SetLogoutHeaders(const std::string& headers) {
+ logout_headers_ = headers;
+}
+
void GaiaAuthFetcher::CancelRequest() {
fetcher_.reset();
fetch_pending_ = false;
@@ -629,7 +633,7 @@ void GaiaAuthFetcher::StartListAccounts() {
void GaiaAuthFetcher::StartLogOut() {
DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
- CreateAndStartGaiaFetcher(std::string(), std::string(), logout_gurl_,
+ CreateAndStartGaiaFetcher(std::string(), logout_headers_, logout_gurl_,
net::LOAD_NORMAL);
}
diff --git a/google_apis/gaia/gaia_auth_fetcher.h b/google_apis/gaia/gaia_auth_fetcher.h
index 6a92a21..ced2601 100644
--- a/google_apis/gaia/gaia_auth_fetcher.h
+++ b/google_apis/gaia/gaia_auth_fetcher.h
@@ -228,6 +228,9 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
void SetPendingFetch(bool pending_fetch);
+ // Set the headers to use during the Logout call.
+ void SetLogoutHeaders(const std::string& headers);
+
private:
// The format of the POST body for IssueAuthToken.
static const char kIssueAuthTokenFormat[];
@@ -430,6 +433,9 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
std::string requested_service_;
bool fetch_pending_;
+ // Headers used during the Logout call.
+ std::string logout_headers_;
+
friend class GaiaAuthFetcherTest;
FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CaptchaParse);
FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, AccountDeletedError);