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

Unified Diff: sync/util/cryptographer.cc

Issue 10844005: [Sync] Refactor GetEncryptedTypes usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + add dcheck Created 8 years, 4 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
« no previous file with comments | « sync/util/cryptographer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/util/cryptographer.cc
diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc
index 0cdb389d0041b36ff525a0d25c34ff774650819c..92f97954fa0e741fe1368ebd6ad021448f775ee8 100644
--- a/sync/util/cryptographer.cc
+++ b/sync/util/cryptographer.cc
@@ -9,7 +9,6 @@
#include "base/base64.h"
#include "base/logging.h"
#include "sync/protocol/nigori_specifics.pb.h"
-#include "sync/syncable/nigori_handler.h"
#include "sync/util/encryptor.h"
namespace syncer {
@@ -25,33 +24,12 @@ const char kNigoriKeyName[] = "nigori-key";
Cryptographer::Cryptographer(Encryptor* encryptor)
: encryptor_(encryptor),
default_nigori_(NULL),
- keystore_nigori_(NULL),
- nigori_node_handler_(NULL) {
+ keystore_nigori_(NULL) {
DCHECK(encryptor);
}
Cryptographer::~Cryptographer() {}
-void Cryptographer::SetNigoriHandler(syncable::NigoriHandler* delegate) {
- nigori_node_handler_ = delegate;
-}
-
-void Cryptographer::ApplyNigoriUpdate(
- const sync_pb::NigoriSpecifics& nigori,
- syncable::BaseTransaction* const trans) {
- nigori_node_handler_->ApplyNigoriUpdate(nigori, trans);
-}
-
-ModelTypeSet Cryptographer::GetEncryptedTypes() const {
- return nigori_node_handler_->GetEncryptedTypes();
-}
-
-void Cryptographer::UpdateNigoriFromEncryptedTypes(
- sync_pb::NigoriSpecifics* nigori,
- syncable::BaseTransaction* const trans) const {
- nigori_node_handler_->UpdateNigoriFromEncryptedTypes(nigori, trans);
-}
-
void Cryptographer::Bootstrap(const std::string& restored_bootstrap_token) {
if (is_initialized()) {
@@ -213,6 +191,7 @@ void Cryptographer::SetDefaultKey(const std::string& key_name) {
void Cryptographer::SetPendingKeys(const sync_pb::EncryptedData& encrypted) {
DCHECK(!CanDecrypt(encrypted));
+ DCHECK(!encrypted.blob().empty());
pending_keys_.reset(new sync_pb::EncryptedData(encrypted));
}
« no previous file with comments | « sync/util/cryptographer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698