Title: [122999] trunk/Source/WebKit/chromium
Revision
122999
Author
[email protected]
Date
2012-07-18 12:26:56 -0700 (Wed, 18 Jul 2012)

Log Message

Implement putIndexKeys in WebIDBObjectStoreImpl
https://bugs.webkit.org/show_bug.cgi?id=91546

Patch by Alec Flett <[email protected]> on 2012-07-18
Reviewed by Darin Fisher.

Implement putIndexKeys in the chromium API, so it is callable
from chromium.

* src/WebIDBObjectStoreImpl.cpp:
(WebKit::WebIDBObjectStoreImpl::putWithIndexKeys):
(WebKit):
* src/WebIDBObjectStoreImpl.h:
(WebIDBObjectStoreImpl):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (122998 => 122999)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-07-18 19:23:19 UTC (rev 122998)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-07-18 19:26:56 UTC (rev 122999)
@@ -1,3 +1,19 @@
+2012-07-18  Alec Flett  <[email protected]>
+
+        Implement putIndexKeys in WebIDBObjectStoreImpl
+        https://bugs.webkit.org/show_bug.cgi?id=91546
+
+        Reviewed by Darin Fisher.
+
+        Implement putIndexKeys in the chromium API, so it is callable
+        from chromium.
+
+        * src/WebIDBObjectStoreImpl.cpp:
+        (WebKit::WebIDBObjectStoreImpl::putWithIndexKeys):
+        (WebKit):
+        * src/WebIDBObjectStoreImpl.h:
+        (WebIDBObjectStoreImpl):
+
 2012-07-18  Tony Chang  <[email protected]>
 
         [chromium] Unreviewed compile fix for Android.

Modified: trunk/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp (122998 => 122999)


--- trunk/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp	2012-07-18 19:23:19 UTC (rev 122998)
+++ trunk/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp	2012-07-18 19:26:56 UTC (rev 122999)
@@ -63,6 +63,23 @@
     m_objectStore->put(value, key, static_cast<IDBObjectStoreBackendInterface::PutMode>(putMode), IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
 }
 
+void WebIDBObjectStoreImpl::putWithIndexKeys(const WebSerializedScriptValue& value, const WebIDBKey& key, PutMode putMode, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, const WebVector<WebString>& webIndexNames, const WebVector<WebIndexKeys>& webIndexKeys, WebExceptionCode& ec)
+{
+    ASSERT(webIndexNames.size() == webIndexKeys.size());
+    Vector<String> indexNames(webIndexNames.size());
+    Vector<IDBObjectStoreBackendInterface::IndexKeys> indexKeys(webIndexKeys.size());
+
+    for (size_t i = 0; i < webIndexNames.size(); ++i) {
+        indexNames[i] = webIndexNames[i];
+        Vector<RefPtr<IDBKey> > indexKeyList(webIndexKeys[i].size());
+        for (size_t j = 0; j < webIndexKeys[i].size(); ++j)
+            indexKeyList[j] = webIndexKeys[i][j];
+        indexKeys[i] = indexKeyList;
+    }
+
+    m_objectStore->putWithIndexKeys(value, key, static_cast<IDBObjectStoreBackendInterface::PutMode>(putMode), IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), indexNames, indexKeys, ec);
+}
+
 void WebIDBObjectStoreImpl::deleteFunction(const WebIDBKeyRange& keyRange, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
 {
     m_objectStore->deleteFunction(keyRange, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);

Modified: trunk/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h (122998 => 122999)


--- trunk/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h	2012-07-18 19:23:19 UTC (rev 122998)
+++ trunk/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h	2012-07-18 19:26:56 UTC (rev 122999)
@@ -47,6 +47,7 @@
 
     void get(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
     void put(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
+    void putWithIndexKeys(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, const WebVector<WebString>& indexNames, const WebVector<WebIndexKeys>&, WebExceptionCode&);
     void deleteFunction(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
     void clear(WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to