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

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

Issue 308103004: IndexedDB: Using a mock IndexedDBFactory for unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't use GoogleMock with std::pair types Created 6 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 16 matching lines...) Expand all
27 namespace content { 27 namespace content {
28 28
29 class IndexedDBBackingStore; 29 class IndexedDBBackingStore;
30 struct IndexedDBPendingConnection; 30 struct IndexedDBPendingConnection;
31 31
32 class CONTENT_EXPORT IndexedDBFactory 32 class CONTENT_EXPORT IndexedDBFactory
33 : NON_EXPORTED_BASE(public base::RefCountedThreadSafe<IndexedDBFactory>) { 33 : NON_EXPORTED_BASE(public base::RefCountedThreadSafe<IndexedDBFactory>) {
34 public: 34 public:
35 typedef std::multimap<GURL, IndexedDBDatabase*> OriginDBMap; 35 typedef std::multimap<GURL, IndexedDBDatabase*> OriginDBMap;
36 typedef OriginDBMap::const_iterator OriginDBMapIterator; 36 typedef OriginDBMap::const_iterator OriginDBMapIterator;
37 typedef std::pair<OriginDBMapIterator, OriginDBMapIterator> OriginDBs;
37 38
38 virtual void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier, 39 virtual void ReleaseDatabase(const IndexedDBDatabase::Identifier& identifier,
39 bool forcedClose) = 0; 40 bool forcedClose) = 0;
40 41
41 virtual void GetDatabaseNames(scoped_refptr<IndexedDBCallbacks> callbacks, 42 virtual void GetDatabaseNames(scoped_refptr<IndexedDBCallbacks> callbacks,
42 const GURL& origin_url, 43 const GURL& origin_url,
43 const base::FilePath& data_directory, 44 const base::FilePath& data_directory,
44 net::URLRequestContext* request_context) = 0; 45 net::URLRequestContext* request_context) = 0;
45 virtual void Open(const base::string16& name, 46 virtual void Open(const base::string16& name,
46 const IndexedDBPendingConnection& connection, 47 const IndexedDBPendingConnection& connection,
47 net::URLRequestContext* request_context, 48 net::URLRequestContext* request_context,
48 const GURL& origin_url, 49 const GURL& origin_url,
49 const base::FilePath& data_directory) = 0; 50 const base::FilePath& data_directory) = 0;
50 51
51 virtual void DeleteDatabase(const base::string16& name, 52 virtual void DeleteDatabase(const base::string16& name,
52 net::URLRequestContext* request_context, 53 net::URLRequestContext* request_context,
53 scoped_refptr<IndexedDBCallbacks> callbacks, 54 scoped_refptr<IndexedDBCallbacks> callbacks,
54 const GURL& origin_url, 55 const GURL& origin_url,
55 const base::FilePath& data_directory) = 0; 56 const base::FilePath& data_directory) = 0;
56 57
57 virtual void HandleBackingStoreFailure(const GURL& origin_url) = 0; 58 virtual void HandleBackingStoreFailure(const GURL& origin_url) = 0;
58 virtual void HandleBackingStoreCorruption( 59 virtual void HandleBackingStoreCorruption(
59 const GURL& origin_url, 60 const GURL& origin_url,
60 const IndexedDBDatabaseError& error) = 0; 61 const IndexedDBDatabaseError& error) = 0;
61 62
62 virtual std::pair<OriginDBMapIterator, OriginDBMapIterator> 63 virtual OriginDBs GetOpenDatabasesForOrigin(const GURL& origin_url) const = 0;
63 GetOpenDatabasesForOrigin(const GURL& origin_url) const = 0;
64 64
65 virtual void ForceClose(const GURL& origin_url) = 0; 65 virtual void ForceClose(const GURL& origin_url) = 0;
66 66
67 // Called by the IndexedDBContext destructor so the factory can do cleanup. 67 // Called by the IndexedDBContext destructor so the factory can do cleanup.
68 virtual void ContextDestroyed() = 0; 68 virtual void ContextDestroyed() = 0;
69 69
70 // Called by the IndexedDBActiveBlobRegistry. 70 // Called by the IndexedDBActiveBlobRegistry.
71 virtual void ReportOutstandingBlobs(const GURL& origin_url, 71 virtual void ReportOutstandingBlobs(const GURL& origin_url,
72 bool blobs_outstanding) = 0; 72 bool blobs_outstanding) = 0;
73 73
(...skipping 28 matching lines...) Expand all
102 bool first_time, 102 bool first_time,
103 leveldb::Status* status) = 0; 103 leveldb::Status* status) = 0;
104 104
105 private: 105 private:
106 DISALLOW_COPY_AND_ASSIGN(IndexedDBFactory); 106 DISALLOW_COPY_AND_ASSIGN(IndexedDBFactory);
107 }; 107 };
108 108
109 } // namespace content 109 } // namespace content
110 110
111 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ 111 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_database_unittest.cc ('k') | content/browser/indexed_db/indexed_db_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698