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

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

Issue 2233153002: IndexedDB: WrapUnique(new T(args..)) -> MakeUnique<T>(args...) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: MOAR MakeUnique calls Created 4 years, 4 months 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 23 matching lines...) Expand all
34 FAIL_METHOD_COMMIT_DISK_FULL, 34 FAIL_METHOD_COMMIT_DISK_FULL,
35 FAIL_METHOD_GET, 35 FAIL_METHOD_GET,
36 FAIL_METHOD_SEEK, 36 FAIL_METHOD_SEEK,
37 }; 37 };
38 38
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 IndexedDBDatabase* CreateIndexedDBDatabase( 44 scoped_refptr<IndexedDBDatabase> CreateIndexedDBDatabase(
45 const base::string16& name, 45 const base::string16& name,
46 IndexedDBBackingStore* backing_store, 46 IndexedDBBackingStore* backing_store,
47 IndexedDBFactory* factory, 47 IndexedDBFactory* factory,
48 const IndexedDBDatabase::Identifier& unique_identifier) override; 48 const IndexedDBDatabase::Identifier& unique_identifier) override;
49 IndexedDBTransaction* CreateIndexedDBTransaction( 49 IndexedDBTransaction* CreateIndexedDBTransaction(
cmumford 2016/08/13 00:08:39 It'd be nice, in a future commit, to make this a s
jsbell 2016/08/16 03:05:28 Agreed. I was worried about doing it in this patch
jsbell 2016/08/16 05:22:18 To be more precise: this function is WEIRD since (
50 int64_t id, 50 int64_t id,
51 base::WeakPtr<IndexedDBConnection> connection, 51 base::WeakPtr<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 LevelDBTransaction* CreateLevelDBTransaction(LevelDBDatabase* db) override; 55 scoped_refptr<LevelDBTransaction> CreateLevelDBTransaction(
56 LevelDBIteratorImpl* CreateIteratorImpl( 56 LevelDBDatabase* db) override;
57 std::unique_ptr<LevelDBIteratorImpl> CreateIteratorImpl(
57 std::unique_ptr<leveldb::Iterator> iterator) override; 58 std::unique_ptr<leveldb::Iterator> iterator) override;
58 59
59 void FailOperation(FailClass failure_class, 60 void FailOperation(FailClass failure_class,
60 FailMethod failure_method, 61 FailMethod failure_method,
61 int fail_on_instance_num, 62 int fail_on_instance_num,
62 int fail_on_call_num); 63 int fail_on_call_num);
63 void Reset(); 64 void Reset();
64 65
65 private: 66 private:
66 FailClass failure_class_; 67 FailClass failure_class_;
67 FailMethod failure_method_; 68 FailMethod failure_method_;
68 std::map<FailClass, int> instance_count_; 69 std::map<FailClass, int> instance_count_;
69 std::map<FailClass, int> fail_on_instance_num_; 70 std::map<FailClass, int> fail_on_instance_num_;
70 std::map<FailClass, int> fail_on_call_num_; 71 std::map<FailClass, int> fail_on_call_num_;
71 bool only_trace_calls_; 72 bool only_trace_calls_;
72 }; 73 };
73 74
74 } // namespace content 75 } // namespace content
75 76
76 #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