OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SYNC_SYNCABLE_NIGORI_HANDLER_H_ |
| 6 #define SYNC_SYNCABLE_NIGORI_HANDLER_H_ |
| 7 |
| 8 #include "sync/internal_api/public/base/model_type.h" |
| 9 |
| 10 namespace sync_pb { |
| 11 class NigoriSpecifics; |
| 12 } |
| 13 |
| 14 namespace syncer { |
| 15 namespace syncable { |
| 16 |
| 17 class BaseTransaction; |
| 18 |
| 19 // Sync internal interface for dealing with nigori node and querying |
| 20 // the current set of encrypted types. Not thread safe, so a sync transaction |
| 21 // must be held by a caller whenever invoking methods. |
| 22 class NigoriHandler { |
| 23 public: |
| 24 NigoriHandler(); |
| 25 virtual ~NigoriHandler(); |
| 26 |
| 27 // Apply a nigori node update, updating the internal encryption state |
| 28 // accordingly. |
| 29 virtual void ApplyNigoriUpdate( |
| 30 const sync_pb::NigoriSpecifics& nigori, |
| 31 syncable::BaseTransaction* const trans) = 0; |
| 32 |
| 33 // Store the current encrypt everything/encrypted types state into |nigori|. |
| 34 virtual void UpdateNigoriFromEncryptedTypes( |
| 35 sync_pb::NigoriSpecifics* nigori, |
| 36 syncable::BaseTransaction* const trans) const = 0; |
| 37 |
| 38 // Returns the set of currently encrypted types. |
| 39 // TODO(zea): force callers to pass their syncable trans here. |
| 40 virtual ModelTypeSet GetEncryptedTypes() const = 0; |
| 41 }; |
| 42 |
| 43 } // namespace syncable |
| 44 } // namespace syncer |
| 45 |
| 46 #endif // SYNC_SYNCABLE_NIGORI_HANDLER_H_ |
OLD | NEW |