| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/read_node.h" | 5 #include "components/sync/core/read_node.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "sync/internal_api/public/base_transaction.h" | 10 #include "components/sync/core/base_transaction.h" |
| 11 #include "sync/syncable/entry.h" | 11 #include "components/sync/syncable/entry.h" |
| 12 #include "sync/syncable/syncable_base_transaction.h" | 12 #include "components/sync/syncable/syncable_base_transaction.h" |
| 13 #include "sync/syncable/syncable_util.h" | 13 #include "components/sync/syncable/syncable_util.h" |
| 14 | 14 |
| 15 namespace syncer { | 15 namespace syncer { |
| 16 | 16 |
| 17 ////////////////////////////////////////////////////////////////////////// | 17 ////////////////////////////////////////////////////////////////////////// |
| 18 // ReadNode member definitions | 18 // ReadNode member definitions |
| 19 ReadNode::ReadNode(const BaseTransaction* transaction) | 19 ReadNode::ReadNode(const BaseTransaction* transaction) |
| 20 : entry_(NULL), transaction_(transaction) { | 20 : entry_(NULL), transaction_(transaction) { |
| 21 DCHECK(transaction); | 21 DCHECK(transaction); |
| 22 } | 22 } |
| 23 | 23 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 if (!IsRealDataType(type)) | 105 if (!IsRealDataType(type)) |
| 106 return INIT_FAILED_PRECONDITION; | 106 return INIT_FAILED_PRECONDITION; |
| 107 syncable::BaseTransaction* trans = transaction_->GetWrappedTrans(); | 107 syncable::BaseTransaction* trans = transaction_->GetWrappedTrans(); |
| 108 entry_ = new syncable::Entry(trans, syncable::GET_TYPE_ROOT, type); | 108 entry_ = new syncable::Entry(trans, syncable::GET_TYPE_ROOT, type); |
| 109 if (!entry_->good()) | 109 if (!entry_->good()) |
| 110 return INIT_FAILED_ENTRY_NOT_GOOD; | 110 return INIT_FAILED_ENTRY_NOT_GOOD; |
| 111 if (entry_->GetIsDel()) | 111 if (entry_->GetIsDel()) |
| 112 return INIT_FAILED_ENTRY_IS_DEL; | 112 return INIT_FAILED_ENTRY_IS_DEL; |
| 113 ModelType found_model_type = GetModelType(); | 113 ModelType found_model_type = GetModelType(); |
| 114 LOG_IF(WARNING, found_model_type == UNSPECIFIED || | 114 LOG_IF(WARNING, found_model_type == UNSPECIFIED || |
| 115 found_model_type == TOP_LEVEL_FOLDER) | 115 found_model_type == TOP_LEVEL_FOLDER) |
| 116 << "SyncAPI InitTypeRoot referencing unusually typed object."; | 116 << "SyncAPI InitTypeRoot referencing unusually typed object."; |
| 117 return DecryptIfNecessary() ? INIT_OK : INIT_FAILED_DECRYPT_IF_NECESSARY; | 117 return DecryptIfNecessary() ? INIT_OK : INIT_FAILED_DECRYPT_IF_NECESSARY; |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace syncer | 120 } // namespace syncer |
| OLD | NEW |