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

Unified Diff: chrome/browser/sync/engine/syncapi.cc

Issue 4683003: Sending the proto files for review to unblcok the server team Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/glue/autofill_change_processor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/glue/autofill_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698