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

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

Issue 17033004: Tell IDB frontend about data loss (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ToT Created 7 years, 5 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 | Annotate | Revision Log
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_CALLBACKS_WRAPPER_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "content/browser/indexed_db/indexed_db_database_error.h" 15 #include "content/browser/indexed_db/indexed_db_database_error.h"
16 #include "content/common/indexed_db/indexed_db_key.h" 16 #include "content/common/indexed_db/indexed_db_key.h"
17 #include "content/common/indexed_db/indexed_db_key_path.h" 17 #include "content/common/indexed_db/indexed_db_key_path.h"
18 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h"
18 19
19 namespace content { 20 namespace content {
20 class IndexedDBCallbacksBase; 21 class IndexedDBCallbacksBase;
21 class IndexedDBDatabaseCallbacksWrapper; 22 class IndexedDBDatabaseCallbacksWrapper;
22 class IndexedDBCursor; 23 class IndexedDBCursor;
23 class IndexedDBDatabase; 24 class IndexedDBDatabase;
24 class WebIDBCursorImpl; 25 class WebIDBCursorImpl;
25 class WebIDBDatabaseImpl; 26 class WebIDBDatabaseImpl;
26 struct IndexedDBDatabaseMetadata; 27 struct IndexedDBDatabaseMetadata;
27 28
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 virtual void OnSuccessWithPrefetch( 68 virtual void OnSuccessWithPrefetch(
68 const std::vector<IndexedDBKey>& keys, 69 const std::vector<IndexedDBKey>& keys,
69 const std::vector<IndexedDBKey>& primary_keys, 70 const std::vector<IndexedDBKey>& primary_keys,
70 const std::vector<std::vector<char> >& values); 71 const std::vector<std::vector<char> >& values);
71 // From IDBFactory.open()/deleteDatabase() 72 // From IDBFactory.open()/deleteDatabase()
72 virtual void OnBlocked(int64 existing_version); 73 virtual void OnBlocked(int64 existing_version);
73 // From IDBFactory.open() 74 // From IDBFactory.open()
74 virtual void OnUpgradeNeeded( 75 virtual void OnUpgradeNeeded(
75 int64 old_version, 76 int64 old_version,
76 scoped_refptr<IndexedDBDatabase> db, 77 scoped_refptr<IndexedDBDatabase> db,
77 const content::IndexedDBDatabaseMetadata& metadata); 78 const content::IndexedDBDatabaseMetadata& metadata,
79 WebKit::WebIDBCallbacks::DataLoss data_loss);
78 virtual void OnSuccess(scoped_refptr<IndexedDBDatabase> db, 80 virtual void OnSuccess(scoped_refptr<IndexedDBDatabase> db,
79 const content::IndexedDBDatabaseMetadata& metadata); 81 const content::IndexedDBDatabaseMetadata& metadata);
80 virtual void SetDatabaseCallbacks( 82 virtual void SetDatabaseCallbacks(
81 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks); 83 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks);
82 84
83 protected: 85 protected:
84 virtual ~IndexedDBCallbacksWrapper(); 86 virtual ~IndexedDBCallbacksWrapper();
85 explicit IndexedDBCallbacksWrapper(IndexedDBCallbacksBase* callbacks); 87 explicit IndexedDBCallbacksWrapper(IndexedDBCallbacksBase* callbacks);
86 88
87 private: 89 private:
88 friend class base::RefCounted<IndexedDBCallbacksWrapper>; 90 friend class base::RefCounted<IndexedDBCallbacksWrapper>;
89 scoped_ptr<WebIDBDatabaseImpl> web_database_impl_; 91 scoped_ptr<WebIDBDatabaseImpl> web_database_impl_;
90 scoped_ptr<IndexedDBCallbacksBase> callbacks_; 92 scoped_ptr<IndexedDBCallbacksBase> callbacks_;
91 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks_; 93 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks_;
92 bool did_complete_; 94 bool did_complete_;
93 bool did_create_proxy_; 95 bool did_create_proxy_;
94 }; 96 };
95 97
96 } // namespace content 98 } // namespace content
97 99
98 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_ 100 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_WRAPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698