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

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

Issue 264793007: Keep track of which attachments are referenced by which sync entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory leak. Created 6 years, 7 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
« no previous file with comments | « no previous file | components/sync_driver/generic_change_processor.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 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,
110 syncer::AttachmentList* new_attachments);
111
112 // Logically part of ProcessSyncChanges.
113 //
114 // |new_attachments| is an output parameter containing newly added attachments
115 // that need to be stored. This method will append to it.
108 syncer::SyncError HandleActionUpdate(const syncer::SyncChange& change, 116 syncer::SyncError HandleActionUpdate(const syncer::SyncChange& change,
109 const std::string& type_str, 117 const std::string& type_str,
110 const syncer::ModelType& type, 118 const syncer::ModelType& type,
111 const syncer::WriteTransaction& trans, 119 const syncer::WriteTransaction& trans,
112 syncer::WriteNode* sync_node); 120 syncer::WriteNode* sync_node,
121 syncer::AttachmentList* new_attachments);
113 122
114 // The SyncableService this change processor will forward changes on to. 123 // The SyncableService this change processor will forward changes on to.
115 const base::WeakPtr<syncer::SyncableService> local_service_; 124 const base::WeakPtr<syncer::SyncableService> local_service_;
116 125
117 // A SyncMergeResult used to track the changes made during association. The 126 // A SyncMergeResult used to track the changes made during association. The
118 // owner will invalidate the weak pointer when association is complete. While 127 // owner will invalidate the weak pointer when association is complete. While
119 // the pointer is valid though, we increment it with any changes received 128 // the pointer is valid though, we increment it with any changes received
120 // via ProcessSyncChanges. 129 // via ProcessSyncChanges.
121 const base::WeakPtr<syncer::SyncMergeResult> merge_result_; 130 const base::WeakPtr<syncer::SyncMergeResult> merge_result_;
122 131
(...skipping 16 matching lines...) Expand all
139 base::WeakPtrFactory<syncer::AttachmentService> 148 base::WeakPtrFactory<syncer::AttachmentService>
140 attachment_service_weak_ptr_factory_; 149 attachment_service_weak_ptr_factory_;
141 syncer::AttachmentServiceProxy attachment_service_proxy_; 150 syncer::AttachmentServiceProxy attachment_service_proxy_;
142 151
143 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor); 152 DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor);
144 }; 153 };
145 154
146 } // namespace browser_sync 155 } // namespace browser_sync
147 156
148 #endif // COMPONENTS_SYNC_DRIVER_GENERIC_CHANGE_PROCESSOR_H_ 157 #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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698