| 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);
|
|
|