| OLD | NEW |
| 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_DATABASE_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <map> | 12 #include <map> |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <queue> | 14 #include <queue> |
| 15 #include <string> | 15 #include <string> |
| 16 #include <tuple> |
| 16 #include <utility> | 17 #include <utility> |
| 17 #include <vector> | 18 #include <vector> |
| 18 | 19 |
| 19 #include "base/macros.h" | 20 #include "base/macros.h" |
| 20 #include "base/memory/ref_counted.h" | 21 #include "base/memory/ref_counted.h" |
| 21 #include "content/browser/indexed_db/indexed_db.h" | 22 #include "content/browser/indexed_db/indexed_db.h" |
| 22 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 23 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
| 23 #include "content/browser/indexed_db/indexed_db_callbacks.h" | 24 #include "content/browser/indexed_db/indexed_db_callbacks.h" |
| 24 #include "content/browser/indexed_db/indexed_db_observer.h" | 25 #include "content/browser/indexed_db/indexed_db_observer.h" |
| 25 #include "content/browser/indexed_db/indexed_db_pending_connection.h" | 26 #include "content/browser/indexed_db/indexed_db_pending_connection.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 46 | 47 |
| 47 class CONTENT_EXPORT IndexedDBDatabase | 48 class CONTENT_EXPORT IndexedDBDatabase |
| 48 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { | 49 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { |
| 49 public: | 50 public: |
| 50 // Identifier is pair of (origin, database name). | 51 // Identifier is pair of (origin, database name). |
| 51 using Identifier = std::pair<url::Origin, base::string16>; | 52 using Identifier = std::pair<url::Origin, base::string16>; |
| 52 | 53 |
| 53 static const int64_t kInvalidId = 0; | 54 static const int64_t kInvalidId = 0; |
| 54 static const int64_t kMinimumIndexId = 30; | 55 static const int64_t kMinimumIndexId = 30; |
| 55 | 56 |
| 56 static scoped_refptr<IndexedDBDatabase> Create( | 57 static std::tuple<scoped_refptr<IndexedDBDatabase>, leveldb::Status> Create( |
| 57 const base::string16& name, | 58 const base::string16& name, |
| 58 IndexedDBBackingStore* backing_store, | 59 IndexedDBBackingStore* backing_store, |
| 59 IndexedDBFactory* factory, | 60 IndexedDBFactory* factory, |
| 60 const Identifier& unique_identifier, | 61 const Identifier& unique_identifier); |
| 61 leveldb::Status* s); | |
| 62 | 62 |
| 63 const Identifier& identifier() const { return identifier_; } | 63 const Identifier& identifier() const { return identifier_; } |
| 64 IndexedDBBackingStore* backing_store() { return backing_store_.get(); } | 64 IndexedDBBackingStore* backing_store() { return backing_store_.get(); } |
| 65 | 65 |
| 66 int64_t id() const { return metadata_.id; } | 66 int64_t id() const { return metadata_.id; } |
| 67 const base::string16& name() const { return metadata_.name; } | 67 const base::string16& name() const { return metadata_.name; } |
| 68 | 68 |
| 69 void AddObjectStore(const IndexedDBObjectStoreMetadata& metadata, | 69 void AddObjectStore(const IndexedDBObjectStoreMetadata& metadata, |
| 70 int64_t new_max_object_store_id); | 70 int64_t new_max_object_store_id); |
| 71 void RemoveObjectStore(int64_t object_store_id); | 71 void RemoveObjectStore(int64_t object_store_id); |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // is executing. It prevents rentrant calls if the active request completes | 346 // is executing. It prevents rentrant calls if the active request completes |
| 347 // synchronously. | 347 // synchronously. |
| 348 bool processing_pending_requests_ = false; | 348 bool processing_pending_requests_ = false; |
| 349 | 349 |
| 350 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); | 350 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); |
| 351 }; | 351 }; |
| 352 | 352 |
| 353 } // namespace content | 353 } // namespace content |
| 354 | 354 |
| 355 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 355 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
| OLD | NEW |