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

Side by Side Diff: chrome/browser/sync/syncable/syncable.h

Issue 4683003: Sending the proto files for review to unblcok the server team Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « chrome/browser/sync/syncable/model_type.cc ('k') | chrome/browser/sync/syncable/syncable.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_ 5 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_
6 #define CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_ 6 #define CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <bitset> 10 #include <bitset>
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 768
769 // Unique to each account / client pair. 769 // Unique to each account / client pair.
770 std::string cache_guid() const; 770 std::string cache_guid() const;
771 771
772 browser_sync::ChannelHookup<DirectoryChangeEvent>* AddChangeObserver( 772 browser_sync::ChannelHookup<DirectoryChangeEvent>* AddChangeObserver(
773 browser_sync::ChannelEventHandler<DirectoryChangeEvent>* observer); 773 browser_sync::ChannelEventHandler<DirectoryChangeEvent>* observer);
774 774
775 protected: // for friends, mainly used by Entry constructors 775 protected: // for friends, mainly used by Entry constructors
776 EntryKernel* GetEntryByHandle(const int64 handle); 776 EntryKernel* GetEntryByHandle(const int64 handle);
777 EntryKernel* GetEntryByHandle(const int64 metahandle, ScopedKernelLock* lock); 777 EntryKernel* GetEntryByHandle(const int64 metahandle, ScopedKernelLock* lock);
778 EntryKernel* GetEntryById(const Id& id); 778 virtual EntryKernel* GetEntryById(const Id& id);
779 EntryKernel* GetEntryByServerTag(const std::string& tag); 779 EntryKernel* GetEntryByServerTag(const std::string& tag);
780 EntryKernel* GetEntryByClientTag(const std::string& tag); 780 virtual EntryKernel* GetEntryByClientTag(const std::string& tag);
781 EntryKernel* GetRootEntry(); 781 EntryKernel* GetRootEntry();
782 bool ReindexId(EntryKernel* const entry, const Id& new_id); 782 bool ReindexId(EntryKernel* const entry, const Id& new_id);
783 void ReindexParentId(EntryKernel* const entry, const Id& new_parent_id); 783 void ReindexParentId(EntryKernel* const entry, const Id& new_parent_id);
784 void ClearDirtyMetahandles(); 784 void ClearDirtyMetahandles();
785 785
786 // These don't do semantic checking. 786 // These don't do semantic checking.
787 // The semantic checking is implemented higher up. 787 // The semantic checking is implemented higher up.
788 void Undelete(EntryKernel* const entry); 788 void Undelete(EntryKernel* const entry);
789 void Delete(EntryKernel* const entry); 789 void Delete(EntryKernel* const entry);
790 void UnlinkEntryFromOrder(EntryKernel* entry, 790 void UnlinkEntryFromOrder(EntryKernel* entry,
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 public: 1051 public:
1052 inline Directory* directory() const { return directory_; } 1052 inline Directory* directory() const { return directory_; }
1053 inline Id root_id() const { return Id(); } 1053 inline Id root_id() const { return Id(); }
1054 1054
1055 virtual ~BaseTransaction(); 1055 virtual ~BaseTransaction();
1056 1056
1057 protected: 1057 protected:
1058 BaseTransaction(Directory* directory, const char* name, 1058 BaseTransaction(Directory* directory, const char* name,
1059 const char* source_file, int line, WriterTag writer); 1059 const char* source_file, int line, WriterTag writer);
1060 1060
1061 // For unit testing. Everything will be mocked out no point initializing.
1062 BaseTransaction(Directory* directory);
1063
1061 void UnlockAndLog(OriginalEntries* entries); 1064 void UnlockAndLog(OriginalEntries* entries);
1062 bool NotifyTransactionChangingAndEnding(OriginalEntries* entries); 1065 bool NotifyTransactionChangingAndEnding(OriginalEntries* entries);
1063 virtual void NotifyTransactionComplete(); 1066 virtual void NotifyTransactionComplete();
1064 1067
1065 Directory* const directory_; 1068 Directory* const directory_;
1066 Directory::Kernel* const dirkernel_; // for brevity 1069 Directory::Kernel* const dirkernel_; // for brevity
1067 const char* const name_; 1070 const char* const name_;
1068 base::TimeTicks time_acquired_; 1071 base::TimeTicks time_acquired_;
1069 const char* const source_file_; 1072 const char* const source_file_;
1070 const int line_; 1073 const int line_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 virtual ~WriteTransaction(); 1108 virtual ~WriteTransaction();
1106 1109
1107 void SaveOriginal(EntryKernel* entry); 1110 void SaveOriginal(EntryKernel* entry);
1108 1111
1109 protected: 1112 protected:
1110 // Before an entry gets modified, we copy the original into a list 1113 // Before an entry gets modified, we copy the original into a list
1111 // so that we can issue change notifications when the transaction 1114 // so that we can issue change notifications when the transaction
1112 // is done. 1115 // is done.
1113 OriginalEntries* const originals_; 1116 OriginalEntries* const originals_;
1114 1117
1118 WriteTransaction(Directory *directory);
1119
1115 DISALLOW_COPY_AND_ASSIGN(WriteTransaction); 1120 DISALLOW_COPY_AND_ASSIGN(WriteTransaction);
1116 }; 1121 };
1117 1122
1118 bool IsLegalNewParent(BaseTransaction* trans, const Id& id, const Id& parentid); 1123 bool IsLegalNewParent(BaseTransaction* trans, const Id& id, const Id& parentid);
1119 int ComparePathNames(const std::string& a, const std::string& b); 1124 int ComparePathNames(const std::string& a, const std::string& b);
1120 1125
1121 // Exposed in header as this is used as a sqlite3 callback. 1126 // Exposed in header as this is used as a sqlite3 callback.
1122 int ComparePathNames16(void*, int a_bytes, const void* a, int b_bytes, 1127 int ComparePathNames16(void*, int a_bytes, const void* a, int b_bytes,
1123 const void* b); 1128 const void* b);
1124 1129
1125 int64 Now(); 1130 int64 Now();
1126 1131
1127 // This function sets only the flags needed to get this entry to sync. 1132 // This function sets only the flags needed to get this entry to sync.
1128 void MarkForSyncing(syncable::MutableEntry* e); 1133 void MarkForSyncing(syncable::MutableEntry* e);
1129 1134
1130 // This is not a reset. It just sets the numeric fields which are not 1135 // This is not a reset. It just sets the numeric fields which are not
1131 // initialized by the constructor to zero. 1136 // initialized by the constructor to zero.
1132 void ZeroFields(EntryKernel* entry, int first_field); 1137 void ZeroFields(EntryKernel* entry, int first_field);
1133 1138
1134 } // namespace syncable 1139 } // namespace syncable
1135 1140
1136 std::ostream& operator <<(std::ostream&, const syncable::Blob&); 1141 std::ostream& operator <<(std::ostream&, const syncable::Blob&);
1137 1142
1138 browser_sync::FastDump& operator << 1143 browser_sync::FastDump& operator <<
1139 (browser_sync::FastDump&, const syncable::Blob&); 1144 (browser_sync::FastDump&, const syncable::Blob&);
1140 1145
1141 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_ 1146 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/syncable/model_type.cc ('k') | chrome/browser/sync/syncable/syncable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698