diff options
author | haitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-09 01:53:03 +0000 |
---|---|---|
committer | haitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-09 01:53:03 +0000 |
commit | 9c40dd7702897430fe8aaa44422106734a50dbd7 (patch) | |
tree | 410cd14c31505087e73ef14b07d702ce8da52a02 /sync/internal_api | |
parent | 9825394e98e903d0f6d8530a51ba3eea6b0a875f (diff) | |
download | chromium_src-9c40dd7702897430fe8aaa44422106734a50dbd7.zip chromium_src-9c40dd7702897430fe8aaa44422106734a50dbd7.tar.gz chromium_src-9c40dd7702897430fe8aaa44422106734a50dbd7.tar.bz2 |
Let sync backup/rollback manager return a dummy encryption handler.
Backup/rollback doesn't require encryption while sync backend currently
assumes there's an encryption handler ready to use. So use a dummy one
to avoid crash.
BUG=362679
Review URL: https://codereview.chromium.org/268163002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269147 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api')
-rw-r--r-- | sync/internal_api/sync_rollback_manager_base.cc | 27 | ||||
-rw-r--r-- | sync/internal_api/sync_rollback_manager_base.h | 2 |
2 files changed, 22 insertions, 7 deletions
diff --git a/sync/internal_api/sync_rollback_manager_base.cc b/sync/internal_api/sync_rollback_manager_base.cc index 7d425cc..e5a4779 100644 --- a/sync/internal_api/sync_rollback_manager_base.cc +++ b/sync/internal_api/sync_rollback_manager_base.cc @@ -8,7 +8,6 @@ #include "sync/internal_api/public/internal_components_factory.h" #include "sync/internal_api/public/read_node.h" #include "sync/internal_api/public/read_transaction.h" -#include "sync/internal_api/public/util/syncer_error.h" #include "sync/internal_api/public/write_transaction.h" #include "sync/syncable/directory_backing_store.h" #include "sync/syncable/mutable_entry.h" @@ -20,13 +19,31 @@ const char kBookmarkBarTag[] = "bookmark_bar"; const char kMobileBookmarksTag[] = "synced_bookmarks"; const char kOtherBookmarksTag[] = "other_bookmarks"; +class DummyEntryptionHandler : public syncer::SyncEncryptionHandler { + virtual void AddObserver(Observer* observer) OVERRIDE {} + virtual void RemoveObserver(Observer* observer) OVERRIDE {} + virtual void Init() OVERRIDE {} + virtual void SetEncryptionPassphrase(const std::string& passphrase, + bool is_explicit) OVERRIDE {} + virtual void SetDecryptionPassphrase(const std::string& passphrase) + OVERRIDE {} + virtual void EnableEncryptEverything() OVERRIDE {} + virtual bool EncryptEverythingEnabled() const OVERRIDE { + return false; + } + virtual syncer::PassphraseType GetPassphraseType() const OVERRIDE { + return syncer::KEYSTORE_PASSPHRASE; + } +}; + } // anonymous namespace namespace syncer { SyncRollbackManagerBase::SyncRollbackManagerBase() : report_unrecoverable_error_function_(NULL), - weak_ptr_factory_(this) { + weak_ptr_factory_(this), + dummy_handler_(new DummyEntryptionHandler) { } SyncRollbackManagerBase::~SyncRollbackManagerBase() { @@ -85,7 +102,6 @@ bool SyncRollbackManagerBase::PurgePartiallySyncedTypes() { void SyncRollbackManagerBase::UpdateCredentials( const SyncCredentials& credentials) { - NOTREACHED(); } void SyncRollbackManagerBase::StartSyncingNormally( @@ -101,9 +117,6 @@ void SyncRollbackManagerBase::ConfigureSyncer( const ModelSafeRoutingInfo& new_routing_info, const base::Closure& ready_task, const base::Closure& retry_task) { - DCHECK(to_purge.Empty()); - DCHECK(to_journal.Empty()); - DCHECK(to_unapply.Empty()); for (ModelTypeSet::Iterator type = to_download.First(); type.Good(); type.Inc()) { if (InitTypeRootNode(type.Get())) { @@ -169,7 +182,7 @@ bool SyncRollbackManagerBase::HasUnsyncedItems() { } SyncEncryptionHandler* SyncRollbackManagerBase::GetEncryptionHandler() { - return NULL; + return dummy_handler_.get(); } void SyncRollbackManagerBase::RefreshTypes(ModelTypeSet types) { diff --git a/sync/internal_api/sync_rollback_manager_base.h b/sync/internal_api/sync_rollback_manager_base.h index ee8d4a3..b6469da 100644 --- a/sync/internal_api/sync_rollback_manager_base.h +++ b/sync/internal_api/sync_rollback_manager_base.h @@ -140,6 +140,8 @@ class SYNC_EXPORT_PRIVATE SyncRollbackManagerBase : base::WeakPtrFactory<SyncRollbackManagerBase> weak_ptr_factory_; + scoped_ptr<SyncEncryptionHandler> dummy_handler_; + DISALLOW_COPY_AND_ASSIGN(SyncRollbackManagerBase); }; |