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

Unified Diff: content/browser/indexed_db/indexed_db_callbacks.h

Issue 2109273002: IndexedDB: Created IndexedDBDataLossInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: initializing data loss in IndexedDBBackingStore::Open Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/indexed_db_callbacks.h
diff --git a/content/browser/indexed_db/indexed_db_callbacks.h b/content/browser/indexed_db/indexed_db_callbacks.h
index 4895c3be03f4af585d55c44cb0fc4184a186815b..683a15e76fe99f73091f22f56fa9d974d7dc143a 100644
--- a/content/browser/indexed_db/indexed_db_callbacks.h
+++ b/content/browser/indexed_db/indexed_db_callbacks.h
@@ -31,6 +31,11 @@ struct IndexedDBDatabaseMetadata;
struct IndexedDBReturnValue;
struct IndexedDBValue;
+struct IndexedDBDataLossInfo {
+ blink::WebIDBDataLoss status = blink::WebIDBDataLossNone;
+ std::string message;
+};
+
class CONTENT_EXPORT IndexedDBCallbacks
: public base::RefCounted<IndexedDBCallbacks> {
public:
@@ -62,8 +67,7 @@ class CONTENT_EXPORT IndexedDBCallbacks
virtual void OnBlocked(int64_t existing_version);
// IndexedDBFactory::Open
- virtual void OnDataLoss(blink::WebIDBDataLoss data_loss,
- std::string data_loss_message);
+ virtual void OnDataLoss(const IndexedDBDataLossInfo& data_loss_info);
virtual void OnUpgradeNeeded(
int64_t old_version,
std::unique_ptr<IndexedDBConnection> connection,
@@ -107,7 +111,9 @@ class CONTENT_EXPORT IndexedDBCallbacks
// IndexedDBCursor::Continue / Advance (when complete)
virtual void OnSuccess();
- blink::WebIDBDataLoss data_loss() const { return data_loss_; }
+ const IndexedDBDataLossInfo& data_loss_info() const {
+ return data_loss_info_;
+ }
void SetConnectionOpenStartTime(const base::TimeTicks& start_time);
@@ -134,9 +140,8 @@ class CONTENT_EXPORT IndexedDBCallbacks
int32_t ipc_database_id_;
int32_t ipc_database_callbacks_id_;
- // Stored in OnDataLoss, merged with OnUpgradeNeeded response.
- blink::WebIDBDataLoss data_loss_;
- std::string data_loss_message_;
+ // Used to assert that OnSuccess is only called if there was no data loss.
+ IndexedDBDataLossInfo data_loss_info_;
// The "blocked" event should be sent at most once per request.
bool sent_blocked_;
« no previous file with comments | « content/browser/indexed_db/indexed_db_backing_store_unittest.cc ('k') | content/browser/indexed_db/indexed_db_callbacks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698