OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/string16.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 class IndexedDBCallbacksWrapper; |
| 14 class IndexedDBDatabase; |
| 15 class IndexedDBDatabaseCallbacksWrapper; |
| 16 class ScriptExecutionContext; |
| 17 |
| 18 typedef int ExceptionCode; |
| 19 |
| 20 // This class is shared by IndexedDBFactory (async) and IndexedDBFactorySync |
| 21 // (sync). |
| 22 // This is implemented by IndexedDBFactoryImpl and optionally others (in order |
| 23 // to proxy |
| 24 // calls across process barriers). All calls to these classes should be |
| 25 // non-blocking and |
| 26 // trigger work on a background thread if necessary. |
| 27 class IndexedDBFactory : public base::RefCounted<IndexedDBFactory> { |
| 28 public: |
| 29 static scoped_refptr<IndexedDBFactory> Create(); |
| 30 |
| 31 virtual void GetDatabaseNames(scoped_refptr<IndexedDBCallbacksWrapper>, |
| 32 const string16& database_identifier, |
| 33 ScriptExecutionContext*, |
| 34 const string16& data_dir) = 0; |
| 35 virtual void Open(const string16& name, |
| 36 int64_t version, |
| 37 int64_t transaction_id, |
| 38 scoped_refptr<IndexedDBCallbacksWrapper>, |
| 39 scoped_refptr<IndexedDBDatabaseCallbacksWrapper>, |
| 40 const string16& database_identifier, |
| 41 ScriptExecutionContext*, |
| 42 const string16& data_dir) = 0; |
| 43 virtual void DeleteDatabase(const string16& name, |
| 44 scoped_refptr<IndexedDBCallbacksWrapper>, |
| 45 const string16& database_identifier, |
| 46 ScriptExecutionContext*, |
| 47 const string16& data_dir) = 0; |
| 48 |
| 49 protected: |
| 50 virtual ~IndexedDBFactory() {} |
| 51 friend class base::RefCounted<IndexedDBFactory>; |
| 52 }; |
| 53 |
| 54 } // namespace content |
| 55 |
| 56 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_H_ |
OLD | NEW |