| Index: sync/internal_api/read_node.cc
|
| diff --git a/sync/internal_api/read_node.cc b/sync/internal_api/read_node.cc
|
| index ec85af64121f2b325d6f7bd1fdb0590e4167f3d8..318eb1a32e51873b529c18f75079dfbde1fb755d 100644
|
| --- a/sync/internal_api/read_node.cc
|
| +++ b/sync/internal_api/read_node.cc
|
| @@ -77,20 +77,39 @@ const BaseTransaction* ReadNode::GetTransaction() const {
|
| return transaction_;
|
| }
|
|
|
| -BaseNode::InitByLookupResult ReadNode::InitByTagLookup(
|
| +BaseNode::InitByLookupResult ReadNode::InitByTagLookupForBookmarks(
|
| const std::string& tag) {
|
| DCHECK(!entry_) << "Init called twice";
|
| if (tag.empty())
|
| return INIT_FAILED_PRECONDITION;
|
| syncable::BaseTransaction* trans = transaction_->GetWrappedTrans();
|
| - entry_ = new syncable::Entry(trans, syncable::GET_BY_SERVER_TAG, tag);
|
| + entry_ = new syncable::Entry(trans,
|
| + syncable::GET_BY_SERVER_TAG_DEPRECATED,
|
| + tag);
|
| if (!entry_->good())
|
| return INIT_FAILED_ENTRY_NOT_GOOD;
|
| if (entry_->GetIsDel())
|
| return INIT_FAILED_ENTRY_IS_DEL;
|
| ModelType model_type = GetModelType();
|
| - LOG_IF(WARNING, model_type == UNSPECIFIED || model_type == TOP_LEVEL_FOLDER)
|
| - << "SyncAPI InitByTagLookup referencing unusually typed object.";
|
| + DCHECK_EQ(model_type, BOOKMARKS)
|
| + << "InitByTagLookup deprecated for all types except bookmarks.";
|
| + return DecryptIfNecessary() ? INIT_OK : INIT_FAILED_DECRYPT_IF_NECESSARY;
|
| +}
|
| +
|
| +BaseNode::InitByLookupResult ReadNode::InitTypeRoot(ModelType type) {
|
| + DCHECK(!entry_) << "Init called twice";
|
| + if (!IsRealDataType(type))
|
| + return INIT_FAILED_PRECONDITION;
|
| + syncable::BaseTransaction* trans = transaction_->GetWrappedTrans();
|
| + entry_ = new syncable::Entry(trans, syncable::GET_TYPE_ROOT, type);
|
| + if (!entry_->good())
|
| + return INIT_FAILED_ENTRY_NOT_GOOD;
|
| + if (entry_->GetIsDel())
|
| + return INIT_FAILED_ENTRY_IS_DEL;
|
| + ModelType found_model_type = GetModelType();
|
| + LOG_IF(WARNING, found_model_type == UNSPECIFIED ||
|
| + found_model_type == TOP_LEVEL_FOLDER)
|
| + << "SyncAPI InitTypeRoot referencing unusually typed object.";
|
| return DecryptIfNecessary() ? INIT_OK : INIT_FAILED_DECRYPT_IF_NECESSARY;
|
| }
|
|
|
|
|