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

Unified Diff: third_party/WebKit/Source/modules/notifications/Notification.cpp

Issue 2106843005: Use SaveSameObject for Notification.data as well (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-action-vibrate
Patch Set: Created 4 years, 6 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/notifications/Notification.cpp
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.cpp b/third_party/WebKit/Source/modules/notifications/Notification.cpp
index 45a5271c50f13d01eb8e0702bb5aee28a678253f..a3822b1a31487dc203ac8e238433949a4bdfc57d 100644
--- a/third_party/WebKit/Source/modules/notifications/Notification.cpp
+++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp
@@ -294,13 +294,10 @@ bool Notification::requireInteraction() const
ScriptValue Notification::data(ScriptState* scriptState)
{
- if (m_developerData.isEmpty()) {
- const WebVector<char>& serializedData = m_data.data;
- RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(serializedData.data(), serializedData.size());
- m_developerData = ScriptValue(scriptState, serializedValue->deserialize(scriptState->isolate()));
- }
+ const WebVector<char>& serializedData = m_data.data;
+ RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(serializedData.data(), serializedData.size());
- return m_developerData;
+ return ScriptValue(scriptState, serializedValue->deserialize(scriptState->isolate()));
}
Vector<v8::Local<v8::Value>> Notification::actions(ScriptState* scriptState) const

Powered by Google App Engine
This is Rietveld 408576698