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

Unified Diff: content/child/notifications/notification_data_conversions.cc

Issue 1388483002: Implement the Notification `timestamp` property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/child/notifications/notification_data_conversions.cc
diff --git a/content/child/notifications/notification_data_conversions.cc b/content/child/notifications/notification_data_conversions.cc
index 9f05f0d0b61f3719bd8fb0cd3769c95477c6bbf0..371967ad8e657554b21ac501a7320e0281944ce9 100644
--- a/content/child/notifications/notification_data_conversions.cc
+++ b/content/child/notifications/notification_data_conversions.cc
@@ -5,6 +5,7 @@
#include "content/child/notifications/notification_data_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/time/time.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/platform/WebVector.h"
@@ -40,6 +41,7 @@ PlatformNotificationData ToPlatformNotificationData(
platform_data.icon = GURL(web_data.icon.string());
platform_data.vibration_pattern.assign(web_data.vibrate.begin(),
web_data.vibrate.end());
+ platform_data.timestamp = base::Time::FromJsTime(web_data.timestamp);
johnme 2015/10/20 17:12:21 If JS passes MAX_ULL, it'll overflow base::Time, s
Peter Beverloo 2016/01/28 17:18:29 Done.
platform_data.silent = web_data.silent;
platform_data.require_interaction = web_data.requireInteraction;
platform_data.data.assign(web_data.data.begin(), web_data.data.end());
@@ -75,6 +77,7 @@ WebNotificationData ToWebNotificationData(
web_data.tag = blink::WebString::fromUTF8(platform_data.tag);
web_data.icon = blink::WebURL(platform_data.icon);
web_data.vibrate = platform_data.vibration_pattern;
+ web_data.timestamp = platform_data.timestamp.ToJsTime();
johnme 2015/10/20 17:12:21 I don't think underflow is possible, and I think z
Peter Beverloo 2016/01/28 17:18:29 Done.
web_data.silent = platform_data.silent;
web_data.requireInteraction = platform_data.require_interaction;
web_data.data = platform_data.data;

Powered by Google App Engine
This is Rietveld 408576698