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

Side by Side Diff: chrome/browser/sync/engine/syncapi.h

Issue 2815009: Client side changes to set and get nigori specifics. (Closed)
Patch Set: Created 10 years, 6 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 | « no previous file | chrome/browser/sync/engine/syncapi.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // This file defines the "sync API", an interface to the syncer 5 // This file defines the "sync API", an interface to the syncer
6 // backend that exposes (1) the core functionality of maintaining a consistent 6 // backend that exposes (1) the core functionality of maintaining a consistent
7 // local snapshot of a hierarchical object set; (2) a means to transactionally 7 // local snapshot of a hierarchical object set; (2) a means to transactionally
8 // access and modify those objects; (3) a means to control client/server 8 // access and modify those objects; (3) a means to control client/server
9 // synchronization tasks, namely: pushing local object modifications to a 9 // synchronization tasks, namely: pushing local object modifications to a
10 // server, pulling nonlocal object modifications from a server to this client, 10 // server, pulling nonlocal object modifications from a server to this client,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 class ReadTransaction; 73 class ReadTransaction;
74 class ScopedDirLookup; 74 class ScopedDirLookup;
75 class WriteTransaction; 75 class WriteTransaction;
76 } 76 }
77 77
78 namespace sync_pb { 78 namespace sync_pb {
79 class AutofillSpecifics; 79 class AutofillSpecifics;
80 class BookmarkSpecifics; 80 class BookmarkSpecifics;
81 class EntitySpecifics; 81 class EntitySpecifics;
82 class ExtensionSpecifics; 82 class ExtensionSpecifics;
83 class NigoriSpecifics;
83 class PasswordSpecifics; 84 class PasswordSpecifics;
84 class PreferenceSpecifics; 85 class PreferenceSpecifics;
85 class PasswordSpecifics; 86 class PasswordSpecifics;
86 class PasswordSpecificsData; 87 class PasswordSpecificsData;
87 class ThemeSpecifics; 88 class ThemeSpecifics;
88 class TypedUrlSpecifics; 89 class TypedUrlSpecifics;
89 } 90 }
90 91
91 namespace sync_api { 92 namespace sync_api {
92 93
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // Favicons are expected to be PNG images, and though no verification is 174 // Favicons are expected to be PNG images, and though no verification is
174 // done on the syncapi client of this, the server may reject favicon updates 175 // done on the syncapi client of this, the server may reject favicon updates
175 // that are invalid for whatever reason. 176 // that are invalid for whatever reason.
176 // TODO(ncarter): Remove this datatype-specific accessor. 177 // TODO(ncarter): Remove this datatype-specific accessor.
177 void GetFaviconBytes(std::vector<unsigned char>* output) const; 178 void GetFaviconBytes(std::vector<unsigned char>* output) const;
178 179
179 // Getter specific to the AUTOFILL datatype. Returns protobuf 180 // Getter specific to the AUTOFILL datatype. Returns protobuf
180 // data. Can only be called if GetModelType() == AUTOFILL. 181 // data. Can only be called if GetModelType() == AUTOFILL.
181 const sync_pb::AutofillSpecifics& GetAutofillSpecifics() const; 182 const sync_pb::AutofillSpecifics& GetAutofillSpecifics() const;
182 183
184 // Getter specific to the NIGORI datatype. Returns protobuf
185 // data. Can only be called if GetModelType() == NIGORI.
186 const sync_pb::NigoriSpecifics& GetNigoriSpecifics() const;
187
183 // Getter specific to the PASSWORD datatype. Returns protobuf 188 // Getter specific to the PASSWORD datatype. Returns protobuf
184 // data. Can only be called if GetModelType() == PASSWORD. 189 // data. Can only be called if GetModelType() == PASSWORD.
185 bool GetPasswordSpecifics(sync_pb::PasswordSpecificsData*) const; 190 bool GetPasswordSpecifics(sync_pb::PasswordSpecificsData*) const;
186 191
187 // Getter specific to the PREFERENCE datatype. Returns protobuf 192 // Getter specific to the PREFERENCE datatype. Returns protobuf
188 // data. Can only be called if GetModelType() == PREFERENCE. 193 // data. Can only be called if GetModelType() == PREFERENCE.
189 const sync_pb::PreferenceSpecifics& GetPreferenceSpecifics() const; 194 const sync_pb::PreferenceSpecifics& GetPreferenceSpecifics() const;
190 195
191 // Getter specific to the THEME datatype. Returns protobuf 196 // Getter specific to the THEME datatype. Returns protobuf
192 // data. Can only be called if GetModelType() == THEME. 197 // data. Can only be called if GetModelType() == THEME.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // Legacy, bookmark-specific setters that wrap SetBookmarkSpecifics() above. 301 // Legacy, bookmark-specific setters that wrap SetBookmarkSpecifics() above.
297 // Should only be called if GetModelType() == BOOKMARK. 302 // Should only be called if GetModelType() == BOOKMARK.
298 // TODO(ncarter): Remove these two datatype-specific accessors. 303 // TODO(ncarter): Remove these two datatype-specific accessors.
299 void SetURL(const GURL& url); 304 void SetURL(const GURL& url);
300 void SetFaviconBytes(const std::vector<unsigned char>& bytes); 305 void SetFaviconBytes(const std::vector<unsigned char>& bytes);
301 306
302 // Set the autofill specifics (name and value). 307 // Set the autofill specifics (name and value).
303 // Should only be called if GetModelType() == AUTOFILL. 308 // Should only be called if GetModelType() == AUTOFILL.
304 void SetAutofillSpecifics(const sync_pb::AutofillSpecifics& specifics); 309 void SetAutofillSpecifics(const sync_pb::AutofillSpecifics& specifics);
305 310
311 // Set the nigori specifics.
312 // Should only be called if GetModelType() == NIGORI.
313 void SetNigoriSpecifics(const sync_pb::NigoriSpecifics& specifics);
314
306 // Set the password specifics. 315 // Set the password specifics.
307 // Should only be called if GetModelType() == PASSWORD. 316 // Should only be called if GetModelType() == PASSWORD.
308 void SetPasswordSpecifics(const sync_pb::PasswordSpecificsData& specifics); 317 void SetPasswordSpecifics(const sync_pb::PasswordSpecificsData& specifics);
309 318
310 // Set the preference specifics (name and value). 319 // Set the preference specifics (name and value).
311 // Should only be called if GetModelType() == PREFERENCE. 320 // Should only be called if GetModelType() == PREFERENCE.
312 void SetPreferenceSpecifics(const sync_pb::PreferenceSpecifics& specifics); 321 void SetPreferenceSpecifics(const sync_pb::PreferenceSpecifics& specifics);
313 322
314 // Set the theme specifics (name and value). 323 // Set the theme specifics (name and value).
315 // Should only be called if GetModelType() == THEME. 324 // Should only be called if GetModelType() == THEME.
(...skipping 23 matching lines...) Expand all
339 348
340 // Private helpers to set type-specific protobuf data. These don't 349 // Private helpers to set type-specific protobuf data. These don't
341 // do any checking on the previous modeltype, so they can be used 350 // do any checking on the previous modeltype, so they can be used
342 // for internal initialization (you can use them to set the modeltype). 351 // for internal initialization (you can use them to set the modeltype).
343 // Additionally, they will mark for syncing if the underlying value 352 // Additionally, they will mark for syncing if the underlying value
344 // changes. 353 // changes.
345 void PutAutofillSpecificsAndMarkForSyncing( 354 void PutAutofillSpecificsAndMarkForSyncing(
346 const sync_pb::AutofillSpecifics& new_value); 355 const sync_pb::AutofillSpecifics& new_value);
347 void PutBookmarkSpecificsAndMarkForSyncing( 356 void PutBookmarkSpecificsAndMarkForSyncing(
348 const sync_pb::BookmarkSpecifics& new_value); 357 const sync_pb::BookmarkSpecifics& new_value);
358 void PutNigoriSpecificsAndMarkForSyncing(
359 const sync_pb::NigoriSpecifics& new_value);
349 void PutPasswordSpecificsAndMarkForSyncing( 360 void PutPasswordSpecificsAndMarkForSyncing(
350 const sync_pb::PasswordSpecifics& new_value); 361 const sync_pb::PasswordSpecifics& new_value);
351 void PutPreferenceSpecificsAndMarkForSyncing( 362 void PutPreferenceSpecificsAndMarkForSyncing(
352 const sync_pb::PreferenceSpecifics& new_value); 363 const sync_pb::PreferenceSpecifics& new_value);
353 void PutThemeSpecificsAndMarkForSyncing( 364 void PutThemeSpecificsAndMarkForSyncing(
354 const sync_pb::ThemeSpecifics& new_value); 365 const sync_pb::ThemeSpecifics& new_value);
355 void PutTypedUrlSpecificsAndMarkForSyncing( 366 void PutTypedUrlSpecificsAndMarkForSyncing(
356 const sync_pb::TypedUrlSpecifics& new_value); 367 const sync_pb::TypedUrlSpecifics& new_value);
357 void PutExtensionSpecificsAndMarkForSyncing( 368 void PutExtensionSpecificsAndMarkForSyncing(
358 const sync_pb::ExtensionSpecifics& new_value); 369 const sync_pb::ExtensionSpecifics& new_value);
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 // This allows actual HttpPostProvider subclass implementations to be 867 // This allows actual HttpPostProvider subclass implementations to be
857 // reference counted, which is useful if a particular implementation uses 868 // reference counted, which is useful if a particular implementation uses
858 // multiple threads to serve network requests. 869 // multiple threads to serve network requests.
859 virtual void Destroy(HttpPostProviderInterface* http) = 0; 870 virtual void Destroy(HttpPostProviderInterface* http) = 0;
860 virtual ~HttpPostProviderFactory() { } 871 virtual ~HttpPostProviderFactory() { }
861 }; 872 };
862 873
863 } // namespace sync_api 874 } // namespace sync_api
864 875
865 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ 876 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/engine/syncapi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698