| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef COMPONENTS_SYNC_CORE_DATA_BATCH_IMPL_H_ | 5 #ifndef COMPONENTS_SYNC_CORE_DATA_BATCH_IMPL_H_ |
| 6 #define COMPONENTS_SYNC_CORE_DATA_BATCH_IMPL_H_ | 6 #define COMPONENTS_SYNC_CORE_DATA_BATCH_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "components/sync/api/data_batch.h" | 16 #include "components/sync/model/data_batch.h" |
| 17 #include "components/sync/api/entity_data.h" | 17 #include "components/sync/model/entity_data.h" |
| 18 | 18 |
| 19 namespace syncer { | 19 namespace syncer { |
| 20 | 20 |
| 21 // An implementation of DataBatch that's purpose is to transfer ownership of | 21 // An implementation of DataBatch that's purpose is to transfer ownership of |
| 22 // EntityData objects. As soon as this batch recieves the EntityData, it owns | 22 // EntityData objects. As soon as this batch recieves the EntityData, it owns |
| 23 // them until Next() is invoked, when it gives up ownerhsip. Because a vector | 23 // them until Next() is invoked, when it gives up ownerhsip. Because a vector |
| 24 // is used internally, this impl is unaware when duplcate storage_keys are used, | 24 // is used internally, this impl is unaware when duplcate storage_keys are used, |
| 25 // and it is the caller's job to avoid this. | 25 // and it is the caller's job to avoid this. |
| 26 class DataBatchImpl : public DataBatch { | 26 class DataBatchImpl : public DataBatch { |
| 27 public: | 27 public: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 41 private: | 41 private: |
| 42 std::vector<KeyAndData> key_data_pairs_; | 42 std::vector<KeyAndData> key_data_pairs_; |
| 43 size_t read_index_ = 0; | 43 size_t read_index_ = 0; |
| 44 | 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(DataBatchImpl); | 45 DISALLOW_COPY_AND_ASSIGN(DataBatchImpl); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace syncer | 48 } // namespace syncer |
| 49 | 49 |
| 50 #endif // COMPONENTS_SYNC_CORE_DATA_BATCH_IMPL_H_ | 50 #endif // COMPONENTS_SYNC_CORE_DATA_BATCH_IMPL_H_ |
| OLD | NEW |