summaryrefslogtreecommitdiffstats
path: root/sync/test
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-16 00:34:12 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-16 00:36:03 +0000
commit6777597b7d471a544472810b7594f9cf473415ea (patch)
tree6cf90ba020f9324f80983fcef38fefb9650bf44e /sync/test
parent947f48cf8ef031a2f126f7af5d1b4f4ba49b7973 (diff)
downloadchromium_src-6777597b7d471a544472810b7594f9cf473415ea.zip
chromium_src-6777597b7d471a544472810b7594f9cf473415ea.tar.gz
chromium_src-6777597b7d471a544472810b7594f9cf473415ea.tar.bz2
sync: Finish non-blocking type encryption support
Undoes some previous work towards encryption support. That approach suffered from some subtle deadlock issues that could not be easily worked around. The new approach involves less sharing and less locks. Gives the ModelTypeSyncWorker its own copy of the Cryptographer. By passing around copies, it no longer needs to worry about acquiring locks in order to access the Directory's cryptographer. This required a rewrite of some changes to the way the ModelTypeSyncWorker detects the current encryption state. Most notably, its Cryptographer is NULL if encryption is not enabled for its model type. Makes the ModelTypeSyncRegistry responsible for observing changes emitted by the SyncEncryptionHandler and forwarding them to the ModelTypeSyncWorkers. It should receive callbacks from the SyncEncryptionHandler during startup, so it does not need to cache or query any new data. Removes the CryptographerProviders. Since the ModelTypeSyncWorker no longer need to access the directory's cryptographer, it's no longer necessary. BUG=351005 Review URL: https://codereview.chromium.org/452283003 Cr-Commit-Position: refs/heads/master@{#290067} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/test')
-rw-r--r--sync/test/engine/simple_cryptographer_provider.cc35
-rw-r--r--sync/test/engine/simple_cryptographer_provider.h44
2 files changed, 0 insertions, 79 deletions
diff --git a/sync/test/engine/simple_cryptographer_provider.cc b/sync/test/engine/simple_cryptographer_provider.cc
deleted file mode 100644
index 0e2fa99..0000000
--- a/sync/test/engine/simple_cryptographer_provider.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/test/engine/simple_cryptographer_provider.h"
-
-namespace syncer {
-
-SimpleCryptographerProvider::SimpleCryptographerProvider(
- Cryptographer* cryptographer)
- : cryptographer_(cryptographer) {
-}
-
-SimpleCryptographerProvider::~SimpleCryptographerProvider() {
-}
-
-bool SimpleCryptographerProvider::InitScopedCryptographerRef(
- ScopedCryptographerRef* scoped) {
- scoped->Initialize(new SimpleScopedCryptographerInternal(cryptographer_));
- return scoped->IsValid();
-}
-
-SimpleScopedCryptographerInternal::SimpleScopedCryptographerInternal(
- Cryptographer* cryptographer)
- : cryptographer_(cryptographer) {
-}
-
-SimpleScopedCryptographerInternal::~SimpleScopedCryptographerInternal() {
-}
-
-Cryptographer* SimpleScopedCryptographerInternal::Get() const {
- return cryptographer_;
-}
-
-} // namespace syncer
diff --git a/sync/test/engine/simple_cryptographer_provider.h b/sync/test/engine/simple_cryptographer_provider.h
deleted file mode 100644
index b23c5c4..0000000
--- a/sync/test/engine/simple_cryptographer_provider.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SYNC_TEST_ENGINE_SIMPLE_CRYPTOGRAPHER_PROVIDER_H_
-#define SYNC_TEST_ENGINE_SIMPLE_CRYPTOGRAPHER_PROVIDER_H_
-
-#include "sync/engine/cryptographer_provider.h"
-
-#include "sync/util/cryptographer.h"
-
-namespace syncer {
-
-// A trivial cryptographer provider. Exposes the given Cryptographer through
-// the CryptographerProvider interface. Does not take ownership of the
-// |cryptographer|.
-class SimpleCryptographerProvider : public CryptographerProvider {
- public:
- explicit SimpleCryptographerProvider(Cryptographer* cryptographer);
- virtual ~SimpleCryptographerProvider();
-
- // Implementation of CryptographerProvider.
- virtual bool InitScopedCryptographerRef(
- ScopedCryptographerRef* scoped) OVERRIDE;
-
- private:
- Cryptographer* cryptographer_;
-};
-
-class SimpleScopedCryptographerInternal : public ScopedCryptographerInternal {
- public:
- explicit SimpleScopedCryptographerInternal(Cryptographer* cryptographer);
- virtual ~SimpleScopedCryptographerInternal();
-
- // Implementation of ScopedCryptographerInternal.
- virtual Cryptographer* Get() const OVERRIDE;
-
- private:
- Cryptographer* cryptographer_;
-};
-
-} // namespace syncer
-
-#endif // SYNC_TEST_ENGINE_SIMPLE_CRYPTOGRAPHER_PROVIDER_H_