Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Unified Diff: chrome/browser/sync/engine/syncer_proto_util.cc

Issue 3305003: New authorization framework for sync. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/engine/syncer_proto_util.cc
===================================================================
--- chrome/browser/sync/engine/syncer_proto_util.cc (revision 58702)
+++ chrome/browser/sync/engine/syncer_proto_util.cc (working copy)
@@ -6,9 +6,9 @@
#include "base/format_macros.h"
#include "base/string_util.h"
-#include "chrome/browser/sync/engine/auth_watcher.h"
#include "chrome/browser/sync/engine/net/server_connection_manager.h"
#include "chrome/browser/sync/engine/syncer.h"
+#include "chrome/browser/sync/engine/syncer_types.h"
#include "chrome/browser/sync/engine/syncer_util.h"
#include "chrome/browser/sync/protocol/service_constants.h"
#include "chrome/browser/sync/sessions/sync_session.h"
@@ -124,7 +124,7 @@
// static
bool SyncerProtoUtil::PostAndProcessHeaders(ServerConnectionManager* scm,
- AuthWatcher* auth_watcher,
+ sessions::SyncSession* session,
const ClientToServerMessage& msg,
ClientToServerResponse* response) {
@@ -144,12 +144,9 @@
std::string new_token =
http_response.update_client_auth_header;
if (!new_token.empty()) {
- // We could also do this in the SCM's PostBufferWithAuth.
- // But then we could be in the middle of authentication, which seems
- // like a bad time to update the token. A consequence of this is that
- // we can't reset the cookie in response to auth attempts, but this
- // should be OK.
- auth_watcher->RenewAuthToken(new_token);
+ SyncerEvent event(SyncerEvent::UPDATED_TOKEN);
+ event.updated_token = new_token;
+ session->context()->syncer_event_channel()->Notify(event);
}
if (response->ParseFromString(rx)) {
@@ -189,7 +186,7 @@
}
if (!PostAndProcessHeaders(session->context()->connection_manager(),
- session->context()->auth_watcher(),
+ session,
msg,
response)) {
return false;

Powered by Google App Engine
This is Rietveld 408576698