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

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

Issue 1393633003: Sync: fix for the code that checks whether the initial download has completed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback Created 5 years, 2 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/engine/syncer_unittest.cc ('k') | sync/syncable/directory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_DIRECTORY_H_ 5 #ifndef SYNC_SYNCABLE_DIRECTORY_H_
6 #define SYNC_SYNCABLE_DIRECTORY_H_ 6 #define SYNC_SYNCABLE_DIRECTORY_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 void IncrementTransactionVersion(ModelType type); 293 void IncrementTransactionVersion(ModelType type);
294 294
295 // Getter/setters for the per datatype context. 295 // Getter/setters for the per datatype context.
296 void GetDataTypeContext(BaseTransaction* trans, 296 void GetDataTypeContext(BaseTransaction* trans,
297 ModelType type, 297 ModelType type,
298 sync_pb::DataTypeContext* context) const; 298 sync_pb::DataTypeContext* context) const;
299 void SetDataTypeContext(BaseWriteTransaction* trans, 299 void SetDataTypeContext(BaseWriteTransaction* trans,
300 ModelType type, 300 ModelType type,
301 const sync_pb::DataTypeContext& context); 301 const sync_pb::DataTypeContext& context);
302 302
303 // Returns types for which the initial sync has ended.
303 ModelTypeSet InitialSyncEndedTypes(); 304 ModelTypeSet InitialSyncEndedTypes();
305
306 // Returns true if the initial sync for |type| has completed.
304 bool InitialSyncEndedForType(ModelType type); 307 bool InitialSyncEndedForType(ModelType type);
308 bool InitialSyncEndedForType(BaseTransaction* trans, ModelType type);
309
310 // Marks the |type| as having its intial sync complete.
311 // This applies only to types with implicitly created root folders.
312 void MarkInitialSyncEndedForType(BaseWriteTransaction* trans, ModelType type);
305 313
306 // (Account) Store birthday is opaque to the client, so we keep it in the 314 // (Account) Store birthday is opaque to the client, so we keep it in the
307 // format it is in the proto buffer in case we switch to a binary birthday 315 // format it is in the proto buffer in case we switch to a binary birthday
308 // later. 316 // later.
309 std::string store_birthday() const; 317 std::string store_birthday() const;
310 void set_store_birthday(const std::string& store_birthday); 318 void set_store_birthday(const std::string& store_birthday);
311 319
312 // (Account) Bag of chip is an opaque state used by the server to track the 320 // (Account) Bag of chip is an opaque state used by the server to track the
313 // client. 321 // client.
314 std::string bag_of_chips() const; 322 std::string bag_of_chips() const;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 // have a ScopedKernelLock. 621 // have a ScopedKernelLock.
614 void GetMetaHandlesOfType(const ScopedKernelLock& lock, 622 void GetMetaHandlesOfType(const ScopedKernelLock& lock,
615 BaseTransaction* trans, 623 BaseTransaction* trans,
616 ModelType type, 624 ModelType type,
617 std::vector<int64>* result); 625 std::vector<int64>* result);
618 626
619 // Invoked by DirectoryBackingStore when a catastrophic database error is 627 // Invoked by DirectoryBackingStore when a catastrophic database error is
620 // detected. 628 // detected.
621 void OnCatastrophicError(); 629 void OnCatastrophicError();
622 630
623 // Returns true if the initial sync for |type| has completed.
624 bool InitialSyncEndedForType(BaseTransaction* trans, ModelType type);
625
626 // Stops sending events to the delegate and the transaction 631 // Stops sending events to the delegate and the transaction
627 // observer. 632 // observer.
628 void Close(); 633 void Close();
629 634
630 // Returns true if the directory had encountered an unrecoverable error. 635 // Returns true if the directory had encountered an unrecoverable error.
631 // Note: Any function in |Directory| that can be called without holding a 636 // Note: Any function in |Directory| that can be called without holding a
632 // transaction need to check if the Directory already has an unrecoverable 637 // transaction need to check if the Directory already has an unrecoverable
633 // error on it. 638 // error on it.
634 bool unrecoverable_error_set(const BaseTransaction* trans) const; 639 bool unrecoverable_error_set(const BaseTransaction* trans) const;
635 640
(...skipping 17 matching lines...) Expand all
653 658
654 base::WeakPtrFactory<Directory> weak_ptr_factory_; 659 base::WeakPtrFactory<Directory> weak_ptr_factory_;
655 660
656 DISALLOW_COPY_AND_ASSIGN(Directory); 661 DISALLOW_COPY_AND_ASSIGN(Directory);
657 }; 662 };
658 663
659 } // namespace syncable 664 } // namespace syncable
660 } // namespace syncer 665 } // namespace syncer
661 666
662 #endif // SYNC_SYNCABLE_DIRECTORY_H_ 667 #endif // SYNC_SYNCABLE_DIRECTORY_H_
OLDNEW
« no previous file with comments | « sync/engine/syncer_unittest.cc ('k') | sync/syncable/directory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698