Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "sync/internal_api/public/base_transaction.h" | 10 #include "sync/internal_api/public/base_transaction.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 if (GetModelTypeFromSpecifics(old_specifics) == PASSWORDS) { | 161 if (GetModelTypeFromSpecifics(old_specifics) == PASSWORDS) { |
| 162 entity_specifics.CopyFrom(old_specifics); | 162 entity_specifics.CopyFrom(old_specifics); |
| 163 } else { | 163 } else { |
| 164 AddDefaultFieldValue(PASSWORDS, &entity_specifics); | 164 AddDefaultFieldValue(PASSWORDS, &entity_specifics); |
| 165 } | 165 } |
| 166 sync_pb::PasswordSpecifics* password_specifics = | 166 sync_pb::PasswordSpecifics* password_specifics = |
| 167 entity_specifics.mutable_password(); | 167 entity_specifics.mutable_password(); |
| 168 // This will only update password_specifics if the underlying unencrypted blob | 168 // This will only update password_specifics if the underlying unencrypted blob |
| 169 // was different from |data| or was not encrypted with the proper passphrase. | 169 // was different from |data| or was not encrypted with the proper passphrase. |
| 170 if (!cryptographer->Encrypt(data, password_specifics->mutable_encrypted())) { | 170 if (!cryptographer->Encrypt(data, password_specifics->mutable_encrypted())) { |
| 171 NOTREACHED() << "Failed to encrypt password, possibly due to sync node " | 171 LOG(ERROR) << "Failed to encrypt password, possibly due to sync node " |
|
stanisc
2015/06/09 00:04:02
Should this code also upload the dump to give this
Nicolas Zea
2015/06/09 19:42:03
The DecryptIfNecessary method's calls to OnUnrecov
| |
| 172 << "corruption"; | 172 << "corruption"; |
| 173 return; | 173 return; |
| 174 } | 174 } |
| 175 SetEntitySpecifics(entity_specifics); | 175 SetEntitySpecifics(entity_specifics); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void WriteNode::SetThemeSpecifics( | 178 void WriteNode::SetThemeSpecifics( |
| 179 const sync_pb::ThemeSpecifics& new_value) { | 179 const sync_pb::ThemeSpecifics& new_value) { |
| 180 sync_pb::EntitySpecifics entity_specifics; | 180 sync_pb::EntitySpecifics entity_specifics; |
| 181 entity_specifics.mutable_theme()->CopyFrom(new_value); | 181 entity_specifics.mutable_theme()->CopyFrom(new_value); |
| 182 SetEntitySpecifics(entity_specifics); | 182 SetEntitySpecifics(entity_specifics); |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 537 syncable::Id predecessor_id = predecessor ? | 537 syncable::Id predecessor_id = predecessor ? |
| 538 predecessor->GetEntry()->GetId() : syncable::Id(); | 538 predecessor->GetEntry()->GetId() : syncable::Id(); |
| 539 return entry_->PutPredecessor(predecessor_id); | 539 return entry_->PutPredecessor(predecessor_id); |
| 540 } | 540 } |
| 541 | 541 |
| 542 void WriteNode::MarkForSyncing() { | 542 void WriteNode::MarkForSyncing() { |
| 543 syncable::MarkForSyncing(entry_); | 543 syncable::MarkForSyncing(entry_); |
| 544 } | 544 } |
| 545 | 545 |
| 546 } // namespace syncer | 546 } // namespace syncer |
| OLD | NEW |