Changeset 57865 in webkit


Ignore:
Timestamp:
Apr 19, 2010 8:59:54 PM (14 years ago)
Author:
dumi@chromium.org
Message:

Bindings clean-up.
https://bugs.webkit.org/show_bug.cgi?id=37833

Reviewed by Geoffrey Garen.

Move some WebSQLDatabases logic out of the bindings into
DOMWindow.cpp where it should be.

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::openDatabase):

  • bindings/v8/custom/V8DOMWindowCustom.cpp:

(WebCore::V8DOMWindow::openDatabaseCallback):

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::openDatabase):

Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r57864 r57865  
     12010-04-19  Dumitru Daniliuc  <dumi@chromium.org>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        Bindings clean-up.
     6        https://bugs.webkit.org/show_bug.cgi?id=37833
     7
     8        Move some WebSQLDatabases logic out of the bindings into
     9        DOMWindow.cpp where it should be.
     10
     11        * bindings/js/JSDOMWindowCustom.cpp:
     12        (WebCore::JSDOMWindow::openDatabase):
     13        * bindings/v8/custom/V8DOMWindowCustom.cpp:
     14        (WebCore::V8DOMWindow::openDatabaseCallback):
     15        * page/DOMWindow.cpp:
     16        (WebCore::DOMWindow::openDatabase):
     17
    1182010-04-19  Kevin Ollivier  <kevino@theolliviers.com>
    219
  • trunk/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r57766 r57865  
    978978
    979979    JSValue result = toJS(exec, globalObject(), WTF::getPtr(impl()->openDatabase(ustringToString(name), ustringToString(version), ustringToString(displayName), estimatedSize, creationCallback.release(), ec)));
    980     if (!ec && result.isNull())
    981         ec = SECURITY_ERR;
    982980
    983981    setDOMException(exec, ec);
  • trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp

    r57492 r57865  
    736736
    737737    v8::Handle<v8::Value> result = toV8(imp->openDatabase(name, version, displayName, estimatedSize, creationCallback.release(), ec));
    738     if (!ec && result.IsEmpty())
    739         ec = SECURITY_ERR;
    740738
    741739    V8Proxy::setDOMException(ec);
  • trunk/WebCore/page/DOMWindow.cpp

    r57809 r57865  
    12001200PassRefPtr<Database> DOMWindow::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
    12011201{
    1202     if (!m_frame)
    1203         return 0;
    1204 
    1205     if (!Database::isAvailable())
    1206         return 0;
    1207 
    1208     Document* document = m_frame->document();
    1209     if (!document->securityOrigin()->canAccessDatabase()) {
     1202    RefPtr<Database> database = 0;
     1203    if (m_frame && Database::isAvailable() && m_frame->document()->securityOrigin()->canAccessDatabase())
     1204        database = Database::openDatabase(m_frame->document(), name, version, displayName, estimatedSize, creationCallback, ec);
     1205
     1206    if (!database && !ec)
    12101207        ec = SECURITY_ERR;
    1211         return 0;
    1212     }
    1213 
    1214     return Database::openDatabase(document, name, version, displayName, estimatedSize, creationCallback, ec);
     1208
     1209    return database;
    12151210}
    12161211#endif
Note: See TracChangeset for help on using the changeset viewer.