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

Side by Side Diff: sync/internal_api/write_node.cc

Issue 10696087: [Sync] Move ModelType and related classes to 'syncer' namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sort headers, update copyrights Created 8 years, 5 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 | « sync/internal_api/test/test_entry_factory.cc ('k') | sync/notifier/invalidation_notifier.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "sync/internal_api/public/write_node.h" 5 #include "sync/internal_api/public/write_node.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "sync/internal_api/public/base_transaction.h" 9 #include "sync/internal_api/public/base_transaction.h"
10 #include "sync/internal_api/public/write_transaction.h" 10 #include "sync/internal_api/public/write_transaction.h"
(...skipping 22 matching lines...) Expand all
33 33
34 void WriteNode::SetIsFolder(bool folder) { 34 void WriteNode::SetIsFolder(bool folder) {
35 if (entry_->Get(syncable::IS_DIR) == folder) 35 if (entry_->Get(syncable::IS_DIR) == folder)
36 return; // Skip redundant changes. 36 return; // Skip redundant changes.
37 37
38 entry_->Put(syncable::IS_DIR, folder); 38 entry_->Put(syncable::IS_DIR, folder);
39 MarkForSyncing(); 39 MarkForSyncing();
40 } 40 }
41 41
42 void WriteNode::SetTitle(const std::wstring& title) { 42 void WriteNode::SetTitle(const std::wstring& title) {
43 DCHECK_NE(GetModelType(), syncable::UNSPECIFIED); 43 DCHECK_NE(GetModelType(), syncer::UNSPECIFIED);
44 syncable::ModelType type = GetModelType(); 44 syncer::ModelType type = GetModelType();
45 Cryptographer* cryptographer = GetTransaction()->GetCryptographer(); 45 Cryptographer* cryptographer = GetTransaction()->GetCryptographer();
46 // It's possible the nigori lost the set of encrypted types. If the current 46 // It's possible the nigori lost the set of encrypted types. If the current
47 // specifics are already encrypted, we want to ensure we continue encrypting. 47 // specifics are already encrypted, we want to ensure we continue encrypting.
48 bool needs_encryption = cryptographer->GetEncryptedTypes().Has(type) || 48 bool needs_encryption = cryptographer->GetEncryptedTypes().Has(type) ||
49 entry_->Get(SPECIFICS).has_encrypted(); 49 entry_->Get(SPECIFICS).has_encrypted();
50 50
51 // If this datatype is encrypted and is not a bookmark, we disregard the 51 // If this datatype is encrypted and is not a bookmark, we disregard the
52 // specified title in favor of kEncryptedString. For encrypted bookmarks the 52 // specified title in favor of kEncryptedString. For encrypted bookmarks the
53 // NON_UNIQUE_NAME will still be kEncryptedString, but we store the real title 53 // NON_UNIQUE_NAME will still be kEncryptedString, but we store the real title
54 // into the specifics. All strings compared are server legal strings. 54 // into the specifics. All strings compared are server legal strings.
55 std::string new_legal_title; 55 std::string new_legal_title;
56 if (type != syncable::BOOKMARKS && needs_encryption) { 56 if (type != syncer::BOOKMARKS && needs_encryption) {
57 new_legal_title = kEncryptedString; 57 new_legal_title = kEncryptedString;
58 } else { 58 } else {
59 SyncAPINameToServerName(WideToUTF8(title), &new_legal_title); 59 SyncAPINameToServerName(WideToUTF8(title), &new_legal_title);
60 } 60 }
61 61
62 std::string current_legal_title; 62 std::string current_legal_title;
63 if (syncable::BOOKMARKS == type && 63 if (syncer::BOOKMARKS == type &&
64 entry_->Get(syncable::SPECIFICS).has_encrypted()) { 64 entry_->Get(syncable::SPECIFICS).has_encrypted()) {
65 // Encrypted bookmarks only have their title in the unencrypted specifics. 65 // Encrypted bookmarks only have their title in the unencrypted specifics.
66 current_legal_title = GetBookmarkSpecifics().title(); 66 current_legal_title = GetBookmarkSpecifics().title();
67 } else { 67 } else {
68 // Non-bookmarks and legacy bookmarks (those with no title in their 68 // Non-bookmarks and legacy bookmarks (those with no title in their
69 // specifics) store their title in NON_UNIQUE_NAME. Non-legacy bookmarks 69 // specifics) store their title in NON_UNIQUE_NAME. Non-legacy bookmarks
70 // store their title in specifics as well as NON_UNIQUE_NAME. 70 // store their title in specifics as well as NON_UNIQUE_NAME.
71 current_legal_title = entry_->Get(syncable::NON_UNIQUE_NAME); 71 current_legal_title = entry_->Get(syncable::NON_UNIQUE_NAME);
72 } 72 }
73 73
74 bool title_matches = (current_legal_title == new_legal_title); 74 bool title_matches = (current_legal_title == new_legal_title);
75 bool encrypted_without_overwriting_name = (needs_encryption && 75 bool encrypted_without_overwriting_name = (needs_encryption &&
76 entry_->Get(syncable::NON_UNIQUE_NAME) != kEncryptedString); 76 entry_->Get(syncable::NON_UNIQUE_NAME) != kEncryptedString);
77 77
78 // If the title matches and the NON_UNIQUE_NAME is properly overwritten as 78 // If the title matches and the NON_UNIQUE_NAME is properly overwritten as
79 // necessary, nothing needs to change. 79 // necessary, nothing needs to change.
80 if (title_matches && !encrypted_without_overwriting_name) { 80 if (title_matches && !encrypted_without_overwriting_name) {
81 DVLOG(2) << "Title matches, dropping change."; 81 DVLOG(2) << "Title matches, dropping change.";
82 return; 82 return;
83 } 83 }
84 84
85 // For bookmarks, we also set the title field in the specifics. 85 // For bookmarks, we also set the title field in the specifics.
86 // TODO(zea): refactor bookmarks to not need this functionality. 86 // TODO(zea): refactor bookmarks to not need this functionality.
87 if (GetModelType() == syncable::BOOKMARKS) { 87 if (GetModelType() == syncer::BOOKMARKS) {
88 sync_pb::EntitySpecifics specifics = GetEntitySpecifics(); 88 sync_pb::EntitySpecifics specifics = GetEntitySpecifics();
89 specifics.mutable_bookmark()->set_title(new_legal_title); 89 specifics.mutable_bookmark()->set_title(new_legal_title);
90 SetEntitySpecifics(specifics); // Does it's own encryption checking. 90 SetEntitySpecifics(specifics); // Does it's own encryption checking.
91 } 91 }
92 92
93 // For bookmarks, this has to happen after we set the title in the specifics, 93 // For bookmarks, this has to happen after we set the title in the specifics,
94 // because the presence of a title in the NON_UNIQUE_NAME is what controls 94 // because the presence of a title in the NON_UNIQUE_NAME is what controls
95 // the logic deciding whether this is an empty node or a legacy bookmark. 95 // the logic deciding whether this is an empty node or a legacy bookmark.
96 // See BaseNode::GetUnencryptedSpecific(..). 96 // See BaseNode::GetUnencryptedSpecific(..).
97 if (needs_encryption) 97 if (needs_encryption)
98 entry_->Put(syncable::NON_UNIQUE_NAME, kEncryptedString); 98 entry_->Put(syncable::NON_UNIQUE_NAME, kEncryptedString);
99 else 99 else
100 entry_->Put(syncable::NON_UNIQUE_NAME, new_legal_title); 100 entry_->Put(syncable::NON_UNIQUE_NAME, new_legal_title);
101 101
102 DVLOG(1) << "Overwriting title of type " 102 DVLOG(1) << "Overwriting title of type "
103 << syncable::ModelTypeToString(type) 103 << syncer::ModelTypeToString(type)
104 << " and marking for syncing."; 104 << " and marking for syncing.";
105 MarkForSyncing(); 105 MarkForSyncing();
106 } 106 }
107 107
108 void WriteNode::SetURL(const GURL& url) { 108 void WriteNode::SetURL(const GURL& url) {
109 sync_pb::BookmarkSpecifics new_value = GetBookmarkSpecifics(); 109 sync_pb::BookmarkSpecifics new_value = GetBookmarkSpecifics();
110 new_value.set_url(url.spec()); 110 new_value.set_url(url.spec());
111 SetBookmarkSpecifics(new_value); 111 SetBookmarkSpecifics(new_value);
112 } 112 }
113 113
(...skipping 28 matching lines...) Expand all
142 142
143 void WriteNode::SetNigoriSpecifics( 143 void WriteNode::SetNigoriSpecifics(
144 const sync_pb::NigoriSpecifics& new_value) { 144 const sync_pb::NigoriSpecifics& new_value) {
145 sync_pb::EntitySpecifics entity_specifics; 145 sync_pb::EntitySpecifics entity_specifics;
146 entity_specifics.mutable_nigori()->CopyFrom(new_value); 146 entity_specifics.mutable_nigori()->CopyFrom(new_value);
147 SetEntitySpecifics(entity_specifics); 147 SetEntitySpecifics(entity_specifics);
148 } 148 }
149 149
150 void WriteNode::SetPasswordSpecifics( 150 void WriteNode::SetPasswordSpecifics(
151 const sync_pb::PasswordSpecificsData& data) { 151 const sync_pb::PasswordSpecificsData& data) {
152 DCHECK_EQ(syncable::PASSWORDS, GetModelType()); 152 DCHECK_EQ(syncer::PASSWORDS, GetModelType());
153 153
154 Cryptographer* cryptographer = GetTransaction()->GetCryptographer(); 154 Cryptographer* cryptographer = GetTransaction()->GetCryptographer();
155 155
156 // We have to do the idempotency check here (vs in UpdateEntryWithEncryption) 156 // We have to do the idempotency check here (vs in UpdateEntryWithEncryption)
157 // because Passwords have their encrypted data within the PasswordSpecifics, 157 // because Passwords have their encrypted data within the PasswordSpecifics,
158 // vs within the EntitySpecifics like all the other types. 158 // vs within the EntitySpecifics like all the other types.
159 const sync_pb::EntitySpecifics& old_specifics = GetEntry()->Get(SPECIFICS); 159 const sync_pb::EntitySpecifics& old_specifics = GetEntry()->Get(SPECIFICS);
160 sync_pb::EntitySpecifics entity_specifics; 160 sync_pb::EntitySpecifics entity_specifics;
161 // Copy over the old specifics if they exist. 161 // Copy over the old specifics if they exist.
162 if (syncable::GetModelTypeFromSpecifics(old_specifics) == 162 if (syncer::GetModelTypeFromSpecifics(old_specifics) == syncer::PASSWORDS) {
163 syncable::PASSWORDS) {
164 entity_specifics.CopyFrom(old_specifics); 163 entity_specifics.CopyFrom(old_specifics);
165 } else { 164 } else {
166 syncable::AddDefaultFieldValue(syncable::PASSWORDS, 165 syncer::AddDefaultFieldValue(syncer::PASSWORDS, &entity_specifics);
167 &entity_specifics);
168 } 166 }
169 sync_pb::PasswordSpecifics* password_specifics = 167 sync_pb::PasswordSpecifics* password_specifics =
170 entity_specifics.mutable_password(); 168 entity_specifics.mutable_password();
171 // This will only update password_specifics if the underlying unencrypted blob 169 // This will only update password_specifics if the underlying unencrypted blob
172 // was different from |data| or was not encrypted with the proper passphrase. 170 // was different from |data| or was not encrypted with the proper passphrase.
173 if (!cryptographer->Encrypt(data, password_specifics->mutable_encrypted())) { 171 if (!cryptographer->Encrypt(data, password_specifics->mutable_encrypted())) {
174 NOTREACHED() << "Failed to encrypt password, possibly due to sync node " 172 NOTREACHED() << "Failed to encrypt password, possibly due to sync node "
175 << "corruption"; 173 << "corruption";
176 return; 174 return;
177 } 175 }
178 SetEntitySpecifics(entity_specifics); 176 SetEntitySpecifics(entity_specifics);
179 } 177 }
180 178
181 void WriteNode::SetThemeSpecifics( 179 void WriteNode::SetThemeSpecifics(
182 const sync_pb::ThemeSpecifics& new_value) { 180 const sync_pb::ThemeSpecifics& new_value) {
183 sync_pb::EntitySpecifics entity_specifics; 181 sync_pb::EntitySpecifics entity_specifics;
184 entity_specifics.mutable_theme()->CopyFrom(new_value); 182 entity_specifics.mutable_theme()->CopyFrom(new_value);
185 SetEntitySpecifics(entity_specifics); 183 SetEntitySpecifics(entity_specifics);
186 } 184 }
187 185
188 void WriteNode::SetSessionSpecifics( 186 void WriteNode::SetSessionSpecifics(
189 const sync_pb::SessionSpecifics& new_value) { 187 const sync_pb::SessionSpecifics& new_value) {
190 sync_pb::EntitySpecifics entity_specifics; 188 sync_pb::EntitySpecifics entity_specifics;
191 entity_specifics.mutable_session()->CopyFrom(new_value); 189 entity_specifics.mutable_session()->CopyFrom(new_value);
192 SetEntitySpecifics(entity_specifics); 190 SetEntitySpecifics(entity_specifics);
193 } 191 }
194 192
195 void WriteNode::SetEntitySpecifics( 193 void WriteNode::SetEntitySpecifics(
196 const sync_pb::EntitySpecifics& new_value) { 194 const sync_pb::EntitySpecifics& new_value) {
197 syncable::ModelType new_specifics_type = 195 syncer::ModelType new_specifics_type =
198 syncable::GetModelTypeFromSpecifics(new_value); 196 syncer::GetModelTypeFromSpecifics(new_value);
199 DCHECK_NE(new_specifics_type, syncable::UNSPECIFIED); 197 DCHECK_NE(new_specifics_type, syncer::UNSPECIFIED);
200 DVLOG(1) << "Writing entity specifics of type " 198 DVLOG(1) << "Writing entity specifics of type "
201 << syncable::ModelTypeToString(new_specifics_type); 199 << syncer::ModelTypeToString(new_specifics_type);
202 // GetModelType() can be unspecified if this is the first time this 200 // GetModelType() can be unspecified if this is the first time this
203 // node is being initialized (see PutModelType()). Otherwise, it 201 // node is being initialized (see PutModelType()). Otherwise, it
204 // should match |new_specifics_type|. 202 // should match |new_specifics_type|.
205 if (GetModelType() != syncable::UNSPECIFIED) { 203 if (GetModelType() != syncer::UNSPECIFIED) {
206 DCHECK_EQ(new_specifics_type, GetModelType()); 204 DCHECK_EQ(new_specifics_type, GetModelType());
207 } 205 }
208 syncer::Cryptographer* cryptographer = 206 syncer::Cryptographer* cryptographer =
209 GetTransaction()->GetCryptographer(); 207 GetTransaction()->GetCryptographer();
210 208
211 // Preserve unknown fields. 209 // Preserve unknown fields.
212 const sync_pb::EntitySpecifics& old_specifics = entry_->Get(SPECIFICS); 210 const sync_pb::EntitySpecifics& old_specifics = entry_->Get(SPECIFICS);
213 sync_pb::EntitySpecifics new_specifics; 211 sync_pb::EntitySpecifics new_specifics;
214 new_specifics.CopyFrom(new_value); 212 new_specifics.CopyFrom(new_value);
215 new_specifics.mutable_unknown_fields()->MergeFrom( 213 new_specifics.mutable_unknown_fields()->MergeFrom(
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 return INIT_FAILED_ENTRY_NOT_GOOD; 272 return INIT_FAILED_ENTRY_NOT_GOOD;
275 if (entry_->Get(syncable::IS_DEL)) 273 if (entry_->Get(syncable::IS_DEL))
276 return INIT_FAILED_ENTRY_IS_DEL; 274 return INIT_FAILED_ENTRY_IS_DEL;
277 return DecryptIfNecessary() ? INIT_OK : INIT_FAILED_DECRYPT_IF_NECESSARY; 275 return DecryptIfNecessary() ? INIT_OK : INIT_FAILED_DECRYPT_IF_NECESSARY;
278 } 276 }
279 277
280 // Find a node by client tag, and bind this WriteNode to it. 278 // Find a node by client tag, and bind this WriteNode to it.
281 // Return true if the write node was found, and was not deleted. 279 // Return true if the write node was found, and was not deleted.
282 // Undeleting a deleted node is possible by ClientTag. 280 // Undeleting a deleted node is possible by ClientTag.
283 BaseNode::InitByLookupResult WriteNode::InitByClientTagLookup( 281 BaseNode::InitByLookupResult WriteNode::InitByClientTagLookup(
284 syncable::ModelType model_type, 282 syncer::ModelType model_type,
285 const std::string& tag) { 283 const std::string& tag) {
286 DCHECK(!entry_) << "Init called twice"; 284 DCHECK(!entry_) << "Init called twice";
287 if (tag.empty()) 285 if (tag.empty())
288 return INIT_FAILED_PRECONDITION; 286 return INIT_FAILED_PRECONDITION;
289 287
290 const std::string hash = GenerateSyncableHash(model_type, tag); 288 const std::string hash = GenerateSyncableHash(model_type, tag);
291 289
292 entry_ = new syncable::MutableEntry(transaction_->GetWrappedWriteTrans(), 290 entry_ = new syncable::MutableEntry(transaction_->GetWrappedWriteTrans(),
293 syncable::GET_BY_CLIENT_TAG, hash); 291 syncable::GET_BY_CLIENT_TAG, hash);
294 if (!entry_->good()) 292 if (!entry_->good())
295 return INIT_FAILED_ENTRY_NOT_GOOD; 293 return INIT_FAILED_ENTRY_NOT_GOOD;
296 if (entry_->Get(syncable::IS_DEL)) 294 if (entry_->Get(syncable::IS_DEL))
297 return INIT_FAILED_ENTRY_IS_DEL; 295 return INIT_FAILED_ENTRY_IS_DEL;
298 return DecryptIfNecessary() ? INIT_OK : INIT_FAILED_DECRYPT_IF_NECESSARY; 296 return DecryptIfNecessary() ? INIT_OK : INIT_FAILED_DECRYPT_IF_NECESSARY;
299 } 297 }
300 298
301 BaseNode::InitByLookupResult WriteNode::InitByTagLookup( 299 BaseNode::InitByLookupResult WriteNode::InitByTagLookup(
302 const std::string& tag) { 300 const std::string& tag) {
303 DCHECK(!entry_) << "Init called twice"; 301 DCHECK(!entry_) << "Init called twice";
304 if (tag.empty()) 302 if (tag.empty())
305 return INIT_FAILED_PRECONDITION; 303 return INIT_FAILED_PRECONDITION;
306 entry_ = new syncable::MutableEntry(transaction_->GetWrappedWriteTrans(), 304 entry_ = new syncable::MutableEntry(transaction_->GetWrappedWriteTrans(),
307 syncable::GET_BY_SERVER_TAG, tag); 305 syncable::GET_BY_SERVER_TAG, tag);
308 if (!entry_->good()) 306 if (!entry_->good())
309 return INIT_FAILED_ENTRY_NOT_GOOD; 307 return INIT_FAILED_ENTRY_NOT_GOOD;
310 if (entry_->Get(syncable::IS_DEL)) 308 if (entry_->Get(syncable::IS_DEL))
311 return INIT_FAILED_ENTRY_IS_DEL; 309 return INIT_FAILED_ENTRY_IS_DEL;
312 syncable::ModelType model_type = GetModelType(); 310 syncer::ModelType model_type = GetModelType();
313 DCHECK_EQ(syncable::NIGORI, model_type); 311 DCHECK_EQ(syncer::NIGORI, model_type);
314 return INIT_OK; 312 return INIT_OK;
315 } 313 }
316 314
317 void WriteNode::PutModelType(syncable::ModelType model_type) { 315 void WriteNode::PutModelType(syncer::ModelType model_type) {
318 // Set an empty specifics of the appropriate datatype. The presence 316 // Set an empty specifics of the appropriate datatype. The presence
319 // of the specific field will identify the model type. 317 // of the specific field will identify the model type.
320 DCHECK(GetModelType() == model_type || 318 DCHECK(GetModelType() == model_type ||
321 GetModelType() == syncable::UNSPECIFIED); // Immutable once set. 319 GetModelType() == syncer::UNSPECIFIED); // Immutable once set.
322 320
323 sync_pb::EntitySpecifics specifics; 321 sync_pb::EntitySpecifics specifics;
324 syncable::AddDefaultFieldValue(model_type, &specifics); 322 syncer::AddDefaultFieldValue(model_type, &specifics);
325 SetEntitySpecifics(specifics); 323 SetEntitySpecifics(specifics);
326 } 324 }
327 325
328 // Create a new node with default properties, and bind this WriteNode to it. 326 // Create a new node with default properties, and bind this WriteNode to it.
329 // Return true on success. 327 // Return true on success.
330 bool WriteNode::InitByCreation(syncable::ModelType model_type, 328 bool WriteNode::InitByCreation(syncer::ModelType model_type,
331 const BaseNode& parent, 329 const BaseNode& parent,
332 const BaseNode* predecessor) { 330 const BaseNode* predecessor) {
333 DCHECK(!entry_) << "Init called twice"; 331 DCHECK(!entry_) << "Init called twice";
334 // |predecessor| must be a child of |parent| or NULL. 332 // |predecessor| must be a child of |parent| or NULL.
335 if (predecessor && predecessor->GetParentId() != parent.GetId()) { 333 if (predecessor && predecessor->GetParentId() != parent.GetId()) {
336 DCHECK(false); 334 DCHECK(false);
337 return false; 335 return false;
338 } 336 }
339 337
340 syncable::Id parent_id = parent.GetEntry()->Get(syncable::ID); 338 syncable::Id parent_id = parent.GetEntry()->Get(syncable::ID);
(...skipping 17 matching lines...) Expand all
358 return PutPredecessor(predecessor); 356 return PutPredecessor(predecessor);
359 } 357 }
360 358
361 // Create a new node with default properties and a client defined unique tag, 359 // Create a new node with default properties and a client defined unique tag,
362 // and bind this WriteNode to it. 360 // and bind this WriteNode to it.
363 // Return true on success. If the tag exists in the database, then 361 // Return true on success. If the tag exists in the database, then
364 // we will attempt to undelete the node. 362 // we will attempt to undelete the node.
365 // TODO(chron): Code datatype into hash tag. 363 // TODO(chron): Code datatype into hash tag.
366 // TODO(chron): Is model type ever lost? 364 // TODO(chron): Is model type ever lost?
367 WriteNode::InitUniqueByCreationResult WriteNode::InitUniqueByCreation( 365 WriteNode::InitUniqueByCreationResult WriteNode::InitUniqueByCreation(
368 syncable::ModelType model_type, 366 syncer::ModelType model_type,
369 const BaseNode& parent, 367 const BaseNode& parent,
370 const std::string& tag) { 368 const std::string& tag) {
371 // This DCHECK will only fail if init is called twice. 369 // This DCHECK will only fail if init is called twice.
372 DCHECK(!entry_); 370 DCHECK(!entry_);
373 if (tag.empty()) { 371 if (tag.empty()) {
374 LOG(WARNING) << "InitUniqueByCreation failed due to empty tag."; 372 LOG(WARNING) << "InitUniqueByCreation failed due to empty tag.";
375 return INIT_FAILED_EMPTY_TAG; 373 return INIT_FAILED_EMPTY_TAG;
376 } 374 }
377 375
378 const std::string hash = GenerateSyncableHash(model_type, tag); 376 const std::string hash = GenerateSyncableHash(model_type, tag);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 sync_pb::BookmarkSpecifics new_value = GetBookmarkSpecifics(); 501 sync_pb::BookmarkSpecifics new_value = GetBookmarkSpecifics();
504 new_value.set_favicon(bytes.empty() ? NULL : &bytes[0], bytes.size()); 502 new_value.set_favicon(bytes.empty() ? NULL : &bytes[0], bytes.size());
505 SetBookmarkSpecifics(new_value); 503 SetBookmarkSpecifics(new_value);
506 } 504 }
507 505
508 void WriteNode::MarkForSyncing() { 506 void WriteNode::MarkForSyncing() {
509 syncable::MarkForSyncing(entry_); 507 syncable::MarkForSyncing(entry_);
510 } 508 }
511 509
512 } // namespace syncer 510 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/test/test_entry_factory.cc ('k') | sync/notifier/invalidation_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698