| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> |
| 6 |
| 5 #include <string> | 7 #include <string> |
| 6 | 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "content/browser/indexed_db/indexed_db_transaction.h" | 10 #include "content/browser/indexed_db/indexed_db_transaction.h" |
| 9 #include "content/browser/indexed_db/leveldb/leveldb_iterator_impl.h" | 11 #include "content/browser/indexed_db/leveldb/leveldb_iterator_impl.h" |
| 10 #include "content/browser/indexed_db/leveldb/leveldb_transaction.h" | 12 #include "content/browser/indexed_db/leveldb/leveldb_transaction.h" |
| 11 #include "content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h
" | 13 #include "content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h
" |
| 12 #include "third_party/leveldatabase/env_chromium.h" | 14 #include "third_party/leveldatabase/env_chromium.h" |
| 13 #include "third_party/leveldatabase/src/include/leveldb/status.h" | 15 #include "third_party/leveldatabase/src/include/leveldb/status.h" |
| 14 | 16 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 ~IndexedDBTestDatabase() override {} | 55 ~IndexedDBTestDatabase() override {} |
| 54 | 56 |
| 55 size_t GetMaxMessageSizeInBytes() const override { | 57 size_t GetMaxMessageSizeInBytes() const override { |
| 56 return 10 * 1024 * 1024; // 10MB | 58 return 10 * 1024 * 1024; // 10MB |
| 57 } | 59 } |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 class IndexedDBTestTransaction : public IndexedDBTransaction { | 62 class IndexedDBTestTransaction : public IndexedDBTransaction { |
| 61 public: | 63 public: |
| 62 IndexedDBTestTransaction( | 64 IndexedDBTestTransaction( |
| 63 int64 id, | 65 int64_t id, |
| 64 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks, | 66 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks, |
| 65 const std::set<int64>& scope, | 67 const std::set<int64_t>& scope, |
| 66 blink::WebIDBTransactionMode mode, | 68 blink::WebIDBTransactionMode mode, |
| 67 IndexedDBDatabase* db, | 69 IndexedDBDatabase* db, |
| 68 IndexedDBBackingStore::Transaction* backing_store_transaction) | 70 IndexedDBBackingStore::Transaction* backing_store_transaction) |
| 69 : IndexedDBTransaction(id, | 71 : IndexedDBTransaction(id, |
| 70 callbacks, | 72 callbacks, |
| 71 scope, | 73 scope, |
| 72 mode, | 74 mode, |
| 73 db, | 75 db, |
| 74 backing_store_transaction) {} | 76 backing_store_transaction) {} |
| 75 | 77 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 const base::string16& name, | 257 const base::string16& name, |
| 256 IndexedDBBackingStore* backing_store, | 258 IndexedDBBackingStore* backing_store, |
| 257 IndexedDBFactory* factory, | 259 IndexedDBFactory* factory, |
| 258 const IndexedDBDatabase::Identifier& unique_identifier) { | 260 const IndexedDBDatabase::Identifier& unique_identifier) { |
| 259 return new IndexedDBTestDatabase(name, backing_store, factory, | 261 return new IndexedDBTestDatabase(name, backing_store, factory, |
| 260 unique_identifier); | 262 unique_identifier); |
| 261 } | 263 } |
| 262 | 264 |
| 263 IndexedDBTransaction* | 265 IndexedDBTransaction* |
| 264 MockBrowserTestIndexedDBClassFactory::CreateIndexedDBTransaction( | 266 MockBrowserTestIndexedDBClassFactory::CreateIndexedDBTransaction( |
| 265 int64 id, | 267 int64_t id, |
| 266 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks, | 268 scoped_refptr<IndexedDBDatabaseCallbacks> callbacks, |
| 267 const std::set<int64>& scope, | 269 const std::set<int64_t>& scope, |
| 268 blink::WebIDBTransactionMode mode, | 270 blink::WebIDBTransactionMode mode, |
| 269 IndexedDBDatabase* db, | 271 IndexedDBDatabase* db, |
| 270 IndexedDBBackingStore::Transaction* backing_store_transaction) { | 272 IndexedDBBackingStore::Transaction* backing_store_transaction) { |
| 271 return new IndexedDBTestTransaction(id, callbacks, scope, mode, db, | 273 return new IndexedDBTestTransaction(id, callbacks, scope, mode, db, |
| 272 backing_store_transaction); | 274 backing_store_transaction); |
| 273 } | 275 } |
| 274 | 276 |
| 275 LevelDBTransaction* | 277 LevelDBTransaction* |
| 276 MockBrowserTestIndexedDBClassFactory::CreateLevelDBTransaction( | 278 MockBrowserTestIndexedDBClassFactory::CreateLevelDBTransaction( |
| 277 LevelDBDatabase* db) { | 279 LevelDBDatabase* db) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 337 |
| 336 void MockBrowserTestIndexedDBClassFactory::Reset() { | 338 void MockBrowserTestIndexedDBClassFactory::Reset() { |
| 337 failure_class_ = FAIL_CLASS_NOTHING; | 339 failure_class_ = FAIL_CLASS_NOTHING; |
| 338 failure_method_ = FAIL_METHOD_NOTHING; | 340 failure_method_ = FAIL_METHOD_NOTHING; |
| 339 instance_count_.clear(); | 341 instance_count_.clear(); |
| 340 fail_on_instance_num_.clear(); | 342 fail_on_instance_num_.clear(); |
| 341 fail_on_call_num_.clear(); | 343 fail_on_call_num_.clear(); |
| 342 } | 344 } |
| 343 | 345 |
| 344 } // namespace content | 346 } // namespace content |
| OLD | NEW |