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

Unified Diff: content/browser/notifications/notification_database.cc

Issue 1025743002: Write the assigned notification id to the stored notification data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | content/browser/notifications/notification_database_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/notifications/notification_database.cc
diff --git a/content/browser/notifications/notification_database.cc b/content/browser/notifications/notification_database.cc
index 25350b952222dfef5cd58b34179bf6aa1bc2759d..f97ef4cf10ef04c20c9db29f4b565f097323fc12 100644
--- a/content/browser/notifications/notification_database.cc
+++ b/content/browser/notifications/notification_database.cc
@@ -189,16 +189,19 @@ NotificationDatabase::Status NotificationDatabase::WriteNotificationData(
DCHECK(notification_id);
DCHECK(origin.is_valid());
+ DCHECK_GE(next_notification_id_, kFirstNotificationId);
+
+ NotificationDatabaseData storage_data = notification_database_data;
+ storage_data.notification_id = next_notification_id_;
+
std::string serialized_data;
- if (!SerializeNotificationDatabaseData(notification_database_data,
+ if (!SerializeNotificationDatabaseData(storage_data,
&serialized_data)) {
DLOG(ERROR) << "Unable to serialize data for a notification belonging "
<< "to: " << origin;
return STATUS_ERROR_FAILED;
}
- DCHECK_GE(next_notification_id_, kFirstNotificationId);
-
leveldb::WriteBatch batch;
batch.Put(CreateDataKey(origin, next_notification_id_), serialized_data);
batch.Put(kNextNotificationIdKey,
« no previous file with comments | « no previous file | content/browser/notifications/notification_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698