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

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

Issue 1010833002: Expose bits of the Web Notification database in the //content API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-DeleteInContext
Patch Set: add NON_EXPORTED_BASE 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_data.h » ('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 2200a77e31b14165e67b53832a652ac8caa073ea..1f98f3763ae896bb7edad0520ab43ebc0b6049da 100644
--- a/content/browser/notifications/notification_database.cc
+++ b/content/browser/notifications/notification_database.cc
@@ -9,7 +9,7 @@
#include "base/files/file_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
-#include "content/browser/notifications/notification_database_data.h"
+#include "content/browser/notifications/notification_database_data_conversions.h"
#include "content/public/browser/browser_thread.h"
#include "storage/common/database/database_identifier.h"
#include "third_party/leveldatabase/src/helpers/memenv/memenv.h"
@@ -125,8 +125,10 @@ NotificationDatabase::Status NotificationDatabase::ReadNotificationData(
if (status != STATUS_OK)
return status;
- if (notification_database_data->ParseFromString(serialized_data))
+ if (DeserializeNotificationDatabaseData(serialized_data,
+ notification_database_data)) {
return STATUS_OK;
+ }
DLOG(ERROR) << "Unable to deserialize data for notification "
<< notification_id << " belonging to " << origin << ".";
@@ -143,7 +145,8 @@ NotificationDatabase::Status NotificationDatabase::WriteNotificationData(
DCHECK(origin.is_valid());
std::string serialized_data;
- if (!notification_database_data.SerializeToString(&serialized_data)) {
+ if (!SerializeNotificationDatabaseData(notification_database_data,
+ &serialized_data)) {
DLOG(ERROR) << "Unable to serialize data for a notification belonging "
<< "to: " << origin;
return STATUS_ERROR_FAILED;
« no previous file with comments | « no previous file | content/browser/notifications/notification_database_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698