Title: [199581] trunk
Revision
199581
Author
[email protected]
Date
2016-04-15 00:22:50 -0700 (Fri, 15 Apr 2016)

Log Message

Add the message property to DOMError.
https://bugs.webkit.org/show_bug.cgi?id=139173

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Updated existing tests).

Adding this property brings us up to date with other browsers, and will help
test the few web features that still use DOMError.

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onError):
(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::uncaughtExceptionInEventHandler):
(WebCore::IDBRequest::onError):

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::didCreateIndexOnServer):

* Modules/mediastream/NavigatorUserMediaError.h:
(WebCore::NavigatorUserMediaError::NavigatorUserMediaError):

* dom/DOMError.cpp:
(WebCore::DOMError::DOMError):

* dom/DOMError.h:
(WebCore::DOMError::create):
(WebCore::DOMError::message):
* dom/DOMError.idl:

LayoutTests:

* storage/indexeddb/createIndex-after-failure-expected.txt:
* storage/indexeddb/createIndex-after-failure-private-expected.txt:
* storage/indexeddb/intversion-upgrades-expected.txt:
* storage/indexeddb/intversion-upgrades-private-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (199580 => 199581)


--- trunk/LayoutTests/ChangeLog	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/LayoutTests/ChangeLog	2016-04-15 07:22:50 UTC (rev 199581)
@@ -1,3 +1,15 @@
+2016-04-15  Brady Eidson  <[email protected]>
+
+        Add the message property to DOMError.
+        https://bugs.webkit.org/show_bug.cgi?id=139173
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/createIndex-after-failure-expected.txt:
+        * storage/indexeddb/createIndex-after-failure-private-expected.txt:
+        * storage/indexeddb/intversion-upgrades-expected.txt:
+        * storage/indexeddb/intversion-upgrades-private-expected.txt:
+
 2016-04-15  Jiewen Tan  <[email protected]>
 
         Mark perf/array-binary-search.html as flaky on ios-simulator-wk2

Modified: trunk/LayoutTests/storage/indexeddb/createIndex-after-failure-expected.txt (199580 => 199581)


--- trunk/LayoutTests/storage/indexeddb/createIndex-after-failure-expected.txt	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/LayoutTests/storage/indexeddb/createIndex-after-failure-expected.txt	2016-04-15 07:22:50 UTC (rev 199581)
@@ -16,8 +16,8 @@
 Exception message: Failed to execute 'deleteIndex' on 'IDBObjectStore': The specified index was not found.
 Now requesting object2
 now we wait.
-Error function called: (AbortError) undefined
-PASS Abort function called: (ConstraintError) undefined
+Error function called: (AbortError) The transaction was aborted, so the request cannot be fulfilled.
+PASS Abort function called: (ConstraintError) A mutation operation in the transaction failed because a constraint was not satisfied.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/createIndex-after-failure-private-expected.txt (199580 => 199581)


--- trunk/LayoutTests/storage/indexeddb/createIndex-after-failure-private-expected.txt	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/LayoutTests/storage/indexeddb/createIndex-after-failure-private-expected.txt	2016-04-15 07:22:50 UTC (rev 199581)
@@ -16,8 +16,8 @@
 Exception message: Failed to execute 'deleteIndex' on 'IDBObjectStore': The specified index was not found.
 Now requesting object2
 now we wait.
-Error function called: (AbortError) undefined
-PASS Abort function called: (ConstraintError) undefined
+Error function called: (AbortError) The transaction was aborted, so the request cannot be fulfilled.
+PASS Abort function called: (ConstraintError) A mutation operation in the transaction failed because a constraint was not satisfied.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/intversion-upgrades-expected.txt (199580 => 199581)


--- trunk/LayoutTests/storage/indexeddb/intversion-upgrades-expected.txt	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/LayoutTests/storage/indexeddb/intversion-upgrades-expected.txt	2016-04-15 07:22:50 UTC (rev 199581)
@@ -54,7 +54,7 @@
 request._onerror_ = errorWhenTryingLowVersion
 
 errorWhenTryingLowVersion():
-request.error.message = undefined
+request.error.message = An attempt was made to open a database using a lower version than the existing version.
 request = indexedDB.open(dbname, 4)
 request._onupgradeneeded_ = connection4UpgradeNeeded
 request._onsuccess_ = connection4Success

Modified: trunk/LayoutTests/storage/indexeddb/intversion-upgrades-private-expected.txt (199580 => 199581)


--- trunk/LayoutTests/storage/indexeddb/intversion-upgrades-private-expected.txt	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/LayoutTests/storage/indexeddb/intversion-upgrades-private-expected.txt	2016-04-15 07:22:50 UTC (rev 199581)
@@ -54,7 +54,7 @@
 request._onerror_ = errorWhenTryingLowVersion
 
 errorWhenTryingLowVersion():
-request.error.message = undefined
+request.error.message = An attempt was made to open a database using a lower version than the existing version.
 request = indexedDB.open(dbname, 4)
 request._onupgradeneeded_ = connection4UpgradeNeeded
 request._onsuccess_ = connection4Success

Modified: trunk/Source/WebCore/ChangeLog (199580 => 199581)


--- trunk/Source/WebCore/ChangeLog	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/Source/WebCore/ChangeLog	2016-04-15 07:22:50 UTC (rev 199581)
@@ -1,3 +1,37 @@
+2016-04-15  Brady Eidson  <[email protected]>
+
+        Add the message property to DOMError.
+        https://bugs.webkit.org/show_bug.cgi?id=139173
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Updated existing tests).
+        
+        Adding this property brings us up to date with other browsers, and will help
+        test the few web features that still use DOMError.
+
+        * Modules/indexeddb/IDBOpenDBRequest.cpp:
+        (WebCore::IDBOpenDBRequest::onError):
+        (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
+
+        * Modules/indexeddb/IDBRequest.cpp:
+        (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
+        (WebCore::IDBRequest::onError):
+
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::didCreateIndexOnServer):
+
+        * Modules/mediastream/NavigatorUserMediaError.h:
+        (WebCore::NavigatorUserMediaError::NavigatorUserMediaError):
+
+        * dom/DOMError.cpp:
+        (WebCore::DOMError::DOMError):
+
+        * dom/DOMError.h:
+        (WebCore::DOMError::create):
+        (WebCore::DOMError::message):
+        * dom/DOMError.idl:
+
 2016-04-14  Brent Fulgham  <[email protected]>
 
         Make <a download> a runtime enabled option

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp (199580 => 199581)


--- trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp	2016-04-15 07:22:50 UTC (rev 199581)
@@ -64,7 +64,7 @@
 
 void IDBOpenDBRequest::onError(const IDBResultData& data)
 {
-    m_domError = DOMError::create(data.error().name());
+    m_domError = DOMError::create(data.error().name(), data.error().message());
     enqueueEvent(IDBRequestCompletionEvent::create(eventNames().errorEvent, true, true, *this));
 }
 
@@ -97,7 +97,7 @@
     ASSERT(hasPendingActivity());
 
     IDBError idbError(IDBDatabaseException::AbortError);
-    m_domError = DOMError::create(idbError.name());
+    m_domError = DOMError::create(idbError.name(), idbError.message());
     m_result = IDBAny::createUndefined();
 
     m_transaction->addRequest(*this);

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (199580 => 199581)


--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp	2016-04-15 07:22:50 UTC (rev 199581)
@@ -321,7 +321,7 @@
     LOG(IndexedDB, "IDBRequest::uncaughtExceptionInEventHandler");
 
     if (m_transaction && m_idbError.code() != IDBDatabaseException::AbortError)
-        m_transaction->abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError)));
+        m_transaction->abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError), ASCIILiteral("IDBTransaction will abort due to uncaught exception in an event handler")));
 }
 
 void IDBRequest::setResult(const IDBKeyData* keyData)
@@ -421,7 +421,7 @@
     LOG(IndexedDB, "IDBRequest::onError");
 
     ASSERT(!m_idbError.isNull());
-    m_domError = DOMError::create(m_idbError.name());
+    m_domError = DOMError::create(m_idbError.name(), m_idbError.message());
     enqueueEvent(Event::create(eventNames().errorEvent, true, true));
 }
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (199580 => 199581)


--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp	2016-04-15 07:22:50 UTC (rev 199581)
@@ -596,7 +596,7 @@
         return;
 
     // Otherwise, failure to create an index forced abortion of the transaction.
-    abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(resultData.error().code())));
+    abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(resultData.error().code()), resultData.error().message()));
 }
 
 Ref<IDBRequest> IDBTransaction::requestOpenCursor(ScriptExecutionContext& context, IDBObjectStore& objectStore, const IDBCursorInfo& info)

Modified: trunk/Source/WebCore/Modules/mediastream/NavigatorUserMediaError.h (199580 => 199581)


--- trunk/Source/WebCore/Modules/mediastream/NavigatorUserMediaError.h	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/Source/WebCore/Modules/mediastream/NavigatorUserMediaError.h	2016-04-15 07:22:50 UTC (rev 199581)
@@ -50,7 +50,7 @@
 
 private:
     NavigatorUserMediaError(const String& name, const String& constraintName)
-        : DOMError(name)
+        : DOMError(name, { })
         , m_constraintName(constraintName)
     {
     }

Modified: trunk/Source/WebCore/dom/DOMError.cpp (199580 => 199581)


--- trunk/Source/WebCore/dom/DOMError.cpp	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/Source/WebCore/dom/DOMError.cpp	2016-04-15 07:22:50 UTC (rev 199581)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2012 Google Inc. All Rights Reserved.
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,11 +27,11 @@
 #include "config.h"
 #include "DOMError.h"
 
-
 namespace WebCore {
 
-DOMError::DOMError(const String& name)
+DOMError::DOMError(const String& name, const String& message)
     : m_name(name)
+    , m_message(message)
 {
 }
 

Modified: trunk/Source/WebCore/dom/DOMError.h (199580 => 199581)


--- trunk/Source/WebCore/dom/DOMError.h	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/Source/WebCore/dom/DOMError.h	2016-04-15 07:22:50 UTC (rev 199581)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2012 Google Inc. All Rights Reserved.
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,19 +34,21 @@
 
 class DOMError : public RefCounted<DOMError> {
 public:
-    static Ref<DOMError> create(const String& name)
+    static Ref<DOMError> create(const String& name, const String& message = { })
     {
-        return adoptRef(*new DOMError(name));
+        return adoptRef(*new DOMError(name, message));
     }
     virtual ~DOMError() { }
 
     const String& name() const { return m_name; }
+    const String& message() const { return m_message; }
 
 protected:
-    explicit DOMError(const String& name);
+    explicit DOMError(const String& name, const String& message);
 
 private:
-    const String m_name;
+    String m_name;
+    String m_message;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/DOMError.idl (199580 => 199581)


--- trunk/Source/WebCore/dom/DOMError.idl	2016-04-15 07:02:17 UTC (rev 199580)
+++ trunk/Source/WebCore/dom/DOMError.idl	2016-04-15 07:22:50 UTC (rev 199581)
@@ -30,5 +30,6 @@
     SkipVTableValidation
 ] interface  DOMError {
     readonly attribute DOMString name;
+    readonly attribute DOMString message;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to