diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 22:54:19 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 22:54:19 +0000 |
commit | 69b3b8f04b759b700b78987fd74cd16c081e6d0e (patch) | |
tree | 03942e40523cfc328b66d77186e0d1552c19beb9 /sync/util/cryptographer.h | |
parent | c09eeea393004f61f55adca9aeda4aa387cee903 (diff) | |
download | chromium_src-69b3b8f04b759b700b78987fd74cd16c081e6d0e.zip chromium_src-69b3b8f04b759b700b78987fd74cd16c081e6d0e.tar.gz chromium_src-69b3b8f04b759b700b78987fd74cd16c081e6d0e.tar.bz2 |
[Sync] Refactor GetEncryptedTypes usage.
The cryptographer is now owned by the SyncEncryptionHandlerImpl, and
no longer needs any connection to the nigori handler or encrypted types.
Those are accessed via the directory, which now has a GetNigoriHandler
method.
Because of this, we can now clean up the thread safety guarantees in the
sync encryption handler impl, enforcing that everything except
GetEncryptedTypes (and IsUsingExplicitPassphrase, which will be fixed in a
followup patch) are invoked on the syncer thread. This lets us not have to
open unnecessary transactions.
At the chrome layer, encrypted types are accessed via BaseTransaction::
GetEncryptedTypes(). At the syncer layer, they're accessed via directory::
GetNigoriHandler()->GetEncryptedTypes(BaseTransaction* trans const).
BUG=142476,139848
Review URL: https://chromiumcodereview.appspot.com/10844005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/util/cryptographer.h')
-rw-r--r-- | sync/util/cryptographer.h | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/sync/util/cryptographer.h b/sync/util/cryptographer.h index 6f9ab5c..77a164f 100644 --- a/sync/util/cryptographer.h +++ b/sync/util/cryptographer.h @@ -11,7 +11,6 @@ #include "base/gtest_prod_util.h" #include "base/memory/linked_ptr.h" #include "base/memory/scoped_ptr.h" -#include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/encryption.pb.h" #include "sync/util/nigori.h" @@ -24,11 +23,6 @@ namespace syncer { class Encryptor; -namespace syncable { -class BaseTransaction; -class NigoriHandler; -} - extern const char kNigoriTag[]; // The parameters used to initialize a Nigori instance. @@ -58,19 +52,6 @@ class Cryptographer { explicit Cryptographer(Encryptor* encryptor); ~Cryptographer(); - // Set the sync nigori node handler. - // TODO(zea): refactor so that Cryptographer doesn't need any connection - // to a NigoriHandler. crbug.com/139848 - void SetNigoriHandler(syncable::NigoriHandler* delegate); - - // NigoriHandler delegator methods (passes through to delegate). - void ApplyNigoriUpdate(const sync_pb::NigoriSpecifics& nigori, - syncable::BaseTransaction* const trans); - void UpdateNigoriFromEncryptedTypes( - sync_pb::NigoriSpecifics* nigori, - syncable::BaseTransaction* const trans) const; - ModelTypeSet GetEncryptedTypes() const; - // |restored_bootstrap_token| can be provided via this method to bootstrap // Cryptographer instance into the ready state (is_ready will be true). // It must be a string that was previously built by the @@ -209,10 +190,6 @@ class Cryptographer { scoped_ptr<sync_pb::EncryptedData> pending_keys_; - // The sync nigori node handler. Necessary until we decouple the encrypted - // types from the cryptographer. - syncable::NigoriHandler* nigori_node_handler_; - DISALLOW_COPY_AND_ASSIGN(Cryptographer); }; |