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

Unified Diff: third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp

Issue 1636483002: Update the PushEvent to have a nullable PushMessageData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and integrate OWNERS code review comments Created 4 years, 11 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: third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
index f0842173fc71cdb32bcd0fcdc83ecbbb73922143..ea2617457d935d15fdd69c48d2fe93243e51310c 100644
--- a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
+++ b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
@@ -18,6 +18,11 @@ namespace blink {
PushMessageData* PushMessageData::create(const String& messageString)
{
+ // The standard supports both an empty but valid message and a null message.
+ // In case the message is explicitly null, return a null pointer which will
+ // be set in the PushEvent.
+ if (messageString.isNull())
+ return nullptr;
return PushMessageData::create(ArrayBufferOrArrayBufferViewOrUSVString::fromUSVString(messageString));
}

Powered by Google App Engine
This is Rietveld 408576698