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

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

Issue 11441026: [Sync] Add support for loading, updating and querying delete journals in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make IsDeleteJournalEnabled() public Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SYNC_SYNCABLE_ENTRY_KERNEL_H_ 5 #ifndef SYNC_SYNCABLE_ENTRY_KERNEL_H_
6 #define SYNC_SYNCABLE_ENTRY_KERNEL_H_ 6 #define SYNC_SYNCABLE_ENTRY_KERNEL_H_
7 7
8 #include <set>
9
8 #include "base/time.h" 10 #include "base/time.h"
9 #include "base/values.h" 11 #include "base/values.h"
10 #include "sync/internal_api/public/base/model_type.h" 12 #include "sync/internal_api/public/base/model_type.h"
11 #include "sync/internal_api/public/base/node_ordinal.h" 13 #include "sync/internal_api/public/base/node_ordinal.h"
12 #include "sync/internal_api/public/util/immutable.h" 14 #include "sync/internal_api/public/util/immutable.h"
13 #include "sync/protocol/sync.pb.h" 15 #include "sync/protocol/sync.pb.h"
14 #include "sync/syncable/metahandle_set.h" 16 #include "sync/syncable/metahandle_set.h"
15 #include "sync/syncable/syncable_id.h" 17 #include "sync/syncable/syncable_id.h"
16 #include "sync/util/time.h" 18 #include "sync/util/time.h"
17 19
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 // Note: |cryptographer| is an optional parameter for use in decrypting 317 // Note: |cryptographer| is an optional parameter for use in decrypting
316 // encrypted specifics. If it is NULL or the specifics are not decryptsble, 318 // encrypted specifics. If it is NULL or the specifics are not decryptsble,
317 // they will be serialized as empty proto's. 319 // they will be serialized as empty proto's.
318 base::DictionaryValue* ToValue(Cryptographer* cryptographer) const; 320 base::DictionaryValue* ToValue(Cryptographer* cryptographer) const;
319 321
320 private: 322 private:
321 // Tracks whether this entry needs to be saved to the database. 323 // Tracks whether this entry needs to be saved to the database.
322 bool dirty_; 324 bool dirty_;
323 }; 325 };
324 326
327 class EntryKernelLessByMetaHandle {
328 public:
329 inline bool operator()(const EntryKernel* a,
330 const EntryKernel* b) const {
331 return a->ref(META_HANDLE) < b->ref(META_HANDLE);
332 }
333 };
334
335 typedef std::set<const EntryKernel*, EntryKernelLessByMetaHandle>
336 EntryKernelSet;
tim (not reviewing) 2012/12/21 03:30:40 Hm, did this move from somewhere? EntryKernelSet
haitaol1 2013/01/03 19:40:49 Yes, moved here from directory.h. On 2012/12/21 0
337
325 struct EntryKernelMutation { 338 struct EntryKernelMutation {
326 EntryKernel original, mutated; 339 EntryKernel original, mutated;
327 }; 340 };
328 341
329 typedef std::map<int64, EntryKernelMutation> EntryKernelMutationMap; 342 typedef std::map<int64, EntryKernelMutation> EntryKernelMutationMap;
330 343
331 typedef Immutable<EntryKernelMutationMap> ImmutableEntryKernelMutationMap; 344 typedef Immutable<EntryKernelMutationMap> ImmutableEntryKernelMutationMap;
332 345
333 // Caller owns the return value. 346 // Caller owns the return value.
334 base::DictionaryValue* EntryKernelMutationToValue( 347 base::DictionaryValue* EntryKernelMutationToValue(
335 const EntryKernelMutation& mutation); 348 const EntryKernelMutation& mutation);
336 349
337 // Caller owns the return value. 350 // Caller owns the return value.
338 base::ListValue* EntryKernelMutationMapToValue( 351 base::ListValue* EntryKernelMutationMapToValue(
339 const EntryKernelMutationMap& mutations); 352 const EntryKernelMutationMap& mutations);
340 353
341 } // namespace syncable 354 } // namespace syncable
342 } // namespace syncer 355 } // namespace syncer
343 356
344 #endif // SYNC_SYNCABLE_ENTRY_KERNEL_H_ 357 #endif // SYNC_SYNCABLE_ENTRY_KERNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698