OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/indexed_db/indexed_db_backing_store.h" | 5 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 DatabaseNameKey database_name_key; | 1172 DatabaseNameKey database_name_key; |
1173 if (!DatabaseNameKey::Decode(&slice, &database_name_key) || | 1173 if (!DatabaseNameKey::Decode(&slice, &database_name_key) || |
1174 !slice.empty()) { | 1174 !slice.empty()) { |
1175 INTERNAL_CONSISTENCY_ERROR_UNTESTED(GET_DATABASE_NAMES); | 1175 INTERNAL_CONSISTENCY_ERROR_UNTESTED(GET_DATABASE_NAMES); |
1176 continue; | 1176 continue; |
1177 } | 1177 } |
1178 | 1178 |
1179 // Decode database id (in iterator value). | 1179 // Decode database id (in iterator value). |
1180 int64 database_id = 0; | 1180 int64 database_id = 0; |
1181 StringPiece valueSlice(it->Value()); | 1181 StringPiece valueSlice(it->Value()); |
1182 if (!DecodeVarInt(&valueSlice, &database_id) || !valueSlice.empty()) { | 1182 if (!DecodeInt(&valueSlice, &database_id) || !valueSlice.empty()) { |
1183 INTERNAL_CONSISTENCY_ERROR_UNTESTED(GET_DATABASE_NAMES); | 1183 INTERNAL_CONSISTENCY_ERROR_UNTESTED(GET_DATABASE_NAMES); |
1184 continue; | 1184 continue; |
1185 } | 1185 } |
1186 | 1186 |
1187 // Look up version by id. | 1187 // Look up version by id. |
1188 bool found = false; | 1188 bool found = false; |
1189 int64 database_version = IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION; | 1189 int64 database_version = IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION; |
1190 *s = GetVarInt(db_.get(), | 1190 *s = GetVarInt(db_.get(), |
1191 DatabaseMetaDataKey::Encode( | 1191 DatabaseMetaDataKey::Encode( |
1192 database_id, DatabaseMetaDataKey::USER_INT_VERSION), | 1192 database_id, DatabaseMetaDataKey::USER_INT_VERSION), |
(...skipping 3099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4292 int64_t size, | 4292 int64_t size, |
4293 base::Time last_modified) | 4293 base::Time last_modified) |
4294 : is_file_(true), | 4294 : is_file_(true), |
4295 file_path_(file_path), | 4295 file_path_(file_path), |
4296 key_(key), | 4296 key_(key), |
4297 size_(size), | 4297 size_(size), |
4298 last_modified_(last_modified) { | 4298 last_modified_(last_modified) { |
4299 } | 4299 } |
4300 | 4300 |
4301 } // namespace content | 4301 } // namespace content |
OLD | NEW |