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

Side by Side Diff: components/sync_driver/generic_change_processor.h

Issue 247983002: Keep track of which attachments are referenced by which sync entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix "copy yourself bug". Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ 5 #ifndef COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_
6 #define COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ 6 #define COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 virtual bool SyncModelHasUserCreatedNodes(syncer::ModelType type, 91 virtual bool SyncModelHasUserCreatedNodes(syncer::ModelType type,
92 bool* has_nodes); 92 bool* has_nodes);
93 virtual bool CryptoReadyIfNecessary(syncer::ModelType type); 93 virtual bool CryptoReadyIfNecessary(syncer::ModelType type);
94 94
95 protected: 95 protected:
96 // ChangeProcessor interface. 96 // ChangeProcessor interface.
97 virtual void StartImpl() OVERRIDE; // Does nothing. 97 virtual void StartImpl() OVERRIDE; // Does nothing.
98 virtual syncer::UserShare* share_handle() const OVERRIDE; 98 virtual syncer::UserShare* share_handle() const OVERRIDE;
99 99
100 private: 100 private:
101 // Helper methods for acting on changes coming from the datatype. These are 101 // Logically part of ProcessSyncChanges.
102 // logically part of ProcessSyncChanges. 102 //
103 // |new_attachments| is an output parameter containing newly added attachments
104 // that need to be stored. This method will append to it.
103 syncer::SyncError HandleActionAdd(const syncer::SyncChange& change, 105 syncer::SyncError HandleActionAdd(const syncer::SyncChange& change,
104 const std::string& type_str, 106 const std::string& type_str,
105 const syncer::ModelType& type, 107 const syncer::ModelType& type,
106 const syncer::WriteTransaction& trans, 108 const syncer::WriteTransaction& trans,
107 syncer::WriteNode* sync_node); 109 syncer::WriteNode* sync_node,
108 syncer::SyncError HandleActionUpdate(const syncer::SyncChange& change, 110 syncer::AttachmentList* new_attachments);
109 const std::string& type_str, 111
110 const syncer::ModelType& type, 112 // Logically part of ProcessSyncChanges.
111 const syncer::WriteTransaction& trans, 113 //
112 syncer::WriteNode* sync_node); 114 // |new_attachments| is an output parameter containing newly added attachments
115 // that need to be stored. This method will append to it.
116 syncer::SyncError HandleActionUpdate(
117 const syncer::SyncChange& change,
118 const std::string& type_str,
119 const syncer::ModelType& type,
120 const syncer::WriteTransaction& trans,
121 syncer::WriteNode* sync_node,
122 syncer::AttachmentList* new_attachments);
113 123
114 // The SyncableService this change processor will forward changes on to. 124 // The SyncableService this change processor will forward changes on to.
115 const base::WeakPtr<syncer::SyncableService> local_service_; 125 const base::WeakPtr<syncer::SyncableService> local_service_;
116 126
117 // A SyncMergeResult used to track the changes made during association. The 127 // A SyncMergeResult used to track the changes made during association. The
118 // owner will invalidate the weak pointer when association is complete. While 128 // owner will invalidate the weak pointer when association is complete. While
119 // the pointer is valid though, we increment it with any changes received 129 // the pointer is valid though, we increment it with any changes received
120 // via ProcessSyncChanges. 130 // via ProcessSyncChanges.
121 const base::WeakPtr<syncer::SyncMergeResult> merge_result_; 131 const base::WeakPtr<syncer::SyncMergeResult> merge_result_;
122 132
(...skipping 16 matching lines...) Expand all
139 base::WeakPtrFactory<syncer::AttachmentService> 149 base::WeakPtrFactory<syncer::AttachmentService>
140 attachment_service_weak_ptr_factory_; 150 attachment_service_weak_ptr_factory_;
141 syncer::AttachmentServiceProxy attachment_service_proxy_; 151 syncer::AttachmentServiceProxy attachment_service_proxy_;
142 152
143 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); 153 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor);
144 }; 154 };
145 155
146 } // namespace browser_sync 156 } // namespace browser_sync
147 157
148 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ 158 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_
OLDNEW
« no previous file with comments | « no previous file | components/sync_driver/generic_change_processor.cc » ('j') | components/sync_driver/generic_change_processor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698