Index: Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp |
diff --git a/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp b/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp |
index eaf56e840d7437aab3a97453af1835a9dce4f7e9..532642362999293e8ede385263ec4c039aef7c35 100644 |
--- a/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp |
+++ b/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp |
@@ -7,6 +7,9 @@ |
#include "bindings/core/v8/CallbackPromiseAdapter.h" |
#include "bindings/core/v8/ScriptPromiseResolver.h" |
+#include "bindings/core/v8/ScriptValue.h" |
+#include "bindings/core/v8/SerializedScriptValue.h" |
+#include "bindings/core/v8/SerializedScriptValueFactory.h" |
#include "bindings/core/v8/V8ThrowException.h" |
#include "core/dom/DOMException.h" |
#include "core/dom/ExceptionCode.h" |
@@ -21,7 +24,7 @@ |
namespace blink { |
-ScriptPromise ServiceWorkerRegistrationNotifications::showNotification(ScriptState* scriptState, ServiceWorkerRegistration& serviceWorkerRegistration, const String& title, const NotificationOptions& options) |
+ScriptPromise ServiceWorkerRegistrationNotifications::showNotification(ScriptState* scriptState, ServiceWorkerRegistration& serviceWorkerRegistration, const String& title, const NotificationOptions& options, ExceptionState& exceptionState) |
{ |
ExecutionContext* executionContext = scriptState->executionContext(); |
@@ -46,7 +49,14 @@ ScriptPromise ServiceWorkerRegistrationNotifications::showNotification(ScriptSta |
} |
WebNotificationData::Direction dir = options.dir() == "rtl" ? WebNotificationData::DirectionRightToLeft : WebNotificationData::DirectionLeftToRight; |
- WebNotificationData notification(title, dir, options.lang(), options.body(), options.tag(), iconUrl, options.silent()); |
+ |
Peter Beverloo
2015/03/10 23:34:27
Mmm this duplication is not great. It happens in m
Sanghyun Park
2015/03/11 10:59:52
I cannot understand your comment properly.
Is you
|
+ RefPtr<SerializedScriptValue> data; |
+ if (options.hasData()) { |
+ data = SerializedScriptValueFactory::instance().create(options.data(), 0, exceptionState, options.data().isolate()); |
Peter Beverloo
2015/03/10 23:34:27
nit: dito as in Notification.cpp, if exceptionStat
Sanghyun Park
2015/03/11 10:59:52
I'll fix this.
|
+ data->registerMemoryAllocatedWithCurrentScriptContext(); |
Peter Beverloo
2015/03/10 23:34:27
nit: dito as in Notification.cpp, we shouldn't hav
Sanghyun Park
2015/03/11 10:59:52
Ditto
|
+ } |
+ |
+ WebNotificationData notification(title, dir, options.lang(), options.body(), options.tag(), iconUrl, options.silent(), data.release()); |
Peter Beverloo
2015/03/10 23:34:27
note: data.release() is fine here, because we won'
|
WebNotificationShowCallbacks* callbacks = new CallbackPromiseAdapter<void, void>(resolver); |
SecurityOrigin* origin = executionContext->securityOrigin(); |