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

Side by Side Diff: sync/syncable/nigori_handler.h

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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 unified diff | Download patch
« no previous file with comments | « sync/syncable/mutable_entry.cc ('k') | sync/syncable/nigori_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 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 <string>
9
10 #include "sync/base/sync_export.h"
11 #include "sync/internal_api/public/base/model_type.h"
12
13 namespace google {
14 namespace protobuf {
15 template <typename T>
16 class RepeatedPtrField;
17 }
18 }
19
20 namespace sync_pb {
21 class NigoriSpecifics;
22 }
23
24 namespace syncer {
25 namespace syncable {
26
27 class BaseTransaction;
28
29 // Sync internal interface for dealing with nigori node and querying
30 // the current set of encrypted types. Not thread safe, so a sync transaction
31 // must be held by a caller whenever invoking methods.
32 class SYNC_EXPORT NigoriHandler {
33 public:
34 NigoriHandler();
35 virtual ~NigoriHandler();
36
37 // Apply a nigori node update, updating the internal encryption state
38 // accordingly.
39 virtual void ApplyNigoriUpdate(
40 const sync_pb::NigoriSpecifics& nigori,
41 syncable::BaseTransaction* const trans) = 0;
42
43 // Store the current encrypt everything/encrypted types state into |nigori|.
44 virtual void UpdateNigoriFromEncryptedTypes(
45 sync_pb::NigoriSpecifics* nigori,
46 syncable::BaseTransaction* const trans) const = 0;
47
48 // Whether a keystore key needs to be requested from the sync server.
49 virtual bool NeedKeystoreKey(
50 syncable::BaseTransaction* const trans) const = 0;
51
52 // Set the keystore keys the server returned for this account.
53 // Returns true on success, false otherwise.
54 virtual bool SetKeystoreKeys(
55 const google::protobuf::RepeatedPtrField<std::string>& keys,
56 syncable::BaseTransaction* const trans) = 0;
57
58 // Returns the set of currently encrypted types.
59 virtual ModelTypeSet GetEncryptedTypes(
60 syncable::BaseTransaction* const trans) const = 0;
61 };
62
63 } // namespace syncable
64 } // namespace syncer
65
66 #endif // SYNC_SYNCABLE_NIGORI_HANDLER_H_
OLDNEW
« no previous file with comments | « sync/syncable/mutable_entry.cc ('k') | sync/syncable/nigori_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698