[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

jorlow at chromium.org jorlow at chromium.org
Thu Apr 8 02:18:33 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 8cee44d555fe5583377eb22af70fc2340efe31b6
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Mar 10 15:34:54 2010 +0000

    Baby steps towards IndexedDB: Start implementing callbacks.
    https://bugs.webkit.org/show_bug.cgi?id=35911
    
    Reviewed by Dimitry Glazkov.
    
    This patch adds some infastructure for IndexedDB callbacks in V8.
    It also adds a stub of IDBDatabaseRequest.  In the near future,
    I'll gut the event based implementation code, flesh out IDBReqest
    further, and start plumbing IndexedDatabaseRequest.
    
    Code is not testible because it doesn't work (yet).
    
    * WebCore.gypi:
    * bindings/v8/DOMObjectsInclude.h:
    * bindings/v8/V8Index.cpp:
    * bindings/v8/V8Index.h:
    * bindings/v8/custom/V8CustomIDBCallback.h: Added.
    (WebCore::V8CustomIDBCallback::create):
    (WebCore::V8CustomIDBCallback::~V8CustomIDBCallback):
    (WebCore::V8CustomIDBCallback::handleEvent):
    (WebCore::V8CustomIDBCallback::V8CustomIDBCallback):
    * bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp:
    (WebCore::V8IndexedDatabaseRequest::openCallback):
    * storage/IDBDatabaseRequest.h: Added.
    (WebCore::IDBDatabaseRequest::request):
    * storage/IDBDatabaseRequest.idl: Added.
    * storage/IndexedDatabaseRequest.idl:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55778 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ef85445..29a3727 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,33 @@
+2010-03-10  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Dimitry Glazkov.
+
+        Baby steps towards IndexedDB: Start implementing callbacks.
+        https://bugs.webkit.org/show_bug.cgi?id=35911
+
+        This patch adds some infastructure for IndexedDB callbacks in V8.
+        It also adds a stub of IDBDatabaseRequest.  In the near future,
+        I'll gut the event based implementation code, flesh out IDBReqest
+        further, and start plumbing IndexedDatabaseRequest.
+
+        Code is not testible because it doesn't work (yet).
+
+        * WebCore.gypi:
+        * bindings/v8/DOMObjectsInclude.h:
+        * bindings/v8/V8Index.cpp:
+        * bindings/v8/V8Index.h:
+        * bindings/v8/custom/V8CustomIDBCallback.h: Added.
+        (WebCore::V8CustomIDBCallback::create):
+        (WebCore::V8CustomIDBCallback::~V8CustomIDBCallback):
+        (WebCore::V8CustomIDBCallback::handleEvent):
+        (WebCore::V8CustomIDBCallback::V8CustomIDBCallback):
+        * bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp:
+        (WebCore::V8IndexedDatabaseRequest::openCallback):
+        * storage/IDBDatabaseRequest.h: Added.
+        (WebCore::IDBDatabaseRequest::request):
+        * storage/IDBDatabaseRequest.idl: Added.
+        * storage/IndexedDatabaseRequest.idl:
+
 2010-03-10  Holger Hans Peter Freyther  <zecke at selfish.org>
 
         Reviewed by Simon Hausmann.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 82f85c2..bc3f797 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -214,6 +214,7 @@
             'storage/Database.idl',
             'storage/IDBDatabaseError.idl',
             'storage/IDBDatabaseException.idl',
+            'storage/IDBDatabaseRequest.idl',
             'storage/IDBRequest.idl',
             'storage/IndexedDatabaseRequest.idl',
             'storage/SQLError.idl',
@@ -693,6 +694,7 @@
             'bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp',
             'bindings/v8/custom/V8CSSStyleSheetCustom.cpp',
             'bindings/v8/custom/V8CSSValueCustom.cpp',
+            'bindings/v8/custom/V8CustomCallback.h',
             'bindings/v8/custom/V8CustomEventListener.cpp',
             'bindings/v8/custom/V8CustomEventListener.h',
             'bindings/v8/custom/V8CustomPositionCallback.cpp',
@@ -3242,6 +3244,7 @@
             'storage/DatabaseTrackerClient.h',
             'storage/IDBDatabaseError.h',
             'storage/IDBDatabaseException.h',
+            'storage/IDBDatabaseRequest.h',
             'storage/IDBRequest.cpp',
             'storage/IDBRequest.h',
             'storage/IndexedDatabaseRequest.cpp',
diff --git a/WebCore/bindings/v8/DOMObjectsInclude.h b/WebCore/bindings/v8/DOMObjectsInclude.h
index 7e540e2..cd8443a 100644
--- a/WebCore/bindings/v8/DOMObjectsInclude.h
+++ b/WebCore/bindings/v8/DOMObjectsInclude.h
@@ -201,9 +201,10 @@
 #if ENABLE(INDEXED_DATABASE)
 #include "IDBDatabaseError.h"
 #include "IDBDatabaseException.h"
+#include "IDBDatabaseRequest.h"
 #include "IDBRequest.h"
 #include "IndexedDatabaseRequest.h"
-#endif // DATABASE
+#endif // INDEXED_DATABASE
 
 #if ENABLE(SVG)
 #include "SVGAngle.h"
diff --git a/WebCore/bindings/v8/V8Index.cpp b/WebCore/bindings/v8/V8Index.cpp
index fbaa460..df1f828 100644
--- a/WebCore/bindings/v8/V8Index.cpp
+++ b/WebCore/bindings/v8/V8Index.cpp
@@ -433,6 +433,7 @@
 #if ENABLE(INDEXED_DATABASE)
 #include "V8IDBDatabaseError.h"
 #include "V8IDBDatabaseException.h"
+#include "V8IDBDatabaseRequest.h"
 #include "V8IDBRequest.h"
 #include "V8IndexedDatabaseRequest.h"
 #endif
diff --git a/WebCore/bindings/v8/V8Index.h b/WebCore/bindings/v8/V8Index.h
index 507010e..b177ce0 100644
--- a/WebCore/bindings/v8/V8Index.h
+++ b/WebCore/bindings/v8/V8Index.h
@@ -455,6 +455,7 @@ static const int v8DefaultWrapperInternalFieldCount = 2;
 #define DOM_OBJECT_INDEXED_DATABASE_TYPES(V)                            \
     V(IDBDATABASEERROR, IDBDatabaseError)                               \
     V(IDBDATABASEEXCEPTION, IDBDatabaseException)                       \
+    V(IDBDATABASEREQUEST, IDBDatabaseRequest)                           \
     V(IDBREQUEST, IDBRequest)                                           \
     V(INDEXEDDATABASEREQUEST, IndexedDatabaseRequest)
 #else
diff --git a/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp b/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp
index 0fd182c..7aed941 100644
--- a/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp
@@ -33,7 +33,12 @@
 #if ENABLE(INDEXED_DATABASE)
 #include "V8IndexedDatabaseRequest.h"
 
+#include "IDBDatabaseError.h"
+#include "IDBDatabaseRequest.h"
 #include "V8Binding.h"
+#include "V8CustomIDBCallback.h"
+#include "V8IDBDatabaseError.h"
+#include "V8IDBDatabaseRequest.h"
 #include "V8Proxy.h"
 
 namespace WebCore {
@@ -45,10 +50,32 @@ v8::Handle<v8::Value> V8IndexedDatabaseRequest::openCallback(const v8::Arguments
         return throwError(V8Proxy::TypeError);
     V8Parameter<> name = args[0];
     V8Parameter<> description = args[1];
+
     bool modifyDatabase = true;
-    if (args.Length() > 2)
+    if (args.Length() > 2 && !args[2]->IsUndefined() && !args[2]->IsNull())
         modifyDatabase = args[2]->BooleanValue();
 
+    Frame* frame = V8Proxy::retrieveFrameForCurrentContext();
+
+    RefPtr<V8CustomIDBCallback<IDBDatabaseError> > onerror;
+    if (args.Length() > 3 && !args[3]->IsUndefined() && !args[3]->IsNull()) {
+        if (!args[3]->IsObject())
+            return throwError("onerror callback was not the proper type");
+        if (frame)
+            onerror = V8CustomIDBCallback<IDBDatabaseError>::create(args[3], frame);
+    }
+
+    RefPtr<V8CustomIDBCallback<IDBDatabaseRequest> > onsuccess;
+    if (args.Length() > 4 && !args[4]->IsUndefined() && !args[4]->IsNull()) {
+        if (!args[4]->IsObject())
+            return throwError("onsuccess callback was not the proper type");
+        if (frame)
+            onsuccess = V8CustomIDBCallback<IDBDatabaseRequest>::create(args[4], frame);
+    }
+
+    if (!onerror && !onsuccess)
+        return throwError("Neither the onerror nor the onsuccess callbacks were set.");
+
     ExceptionCode ec = 0;
     imp->open(name, description, modifyDatabase, ec);
     if (ec)
diff --git a/WebCore/storage/IndexedDatabaseRequest.idl b/WebCore/storage/IndexedDatabaseRequest.idl
index b1fc7da..5f3b63e 100644
--- a/WebCore/storage/IndexedDatabaseRequest.idl
+++ b/WebCore/storage/IndexedDatabaseRequest.idl
@@ -31,7 +31,7 @@ module storage {
         Conditional=INDEXED_DATABASE
     ] IndexedDatabaseRequest {
         readonly attribute IDBRequest request;
-        [Custom] void open(in DOMString name, in DOMString description, in optional boolean modifyDatabase)
+        [Custom] void open(in DOMString name, in DOMString description, in optional boolean modifyDatabase, IDBDatabaseErrorCallback onerror, IDBDatabaseRequestCallback onsuccess)
             raises(IDBDatabaseException);
     };
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list