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

Unified Diff: chrome/browser/sync/glue/session_change_processor.cc

Issue 6465005: [Sync] Initial support for encrypting any datatype (no UI hookup yet). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + small fix Created 9 years, 10 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/glue/session_change_processor.cc
diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc
index 8823af0664cbaa1001a9413617826f0d287bf798..56a99fb958a50a13892b895d51cf2dfd32ea7f2c 100644
--- a/chrome/browser/sync/glue/session_change_processor.cc
+++ b/chrome/browser/sync/glue/session_change_processor.cc
@@ -10,8 +10,10 @@
#include "base/logging.h"
#include "base/scoped_vector.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/engine/syncapi.h"
#include "chrome/browser/sync/glue/session_model_associator.h"
+#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/notification_details.h"
@@ -31,6 +33,19 @@ SessionChangeProcessor::SessionChangeProcessor(
DCHECK(session_model_associator_);
}
+SessionChangeProcessor::SessionChangeProcessor(
+ UnrecoverableErrorHandler* error_handler,
+ SessionModelAssociator* session_model_associator,
+ bool setup_for_test)
+ : ChangeProcessor(error_handler),
+ session_model_associator_(session_model_associator),
+ profile_(NULL),
+ setup_for_test_(setup_for_test) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(error_handler);
+ DCHECK(session_model_associator_);
+}
+
SessionChangeProcessor::~SessionChangeProcessor() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
@@ -183,6 +198,15 @@ void SessionChangeProcessor::ApplyChangesFromSyncModel(
const sync_pb::SessionSpecifics& specifics(
sync_node.GetSessionSpecifics());
+ if (specifics.session_tag() ==
+ session_model_associator_->GetCurrentMachineTag() &&
+ !setup_for_test_) {
+ // We should only ever receive a change to our own machine's session info
+ // if encryption was turned on. In that case, the data is still the same,
+ // so we can ignore.
+ LOG(WARNING) << "Dropping modification to local session.";
+ return;
+ }
const int64 mtime = sync_node.GetModificationTime();
// Model associator handles foreign session update and add the same.
session_model_associator_->AssociateForeignSpecifics(specifics, mtime);
« no previous file with comments | « chrome/browser/sync/glue/session_change_processor.h ('k') | chrome/browser/sync/glue/session_model_associator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698