| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/sync/core/attachments/on_disk_attachment_store.h" | 5 #include "components/sync/core/attachments/on_disk_attachment_store.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // Prefix for records containing attachment metadata. | 35 // Prefix for records containing attachment metadata. |
| 36 const char kMetadataPrefix[] = "metadata-"; | 36 const char kMetadataPrefix[] = "metadata-"; |
| 37 | 37 |
| 38 const char kDatabaseMetadataKey[] = "database-metadata"; | 38 const char kDatabaseMetadataKey[] = "database-metadata"; |
| 39 | 39 |
| 40 const int32_t kCurrentSchemaVersion = 1; | 40 const int32_t kCurrentSchemaVersion = 1; |
| 41 | 41 |
| 42 const base::FilePath::CharType kLeveldbDirectory[] = | 42 const base::FilePath::CharType kLeveldbDirectory[] = |
| 43 FILE_PATH_LITERAL("leveldb"); | 43 FILE_PATH_LITERAL("leveldb"); |
| 44 | 44 |
| 45 // Converts syncer::AttachmentStore::Component values into | 45 // Converts AttachmentStore::Component values into |
| 46 // attachment_store_pb::RecordMetadata::Component. | 46 // attachment_store_pb::RecordMetadata::Component. |
| 47 attachment_store_pb::RecordMetadata::Component ComponentToProto( | 47 attachment_store_pb::RecordMetadata::Component ComponentToProto( |
| 48 syncer::AttachmentStore::Component component) { | 48 AttachmentStore::Component component) { |
| 49 switch (component) { | 49 switch (component) { |
| 50 case AttachmentStore::MODEL_TYPE: | 50 case AttachmentStore::MODEL_TYPE: |
| 51 return attachment_store_pb::RecordMetadata::MODEL_TYPE; | 51 return attachment_store_pb::RecordMetadata::MODEL_TYPE; |
| 52 case AttachmentStore::SYNC: | 52 case AttachmentStore::SYNC: |
| 53 return attachment_store_pb::RecordMetadata::SYNC; | 53 return attachment_store_pb::RecordMetadata::SYNC; |
| 54 } | 54 } |
| 55 NOTREACHED(); | 55 NOTREACHED(); |
| 56 return attachment_store_pb::RecordMetadata::UNKNOWN; | 56 return attachment_store_pb::RecordMetadata::UNKNOWN; |
| 57 } | 57 } |
| 58 | 58 |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 return key; | 532 return key; |
| 533 } | 533 } |
| 534 | 534 |
| 535 AttachmentMetadata OnDiskAttachmentStore::MakeAttachmentMetadata( | 535 AttachmentMetadata OnDiskAttachmentStore::MakeAttachmentMetadata( |
| 536 const AttachmentId& attachment_id, | 536 const AttachmentId& attachment_id, |
| 537 const attachment_store_pb::RecordMetadata& record_metadata) { | 537 const attachment_store_pb::RecordMetadata& record_metadata) { |
| 538 return AttachmentMetadata(attachment_id, record_metadata.attachment_size()); | 538 return AttachmentMetadata(attachment_id, record_metadata.attachment_size()); |
| 539 } | 539 } |
| 540 | 540 |
| 541 } // namespace syncer | 541 } // namespace syncer |
| OLD | NEW |