| Index: chrome/browser/sync/engine/syncapi.cc
|
| diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
|
| index 7bc7e7e52b33a01f3450fb58e527a699a9ff7f67..f31bff5c2a16a336dd3af0ba8be727622f7002b0 100644
|
| --- a/chrome/browser/sync/engine/syncapi.cc
|
| +++ b/chrome/browser/sync/engine/syncapi.cc
|
| @@ -165,6 +165,14 @@ BaseNode::BaseNode() {}
|
|
|
| BaseNode::~BaseNode() {}
|
|
|
| +void BaseNode::Reset()
|
| +{
|
| + if (password_data_.get())
|
| + {
|
| + password_data_.reset();
|
| + }
|
| +}
|
| +
|
| std::string BaseNode::GenerateSyncableHash(
|
| syncable::ModelType model_type, const std::string& client_tag) {
|
| // blank PB with just the extension in it has termination symbol,
|
| @@ -277,6 +285,14 @@ const sync_pb::AutofillSpecifics& BaseNode::GetAutofillSpecifics() const {
|
| return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::autofill);
|
| }
|
|
|
| +// alias to fit in 80 character widths
|
| +using sync_pb::AutofillProfile2Specifics;
|
| +const AutofillProfile2Specifics& BaseNode::GetAutofillProfileSpecifics(
|
| + ) const {
|
| + DCHECK(GetModelType() == syncable::AUTOFILL_PROFILE);
|
| + return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::autofill_profile);
|
| +}
|
| +
|
| const sync_pb::BookmarkSpecifics& BaseNode::GetBookmarkSpecifics() const {
|
| DCHECK(GetModelType() == syncable::BOOKMARKS);
|
| return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::bookmark);
|
| @@ -753,8 +769,22 @@ ReadNode::ReadNode(const BaseTransaction* transaction)
|
| DCHECK(transaction);
|
| }
|
|
|
| +ReadNode::ReadNode()
|
| +{
|
| + entry_ = NULL;
|
| + transaction_ = NULL;
|
| +}
|
| +
|
| ReadNode::~ReadNode() {
|
| + Reset();
|
| +}
|
| +
|
| +void ReadNode::Reset()
|
| +{
|
| + // [TODO] Next level of optimization could be to rethink if we can
|
| + // do away with deleting and recreating entry_
|
| delete entry_;
|
| + BaseNode::Reset();
|
| }
|
|
|
| void ReadNode::InitByRootLookup() {
|
| @@ -2166,6 +2196,10 @@ BaseTransaction::~BaseTransaction() {
|
| delete lookup_;
|
| }
|
|
|
| +BaseTransaction::BaseTransaction()
|
| + : lookup_(NULL) {
|
| +}
|
| +
|
| UserShare* SyncManager::GetUserShare() const {
|
| DCHECK(data_->initialized()) << "GetUserShare requires initialization!";
|
| return data_->GetUserShare();
|
|
|