OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <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/logging.h" | 10 #include "base/logging.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 class DiskFullFactory : public IndexedDBFactoryImpl { | 206 class DiskFullFactory : public IndexedDBFactoryImpl { |
207 public: | 207 public: |
208 explicit DiskFullFactory(IndexedDBContextImpl* context) | 208 explicit DiskFullFactory(IndexedDBContextImpl* context) |
209 : IndexedDBFactoryImpl(context) {} | 209 : IndexedDBFactoryImpl(context) {} |
210 | 210 |
211 private: | 211 private: |
212 ~DiskFullFactory() override {} | 212 ~DiskFullFactory() override {} |
213 scoped_refptr<IndexedDBBackingStore> OpenBackingStore( | 213 scoped_refptr<IndexedDBBackingStore> OpenBackingStore( |
214 const Origin& origin, | 214 const Origin& origin, |
215 const base::FilePath& data_directory, | 215 const base::FilePath& data_directory, |
216 net::URLRequestContext* request_context, | 216 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
217 IndexedDBDataLossInfo* data_loss_info, | 217 IndexedDBDataLossInfo* data_loss_info, |
218 bool* disk_full, | 218 bool* disk_full, |
219 leveldb::Status* s) override { | 219 leveldb::Status* s) override { |
220 *disk_full = true; | 220 *disk_full = true; |
221 *s = leveldb::Status::IOError("Disk is full"); | 221 *s = leveldb::Status::IOError("Disk is full"); |
222 return scoped_refptr<IndexedDBBackingStore>(); | 222 return scoped_refptr<IndexedDBBackingStore>(); |
223 } | 223 } |
224 | 224 |
225 DISALLOW_COPY_AND_ASSIGN(DiskFullFactory); | 225 DISALLOW_COPY_AND_ASSIGN(DiskFullFactory); |
226 }; | 226 }; |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 temp_directory.path()); | 499 temp_directory.path()); |
500 EXPECT_TRUE(callbacks->saw_error()); | 500 EXPECT_TRUE(callbacks->saw_error()); |
501 EXPECT_FALSE(factory()->IsDatabaseOpen(origin, db_name)); | 501 EXPECT_FALSE(factory()->IsDatabaseOpen(origin, db_name)); |
502 } | 502 } |
503 | 503 |
504 // Terminate all pending-close timers. | 504 // Terminate all pending-close timers. |
505 factory()->ForceClose(origin); | 505 factory()->ForceClose(origin); |
506 } | 506 } |
507 | 507 |
508 } // namespace content | 508 } // namespace content |
OLD | NEW |