Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h

Issue 2472213003: [IndexedDB] Refactoring to remove ref ptrs and host transaction ids. (Closed)
Patch Set: comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_H_
6 #define CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 28 matching lines...) Expand all
39 class MockBrowserTestIndexedDBClassFactory : public IndexedDBClassFactory { 39 class MockBrowserTestIndexedDBClassFactory : public IndexedDBClassFactory {
40 public: 40 public:
41 MockBrowserTestIndexedDBClassFactory(); 41 MockBrowserTestIndexedDBClassFactory();
42 ~MockBrowserTestIndexedDBClassFactory() override; 42 ~MockBrowserTestIndexedDBClassFactory() override;
43 43
44 scoped_refptr<IndexedDBDatabase> CreateIndexedDBDatabase( 44 scoped_refptr<IndexedDBDatabase> CreateIndexedDBDatabase(
45 const base::string16& name, 45 const base::string16& name,
46 scoped_refptr<IndexedDBBackingStore> backing_store, 46 scoped_refptr<IndexedDBBackingStore> backing_store,
47 scoped_refptr<IndexedDBFactory> factory, 47 scoped_refptr<IndexedDBFactory> factory,
48 const IndexedDBDatabase::Identifier& unique_identifier) override; 48 const IndexedDBDatabase::Identifier& unique_identifier) override;
49 IndexedDBTransaction* CreateIndexedDBTransaction( 49 std::unique_ptr<IndexedDBTransaction> CreateIndexedDBTransaction(
50 int64_t id, 50 int64_t id,
51 base::WeakPtr<IndexedDBConnection> connection, 51 IndexedDBConnection* connection,
52 const std::set<int64_t>& scope, 52 const std::set<int64_t>& scope,
53 blink::WebIDBTransactionMode mode, 53 blink::WebIDBTransactionMode mode,
54 IndexedDBBackingStore::Transaction* backing_store_transaction) override; 54 IndexedDBBackingStore::Transaction* backing_store_transaction) override;
55 scoped_refptr<LevelDBTransaction> CreateLevelDBTransaction( 55 scoped_refptr<LevelDBTransaction> CreateLevelDBTransaction(
56 LevelDBDatabase* db) override; 56 LevelDBDatabase* db) override;
57 std::unique_ptr<LevelDBIteratorImpl> CreateIteratorImpl( 57 std::unique_ptr<LevelDBIteratorImpl> CreateIteratorImpl(
58 std::unique_ptr<leveldb::Iterator> iterator) override; 58 std::unique_ptr<leveldb::Iterator> iterator) override;
59 59
60 void FailOperation(FailClass failure_class, 60 void FailOperation(FailClass failure_class,
61 FailMethod failure_method, 61 FailMethod failure_method,
62 int fail_on_instance_num, 62 int fail_on_instance_num,
63 int fail_on_call_num); 63 int fail_on_call_num);
64 void Reset(); 64 void Reset();
65 65
66 private: 66 private:
67 FailClass failure_class_; 67 FailClass failure_class_;
68 FailMethod failure_method_; 68 FailMethod failure_method_;
69 std::map<FailClass, int> instance_count_; 69 std::map<FailClass, int> instance_count_;
70 std::map<FailClass, int> fail_on_instance_num_; 70 std::map<FailClass, int> fail_on_instance_num_;
71 std::map<FailClass, int> fail_on_call_num_; 71 std::map<FailClass, int> fail_on_call_num_;
72 bool only_trace_calls_; 72 bool only_trace_calls_;
73 }; 73 };
74 74
75 } // namespace content 75 } // namespace content
76 76
77 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_ H_ 77 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698