Changeset 199581 in webkit


Ignore:
Timestamp:
Apr 15, 2016 12:22:50 AM (8 years ago)
Author:
beidson@apple.com
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:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r199580 r199581  
     12016-04-15  Brady Eidson  <beidson@apple.com>
     2
     3        Add the message property to DOMError.
     4        https://bugs.webkit.org/show_bug.cgi?id=139173
     5
     6        Reviewed by Alex Christensen.
     7
     8        * storage/indexeddb/createIndex-after-failure-expected.txt:
     9        * storage/indexeddb/createIndex-after-failure-private-expected.txt:
     10        * storage/indexeddb/intversion-upgrades-expected.txt:
     11        * storage/indexeddb/intversion-upgrades-private-expected.txt:
     12
    1132016-04-15  Jiewen Tan  <jiewen_tan@apple.com>
    214
  • trunk/LayoutTests/storage/indexeddb/createIndex-after-failure-expected.txt

    r195181 r199581  
    1717Now requesting object2
    1818now we wait.
    19 Error function called: (AbortError) undefined
    20 PASS Abort function called: (ConstraintError) undefined
     19Error function called: (AbortError) The transaction was aborted, so the request cannot be fulfilled.
     20PASS Abort function called: (ConstraintError) A mutation operation in the transaction failed because a constraint was not satisfied.
    2121PASS successfullyParsed is true
    2222
  • trunk/LayoutTests/storage/indexeddb/createIndex-after-failure-private-expected.txt

    r195247 r199581  
    1717Now requesting object2
    1818now we wait.
    19 Error function called: (AbortError) undefined
    20 PASS Abort function called: (ConstraintError) undefined
     19Error function called: (AbortError) The transaction was aborted, so the request cannot be fulfilled.
     20PASS Abort function called: (ConstraintError) A mutation operation in the transaction failed because a constraint was not satisfied.
    2121PASS successfullyParsed is true
    2222
  • trunk/LayoutTests/storage/indexeddb/intversion-upgrades-expected.txt

    r195181 r199581  
    5555
    5656errorWhenTryingLowVersion():
    57 request.error.message = undefined
     57request.error.message = An attempt was made to open a database using a lower version than the existing version.
    5858request = indexedDB.open(dbname, 4)
    5959request.onupgradeneeded = connection4UpgradeNeeded
  • trunk/LayoutTests/storage/indexeddb/intversion-upgrades-private-expected.txt

    r195247 r199581  
    5555
    5656errorWhenTryingLowVersion():
    57 request.error.message = undefined
     57request.error.message = An attempt was made to open a database using a lower version than the existing version.
    5858request = indexedDB.open(dbname, 4)
    5959request.onupgradeneeded = connection4UpgradeNeeded
  • trunk/Source/WebCore/ChangeLog

    r199571 r199581  
     12016-04-15  Brady Eidson  <beidson@apple.com>
     2
     3        Add the message property to DOMError.
     4        https://bugs.webkit.org/show_bug.cgi?id=139173
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests (Updated existing tests).
     9       
     10        Adding this property brings us up to date with other browsers, and will help
     11        test the few web features that still use DOMError.
     12
     13        * Modules/indexeddb/IDBOpenDBRequest.cpp:
     14        (WebCore::IDBOpenDBRequest::onError):
     15        (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
     16
     17        * Modules/indexeddb/IDBRequest.cpp:
     18        (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
     19        (WebCore::IDBRequest::onError):
     20
     21        * Modules/indexeddb/IDBTransaction.cpp:
     22        (WebCore::IDBTransaction::didCreateIndexOnServer):
     23
     24        * Modules/mediastream/NavigatorUserMediaError.h:
     25        (WebCore::NavigatorUserMediaError::NavigatorUserMediaError):
     26
     27        * dom/DOMError.cpp:
     28        (WebCore::DOMError::DOMError):
     29
     30        * dom/DOMError.h:
     31        (WebCore::DOMError::create):
     32        (WebCore::DOMError::message):
     33        * dom/DOMError.idl:
     34
    1352016-04-14  Brent Fulgham  <bfulgham@apple.com>
    236
  • trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp

    r198762 r199581  
    6565void IDBOpenDBRequest::onError(const IDBResultData& data)
    6666{
    67     m_domError = DOMError::create(data.error().name());
     67    m_domError = DOMError::create(data.error().name(), data.error().message());
    6868    enqueueEvent(IDBRequestCompletionEvent::create(eventNames().errorEvent, true, true, *this));
    6969}
     
    9898
    9999    IDBError idbError(IDBDatabaseException::AbortError);
    100     m_domError = DOMError::create(idbError.name());
     100    m_domError = DOMError::create(idbError.name(), idbError.message());
    101101    m_result = IDBAny::createUndefined();
    102102
  • trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp

    r199524 r199581  
    322322
    323323    if (m_transaction && m_idbError.code() != IDBDatabaseException::AbortError)
    324         m_transaction->abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError)));
     324        m_transaction->abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError), ASCIILiteral("IDBTransaction will abort due to uncaught exception in an event handler")));
    325325}
    326326
     
    422422
    423423    ASSERT(!m_idbError.isNull());
    424     m_domError = DOMError::create(m_idbError.name());
     424    m_domError = DOMError::create(m_idbError.name(), m_idbError.message());
    425425    enqueueEvent(Event::create(eventNames().errorEvent, true, true));
    426426}
  • trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp

    r199524 r199581  
    597597
    598598    // Otherwise, failure to create an index forced abortion of the transaction.
    599     abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(resultData.error().code())));
     599    abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(resultData.error().code()), resultData.error().message()));
    600600}
    601601
  • trunk/Source/WebCore/Modules/mediastream/NavigatorUserMediaError.h

    r184940 r199581  
    5151private:
    5252    NavigatorUserMediaError(const String& name, const String& constraintName)
    53         : DOMError(name)
     53        : DOMError(name, { })
    5454        , m_constraintName(constraintName)
    5555    {
  • trunk/Source/WebCore/dom/DOMError.cpp

    r158569 r199581  
    11/*
    22 * Copyright (C) 2012 Google Inc. All Rights Reserved.
     3 * Copyright (C) 2016 Apple Inc. All Rights Reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2728#include "DOMError.h"
    2829
    29 
    3030namespace WebCore {
    3131
    32 DOMError::DOMError(const String& name)
     32DOMError::DOMError(const String& name, const String& message)
    3333    : m_name(name)
     34    , m_message(message)
    3435{
    3536}
  • trunk/Source/WebCore/dom/DOMError.h

    r177733 r199581  
    11/*
    22 * Copyright (C) 2012 Google Inc. All Rights Reserved.
     3 * Copyright (C) 2016 Apple Inc. All Rights Reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3435class DOMError : public RefCounted<DOMError> {
    3536public:
    36     static Ref<DOMError> create(const String& name)
     37    static Ref<DOMError> create(const String& name, const String& message = { })
    3738    {
    38         return adoptRef(*new DOMError(name));
     39        return adoptRef(*new DOMError(name, message));
    3940    }
    4041    virtual ~DOMError() { }
    4142
    4243    const String& name() const { return m_name; }
     44    const String& message() const { return m_message; }
    4345
    4446protected:
    45     explicit DOMError(const String& name);
     47    explicit DOMError(const String& name, const String& message);
    4648
    4749private:
    48     const String m_name;
     50    String m_name;
     51    String m_message;
    4952};
    5053
  • trunk/Source/WebCore/dom/DOMError.idl

    r165676 r199581  
    3131] interface  DOMError {
    3232    readonly attribute DOMString name;
     33    readonly attribute DOMString message;
    3334};
    3435
Note: See TracChangeset for help on using the changeset viewer.