diff options
author | rickcam@chromium.org <rickcam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-24 20:25:11 +0000 |
---|---|---|
committer | rickcam@chromium.org <rickcam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-24 20:25:11 +0000 |
commit | 93fdd2501f8714dbf1b120a4a276027e7c633d74 (patch) | |
tree | 7eac2d34a91fd8ddf144810b4557fb40d57a932d | |
parent | 43e05869ce2ffbefd47b513c62d55f0d3ee36ef3 (diff) | |
download | chromium_src-93fdd2501f8714dbf1b120a4a276027e7c633d74.zip chromium_src-93fdd2501f8714dbf1b120a4a276027e7c633d74.tar.gz chromium_src-93fdd2501f8714dbf1b120a4a276027e7c633d74.tar.bz2 |
Revert 90421 - Adds --enable-sync-oauth, enabling INFO logging of oauth_token cookies
BUG=87404
TEST=Run with --enable-sync-oauth, grep log for COOKIE_CHANGED
Review URL: http://codereview.chromium.org/7198025
TBR=rickcam@chromium.org
Review URL: http://codereview.chromium.org/7262003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90423 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/profile_sync_service.cc | 65 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.h | 5 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 |
4 files changed, 0 insertions, 74 deletions
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 2bcdc98..3e058f3 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -21,7 +21,6 @@ #include "base/stringprintf.h" #include "base/task.h" #include "base/threading/thread_restrictions.h" -#include "chrome/browser/net/chrome_cookie_notification_details.h" #include "chrome/browser/net/gaia/token_service.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" @@ -48,7 +47,6 @@ #include "content/common/notification_source.h" #include "content/common/notification_type.h" #include "grit/generated_resources.h" -#include "net/base/cookie_monster.h" #include "ui/base/l10n/l10n_util.h" using browser_sync::ChangeProcessor; @@ -175,11 +173,6 @@ void ProfileSyncService::RegisterAuthNotifications() { registrar_.Add(this, NotificationType::GOOGLE_SIGNIN_FAILED, Source<Profile>(profile_)); - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableSyncOAuth)) { - registrar_.Add(this, - NotificationType::COOKIE_CHANGED, - Source<Profile>(profile_)); - } } void ProfileSyncService::RegisterDataTypeController( @@ -566,59 +559,6 @@ void ProfileSyncService::OnBackendInitialized() { } } -namespace { -const char* CauseName(net::CookieMonster::Delegate::ChangeCause cause) { - switch (cause) { - case net::CookieMonster::Delegate::CHANGE_COOKIE_EXPLICIT: - return "CHANGE_COOKIE_EXPLICIT"; - case net::CookieMonster::Delegate::CHANGE_COOKIE_OVERWRITE: - return "CHANGE_COOKIE_OVERWRITE"; - case net::CookieMonster::Delegate::CHANGE_COOKIE_EXPIRED: - return "CHANGE_COOKIE_EXPIRED"; - case net::CookieMonster::Delegate::CHANGE_COOKIE_EVICTED: - return "CHANGE_COOKIE_EVICTED"; - case net::CookieMonster::Delegate::CHANGE_COOKIE_EXPIRED_OVERWRITE: - return "CHANGE_COOKIE_EXPIRED_OVERWRITE"; - default: - return "<unknown>"; - } -} -} - -void ProfileSyncService::OnCookieChanged(Profile* profile, - ChromeCookieDetails* cookie_details) { - const net::CookieMonster::CanonicalCookie* canonical_cookie = - cookie_details->cookie; - if (canonical_cookie->Name() == "oauth_token") { - net::CookieMonster::Delegate::ChangeCause cause = cookie_details->cause; - LOG(INFO) << "COOKIE_CHANGED: removed=" - << (cookie_details->removed ? "true" : "false") - << ", cause=" << CauseName(cause) - << ", Source=" << canonical_cookie->Source() - << ", Name=" << canonical_cookie->Name() - << ", Value=" << canonical_cookie->Value() - << ", Domain=" << canonical_cookie->Domain() - << ", Path=" << canonical_cookie->Path() - << ", DoesExpire=" - << (canonical_cookie->DoesExpire() ? "true" : "false") - << ", IsPersistent=" - << (canonical_cookie->IsPersistent() ? "true" : "false") - << ", IsSecure=" - << (canonical_cookie->IsSecure() ? "true" : "false") - << ", IsHttpOnly=" - << (canonical_cookie->IsHttpOnly() ? "true" : "false") - << ", IsDomainCookie=" - << (canonical_cookie->IsDomainCookie() ? "true" : "false") - << ", IsHostCookie=" - << (canonical_cookie->IsHostCookie() ? "true" : "false") - << ", IsExpired=" - << (const_cast<net::CookieMonster::CanonicalCookie*>( - canonical_cookie)->IsExpired( - base::Time::NowFromSystemTime()) - ? "true" : "false"); - } -} - void ProfileSyncService::OnSyncCycleCompleted() { UpdateLastSyncedTime(); VLOG(2) << "Notifying observers sync cycle completed"; @@ -1367,11 +1307,6 @@ void ProfileSyncService::Observe(NotificationType type, } break; } - case NotificationType::COOKIE_CHANGED: { - OnCookieChanged(Source<Profile>(source).ptr(), - Details<ChromeCookieDetails>(details).ptr()); - break; - } default: { NOTREACHED(); } diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index d66aa84..f4ee9c5 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -17,7 +17,6 @@ #include "base/time.h" #include "base/timer.h" #include "base/tracked.h" -#include "chrome/browser/net/chrome_cookie_notification_details.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/sync/engine/model_safe_worker.h" #include "chrome/browser/sync/glue/data_type_controller.h" @@ -209,10 +208,6 @@ class ProfileSyncService : public browser_sync::SyncFrontend, const std::string& captcha, const std::string& access_code); - // Called when a cookie, e. g. oauth_token, changes - virtual void OnCookieChanged(Profile* profile, - ChromeCookieDetails* cookie_details); - // Update the last auth error and notify observers of error state. void UpdateAuthErrorState(const GoogleServiceAuthError& error); diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index d8bacf5..173efa5 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -495,9 +495,6 @@ const char kEnableSyncAutofill[] = "enable-sync-autofill"; // Enable sync encryption options. const char kEnableSyncEncryption[] = "enable-sync-encryption"; -// Enable OAuth sign-in for sync. -const char kEnableSyncOAuth[] = "enable-sync-oauth"; - // Enable syncing browser sessions. const char kEnableSyncSessions[] = "enable-sync-sessions"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index f84cb58..f79021a 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -144,7 +144,6 @@ extern const char kEnableSSLCachedInfo[]; extern const char kEnableSync[]; extern const char kEnableSyncAutofill[]; extern const char kEnableSyncEncryption[]; -extern const char kEnableSyncOAuth[]; extern const char kEnableSyncPreferences[]; extern const char kEnableSyncSessions[]; extern const char kEnableSyncTypedUrls[]; |