Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 // OfflinePageMetadataStoreSQL is an instance of OfflinePageMetadataStore | 27 // OfflinePageMetadataStoreSQL is an instance of OfflinePageMetadataStore |
| 28 // which is implemented using a SQLite database. | 28 // which is implemented using a SQLite database. |
| 29 // | 29 // |
| 30 // This store has a history of schema updates in pretty much every release. | 30 // This store has a history of schema updates in pretty much every release. |
| 31 // Original schema was delivered in M52. Since then, the following changes | 31 // Original schema was delivered in M52. Since then, the following changes |
| 32 // happened: | 32 // happened: |
| 33 // * In M53 expiration_time was added, | 33 // * In M53 expiration_time was added, |
| 34 // * In M54 title was added, | 34 // * In M54 title was added, |
| 35 // * In M55 we dropped the following fields (never used): version, status, | 35 // * In M55 we dropped the following fields (never used): version, status, |
| 36 // offline_url, user_initiated. | 36 // offline_url, user_initiated. |
| 37 // * In M56 original_url was added. | |
|
fgorski
2016/11/10 23:56:13
Thank you for remembering to do this!
jianli
2016/11/16 01:25:40
Acknowledged.
| |
| 37 // | 38 // |
| 38 // Here is a procedure to update the schema for this store: | 39 // Here is a procedure to update the schema for this store: |
| 39 // * Decide how to detect that the store is on a particular version, which | 40 // * Decide how to detect that the store is on a particular version, which |
| 40 // typically means that a certain field exists or is missing. This happens in | 41 // typically means that a certain field exists or is missing. This happens in |
| 41 // Upgrade section of |CreateSchema| | 42 // Upgrade section of |CreateSchema| |
| 42 // * Work out appropriate change and apply it to all existing upgrade paths. In | 43 // * Work out appropriate change and apply it to all existing upgrade paths. In |
| 43 // the interest of performing a single update of the store, it upgrades from a | 44 // the interest of performing a single update of the store, it upgrades from a |
| 44 // detected version to the current one. This means that when making a change, | 45 // detected version to the current one. This means that when making a change, |
| 45 // more than a single query may have to be updated (in case of fields being | 46 // more than a single query may have to be updated (in case of fields being |
| 46 // removed or needed to be initialized to a specific, non-default value). | 47 // removed or needed to be initialized to a specific, non-default value). |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 StoreState state_; | 98 StoreState state_; |
| 98 | 99 |
| 99 base::WeakPtrFactory<OfflinePageMetadataStoreSQL> weak_ptr_factory_; | 100 base::WeakPtrFactory<OfflinePageMetadataStoreSQL> weak_ptr_factory_; |
| 100 | 101 |
| 101 DISALLOW_COPY_AND_ASSIGN(OfflinePageMetadataStoreSQL); | 102 DISALLOW_COPY_AND_ASSIGN(OfflinePageMetadataStoreSQL); |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 } // namespace offline_pages | 105 } // namespace offline_pages |
| 105 | 106 |
| 106 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_ | 107 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_ |
| OLD | NEW |