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

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

Issue 2519073003: IndexedDB: IndexedDBDatabase::Create() returning db/status tuple. (Closed)
Patch Set: Swapped db/s to reflect order in tuple Created 4 years, 1 month 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
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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
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_
OLDNEW
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698