| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 idb_context_(idb_context), | 133 idb_context_(idb_context), |
| 134 origin_(origin) {} | 134 origin_(origin) {} |
| 135 | 135 |
| 136 void OnSuccess() override {} | 136 void OnSuccess() override {} |
| 137 void OnSuccess(const std::vector<base::string16>&) override {} | 137 void OnSuccess(const std::vector<base::string16>&) override {} |
| 138 void OnSuccess(std::unique_ptr<IndexedDBConnection> connection, | 138 void OnSuccess(std::unique_ptr<IndexedDBConnection> connection, |
| 139 const IndexedDBDatabaseMetadata& metadata) override { | 139 const IndexedDBDatabaseMetadata& metadata) override { |
| 140 connection_ = std::move(connection); | 140 connection_ = std::move(connection); |
| 141 idb_context_->ConnectionOpened(origin_, connection_.get()); | 141 idb_context_->ConnectionOpened(origin_, connection_.get()); |
| 142 } | 142 } |
| 143 bool IsValid() const override { return true; } | |
| 144 | 143 |
| 145 IndexedDBConnection* connection() { return connection_.get(); } | 144 IndexedDBConnection* connection() { return connection_.get(); } |
| 146 | 145 |
| 147 protected: | 146 protected: |
| 148 ~ForceCloseDBCallbacks() override {} | 147 ~ForceCloseDBCallbacks() override {} |
| 149 | 148 |
| 150 private: | 149 private: |
| 151 scoped_refptr<IndexedDBContextImpl> idb_context_; | 150 scoped_refptr<IndexedDBContextImpl> idb_context_; |
| 152 Origin origin_; | 151 Origin origin_; |
| 153 std::unique_ptr<IndexedDBConnection> connection_; | 152 std::unique_ptr<IndexedDBConnection> connection_; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 280 |
| 282 // Simulate the write failure. | 281 // Simulate the write failure. |
| 283 leveldb::Status status = leveldb::Status::IOError("Simulated failure"); | 282 leveldb::Status status = leveldb::Status::IOError("Simulated failure"); |
| 284 context->GetIDBFactory()->HandleBackingStoreFailure(kTestOrigin); | 283 context->GetIDBFactory()->HandleBackingStoreFailure(kTestOrigin); |
| 285 | 284 |
| 286 EXPECT_TRUE(db_callbacks->forced_close_called()); | 285 EXPECT_TRUE(db_callbacks->forced_close_called()); |
| 287 EXPECT_FALSE(factory->IsBackingStoreOpen(kTestOrigin)); | 286 EXPECT_FALSE(factory->IsBackingStoreOpen(kTestOrigin)); |
| 288 } | 287 } |
| 289 | 288 |
| 290 } // namespace content | 289 } // namespace content |
| OLD | NEW |