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

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: Self review 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..e15b770f1e104e50cd99f7c9260487bf4a770e29 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"
@@ -183,6 +185,15 @@ void SessionChangeProcessor::ApplyChangesFromSyncModel(
const sync_pb::SessionSpecifics& specifics(
sync_node.GetSessionSpecifics());
+ if (specifics.session_tag() ==
+ session_model_associator_->GetCurrentMachineTag() &&
+ profile_->GetProfileSyncService()->cros_user() != "test user") {
tim (not reviewing) 2011/02/11 06:52:31 hmm... there's got to be a better way...
Nicolas Zea 2011/02/14 21:18:41 Done.
+ // 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);

Powered by Google App Engine
This is Rietveld 408576698