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

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

Issue 1072873002: Clean up Blink left-overs of textual persistent notification ids. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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: Source/modules/notifications/Notification.cpp
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
index 867e438265d8171fc5c7cefd73b3a477a9b5f150..89e8e733612e37b6ddd56df6077ebad7b07e91db 100644
--- a/Source/modules/notifications/Notification.cpp
+++ b/Source/modules/notifications/Notification.cpp
@@ -135,31 +135,6 @@ Notification* Notification::create(ExecutionContext* context, int64_t persistent
return notification;
}
-Notification* Notification::create(ExecutionContext* context, const String& persistentId, const WebNotificationData& data)
-{
- Notification* notification = new Notification(data.title, context);
-
- notification->setPersistentIdString(persistentId);
- notification->setDir(data.direction == WebNotificationData::DirectionLeftToRight ? "ltr" : "rtl");
- notification->setLang(data.lang);
- notification->setBody(data.body);
- notification->setTag(data.tag);
- notification->setSilent(data.silent);
-
- if (!data.icon.isEmpty())
- notification->setIconUrl(data.icon);
-
- const WebVector<char>& dataBytes = data.data;
- if (!dataBytes.isEmpty()) {
- notification->setSerializedData(SerializedScriptValueFactory::instance().createFromWireBytes(dataBytes.data(), dataBytes.size()));
- notification->serializedData()->registerMemoryAllocatedWithCurrentScriptContext();
- }
-
- notification->setState(NotificationStateShowing);
- notification->suspendIfNeeded();
- return notification;
-}
-
Notification::Notification(const String& title, ExecutionContext* context)
: ActiveDOMObject(context)
, m_title(title)
@@ -213,7 +188,7 @@ void Notification::close()
if (m_state != NotificationStateShowing)
return;
- if (m_persistentIdString.isEmpty() && m_persistentId == kInvalidPersistentId) {
+ if (m_persistentId == kInvalidPersistentId) {
// Fire the close event asynchronously.
executionContext()->postTask(FROM_HERE, createSameThreadTask(&Notification::dispatchCloseEvent, this));
@@ -225,10 +200,7 @@ void Notification::close()
SecurityOrigin* origin = executionContext()->securityOrigin();
ASSERT(origin);
- if (!m_persistentIdString.isEmpty())
- notificationManager()->closePersistent(WebSerializedOrigin(*origin), m_persistentIdString);
- else
- notificationManager()->closePersistent(WebSerializedOrigin(*origin), m_persistentId);
+ notificationManager()->closePersistent(WebSerializedOrigin(*origin), m_persistentId);
}
}

Powered by Google App Engine
This is Rietveld 408576698