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

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

Issue 19724003: Revert "Transition modules/** to use ExceptionState" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
« no previous file with comments | « Source/modules/notifications/Notification.h ('k') | Source/modules/notifications/NotificationCenter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/notifications/Notification.cpp
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
index 2fa9a0e258bbdf96461a5753605e74e47f3343b0..667186ddeccb6aa2f13fd57fed37b93a85a2bbdf 100644
--- a/Source/modules/notifications/Notification.cpp
+++ b/Source/modules/notifications/Notification.cpp
@@ -36,7 +36,6 @@
#include "modules/notifications/Notification.h"
#include "bindings/v8/Dictionary.h"
-#include "bindings/v8/ExceptionState.h"
#include "core/dom/Document.h"
#include "core/dom/ErrorEvent.h"
#include "core/dom/EventNames.h"
@@ -61,7 +60,7 @@ Notification::Notification()
}
#if ENABLE(LEGACY_NOTIFICATIONS)
-Notification::Notification(const KURL& url, ScriptExecutionContext* context, ExceptionState& es, PassRefPtr<NotificationCenter> provider)
+Notification::Notification(const KURL& url, ScriptExecutionContext* context, ExceptionCode& ec, PassRefPtr<NotificationCenter> provider)
: ActiveDOMObject(context)
, m_isHTML(true)
, m_state(Idle)
@@ -69,12 +68,12 @@ Notification::Notification(const KURL& url, ScriptExecutionContext* context, Exc
{
ScriptWrappable::init(this);
if (m_notificationCenter->checkPermission() != NotificationClient::PermissionAllowed) {
- es.throwDOMException(SecurityError);
+ ec = SecurityError;
return;
}
if (url.isEmpty() || !url.isValid()) {
- es.throwDOMException(SyntaxError);
+ ec = SyntaxError;
return;
}
@@ -83,7 +82,7 @@ Notification::Notification(const KURL& url, ScriptExecutionContext* context, Exc
#endif
#if ENABLE(LEGACY_NOTIFICATIONS)
-Notification::Notification(const String& title, const String& body, const String& iconURI, ScriptExecutionContext* context, ExceptionState& es, PassRefPtr<NotificationCenter> provider)
+Notification::Notification(const String& title, const String& body, const String& iconURI, ScriptExecutionContext* context, ExceptionCode& ec, PassRefPtr<NotificationCenter> provider)
: ActiveDOMObject(context)
, m_isHTML(false)
, m_title(title)
@@ -93,13 +92,13 @@ Notification::Notification(const String& title, const String& body, const String
{
ScriptWrappable::init(this);
if (m_notificationCenter->checkPermission() != NotificationClient::PermissionAllowed) {
- es.throwDOMException(SecurityError);
+ ec = SecurityError;
return;
}
m_icon = iconURI.isEmpty() ? KURL() : scriptExecutionContext()->completeURL(iconURI);
if (!m_icon.isEmpty() && !m_icon.isValid()) {
- es.throwDOMException(SyntaxError);
+ ec = SyntaxError;
return;
}
}
@@ -126,16 +125,16 @@ Notification::~Notification()
}
#if ENABLE(LEGACY_NOTIFICATIONS)
-PassRefPtr<Notification> Notification::create(const KURL& url, ScriptExecutionContext* context, ExceptionState& es, PassRefPtr<NotificationCenter> provider)
+PassRefPtr<Notification> Notification::create(const KURL& url, ScriptExecutionContext* context, ExceptionCode& ec, PassRefPtr<NotificationCenter> provider)
{
- RefPtr<Notification> notification(adoptRef(new Notification(url, context, es, provider)));
+ RefPtr<Notification> notification(adoptRef(new Notification(url, context, ec, provider)));
notification->suspendIfNeeded();
return notification.release();
}
-PassRefPtr<Notification> Notification::create(const String& title, const String& body, const String& iconURI, ScriptExecutionContext* context, ExceptionState& es, PassRefPtr<NotificationCenter> provider)
+PassRefPtr<Notification> Notification::create(const String& title, const String& body, const String& iconURI, ScriptExecutionContext* context, ExceptionCode& ec, PassRefPtr<NotificationCenter> provider)
{
- RefPtr<Notification> notification(adoptRef(new Notification(title, body, iconURI, context, es, provider)));
+ RefPtr<Notification> notification(adoptRef(new Notification(title, body, iconURI, context, ec, provider)));
notification->suspendIfNeeded();
return notification.release();
}
« no previous file with comments | « Source/modules/notifications/Notification.h ('k') | Source/modules/notifications/NotificationCenter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698