| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 if (KeyPrefix::IsValidDatabaseId(database_id_)) { | 136 if (KeyPrefix::IsValidDatabaseId(database_id_)) { |
| 137 if (database_id_ != database_id) { | 137 if (database_id_ != database_id) { |
| 138 return false; | 138 return false; |
| 139 } | 139 } |
| 140 } else { | 140 } else { |
| 141 database_id_ = database_id; | 141 database_id_ = database_id; |
| 142 } | 142 } |
| 143 writes_.push_back(descriptor); | 143 writes_.push_back(descriptor); |
| 144 task_runner()->PostTask( | 144 task_runner()->PostTask( |
| 145 FROM_HERE, | 145 FROM_HERE, |
| 146 base::Bind(&Transaction::ChainedBlobWriter::ReportWriteCompletion, | 146 base::BindOnce(&Transaction::ChainedBlobWriter::ReportWriteCompletion, |
| 147 chained_blob_writer, | 147 chained_blob_writer, true, 1)); |
| 148 true, | |
| 149 1)); | |
| 150 return true; | 148 return true; |
| 151 } | 149 } |
| 152 | 150 |
| 153 bool RemoveBlobFile(int64_t database_id, int64_t key) const override { | 151 bool RemoveBlobFile(int64_t database_id, int64_t key) const override { |
| 154 if (database_id_ != database_id || | 152 if (database_id_ != database_id || |
| 155 !KeyPrefix::IsValidDatabaseId(database_id)) { | 153 !KeyPrefix::IsValidDatabaseId(database_id)) { |
| 156 return false; | 154 return false; |
| 157 } | 155 } |
| 158 removals_.push_back(key); | 156 removals_.push_back(key); |
| 159 return true; | 157 return true; |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 | 1147 |
| 1150 // Dictionary, message key and more. | 1148 // Dictionary, message key and more. |
| 1151 ASSERT_TRUE(WriteFile(info_path, "{\"message\":\"foo\",\"bar\":5}")); | 1149 ASSERT_TRUE(WriteFile(info_path, "{\"message\":\"foo\",\"bar\":5}")); |
| 1152 EXPECT_TRUE( | 1150 EXPECT_TRUE( |
| 1153 IndexedDBBackingStore::ReadCorruptionInfo(path_base, origin, &message)); | 1151 IndexedDBBackingStore::ReadCorruptionInfo(path_base, origin, &message)); |
| 1154 EXPECT_FALSE(PathExists(info_path)); | 1152 EXPECT_FALSE(PathExists(info_path)); |
| 1155 EXPECT_EQ("foo", message); | 1153 EXPECT_EQ("foo", message); |
| 1156 } | 1154 } |
| 1157 | 1155 |
| 1158 } // namespace content | 1156 } // namespace content |
| OLD | NEW |