Retrieving Blobs from IndexedDB using cursors fails in WK2 (Sandboxing)
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2016 04:08:48 +0000 (04:08 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2016 04:08:48 +0000 (04:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=158991

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/blob-cursor.html

* platform/network/BlobDataFileReference.cpp:
(WebCore::BlobDataFileReference::startTrackingModifications): Deleted.

Source/WebKit2:

* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles):
(WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles):
* DatabaseProcess/DatabaseProcess.h:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::handleGetResult): Handle creation of sandbox extensions
  for any result that might contain blob values.
(WebKit::WebIDBConnectionToClient::didGetRecord):
(WebKit::WebIDBConnectionToClient::didOpenCursor):
(WebKit::WebIDBConnectionToClient::didIterateCursor):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:

* Shared/Databases/IndexedDB/WebIDBResult.cpp: Added.
(WebKit::WebIDBResult::encode):
(WebKit::WebIDBResult::decode):
* Shared/Databases/IndexedDB/WebIDBResult.h: Added.
(WebKit::WebIDBResult::WebIDBResult):
(WebKit::WebIDBResult::resultData):
(WebKit::WebIDBResult::handles):

* Shared/SandboxExtension.h: Make SandboxExtension handles moveable.

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::preregisterSandboxExtensionsIfNecessary): Register sandbox extensions with the
  Networking process for any result that might contain blob values.
(WebKit::WebIDBConnectionToServer::didGetRecord):
(WebKit::WebIDBConnectionToServer::didOpenCursor):
(WebKit::WebIDBConnectionToServer::didIterateCursor):
(WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): Deleted.
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

LayoutTests:

* storage/indexeddb/modern/blob-cursor-expected.txt: Added.
* storage/indexeddb/modern/blob-cursor.html: Added.
* storage/indexeddb/modern/resources/blob-cursor.js: Added.
* storage/indexeddb/modern/resources/blob-cursor1.html: Added.
* storage/indexeddb/modern/resources/blob-cursor2.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202414 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/blob-cursor-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/blob-cursor.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/blob-cursor.js [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/blob-cursor1.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/blob-cursor2.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/network/BlobDataFileReference.cpp
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
Source/WebKit2/DatabaseProcess/DatabaseProcess.h
Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h
Source/WebKit2/Shared/Databases/IndexedDB/WebIDBResult.cpp [new file with mode: 0644]
Source/WebKit2/Shared/Databases/IndexedDB/WebIDBResult.h [new file with mode: 0644]
Source/WebKit2/Shared/SandboxExtension.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in

index a7f7af1..5a9a464 100644 (file)
@@ -1,3 +1,16 @@
+2016-06-23  Brady Eidson  <beidson@apple.com>
+
+        Retrieving Blobs from IndexedDB using cursors fails in WK2 (Sandboxing)
+        https://bugs.webkit.org/show_bug.cgi?id=158991
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/modern/blob-cursor-expected.txt: Added.
+        * storage/indexeddb/modern/blob-cursor.html: Added.
+        * storage/indexeddb/modern/resources/blob-cursor.js: Added.
+        * storage/indexeddb/modern/resources/blob-cursor1.html: Added.
+        * storage/indexeddb/modern/resources/blob-cursor2.html: Added.
+
 2016-06-23  Joseph Pecoraro  <pecoraro@apple.com> and Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [JSC] Implement isFinite / isNaN in JS and make DFG ToNumber accept non number values
diff --git a/LayoutTests/storage/indexeddb/modern/blob-cursor-expected.txt b/LayoutTests/storage/indexeddb/modern/blob-cursor-expected.txt
new file mode 100644 (file)
index 0000000..5cdda09
--- /dev/null
@@ -0,0 +1,13 @@
+Now let's retrieve the blobs using a cursor.
+Got item from cursor
+Got item from cursor
+Finished cursor
+blobResults.length is 2
+  Result 0 is [object Blob]
+  Result 1 is [object Blob]
+Image 0 loaded successfully
+Image 1 loaded successfully
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/modern/blob-cursor.html b/LayoutTests/storage/indexeddb/modern/blob-cursor.html
new file mode 100644 (file)
index 0000000..2ef2bd0
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<body>
+<script>
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+    testRunner.setCanOpenWindows();
+    window.open("resources/blob-cursor1.html");
+}
+</script>
+<button id="button" onclick='window.open("resources/blob-cursor1.html", "childWindow");'>Click to start test in new window</button>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/modern/resources/blob-cursor.js b/LayoutTests/storage/indexeddb/modern/resources/blob-cursor.js
new file mode 100644 (file)
index 0000000..dc5f16e
--- /dev/null
@@ -0,0 +1,70 @@
+description("This tests that retrieving blobs via cursors works");
+
+indexedDBTest(prepareDatabase);
+
+var testGenerator;
+
+function continueWithEvent(event)
+{
+    testGenerator.next(event);
+}
+
+function asyncContinue()
+{
+    setTimeout("testGenerator.next();", 0);
+}
+
+function idbRequest(request)
+{
+    request.onerror = continueWithEvent;
+    request.onsuccess = continueWithEvent;
+}
+
+var db;
+
+function prepareDatabase(event)
+{
+    debug("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+    debug(event.target.result.name);
+    db = event.target.result;
+    db.createObjectStore("TestObjectStore");
+    event.target.onsuccess = function() {
+        testGenerator = testSteps();
+        testGenerator.next();
+    };
+}
+
+function* testSteps()
+{
+    debug("Let's create an image blob and store it in IndexedDB.");
+
+    var imageURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA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IgAARECACIiBABASIgAARECACIiBABASIgAARECACIiBABASIgAARECACIiBABASIgAARECACAsQFQAQEiIAAERAgAgJEQAQEiIAAEZDPuwAAAP//AwCf+AWUylJrCQAAAABJRU5ErkJggg==";
+
+    const [typePart, partRest] = imageURL.split(',');
+    const contentType = typePart.split(':')[1].split(';')[0];
+    const raw = atob(partRest);
+    const rawLength = raw.length;
+    const uInt8Array = new Uint8Array(rawLength);
+    for (let i = 0; i < rawLength; ++i)
+        uInt8Array[i] = raw.charCodeAt(i);
+
+    blob = new Blob([uInt8Array], { type: contentType });
+
+    var transaction = db.transaction("TestObjectStore", "readwrite");
+    transaction.oncomplete = continueWithEvent;
+    
+    idbRequest(transaction.objectStore("TestObjectStore").add(blob, "foo"));
+    event = yield;
+    debug("Added blob to database once");
+
+    idbRequest(transaction.objectStore("TestObjectStore").add(blob, "bar"));
+    event = yield;
+    debug("Added blob to database twice");
+
+    event = yield;
+    debug("Transaction complete. Now let's navigate the original window to continue the test");
+
+    blob = null;
+
+    window.opener.location.href = "blob-cursor2.html";
+}
\ No newline at end of file
diff --git a/LayoutTests/storage/indexeddb/modern/resources/blob-cursor1.html b/LayoutTests/storage/indexeddb/modern/resources/blob-cursor1.html
new file mode 100644 (file)
index 0000000..ff5d113
--- /dev/null
@@ -0,0 +1,9 @@
+<html>
+<head>
+<script src="../../../../resources/js-test.js"></script>
+<script src="../../resources/shared.js"></script>
+</head>
+<body>
+<script src="blob-cursor.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/modern/resources/blob-cursor2.html b/LayoutTests/storage/indexeddb/modern/resources/blob-cursor2.html
new file mode 100644 (file)
index 0000000..3197cad
--- /dev/null
@@ -0,0 +1,110 @@
+<script src="../../../../resources/js-test.js"></script>
+<script src="../../resources/shared.js"></script>
+<script>
+
+var child;
+
+function waitForChildToBeClosed()
+{
+    if (child && !child.closed) {
+        setTimeout(waitForChildToBeClosed, 0);
+        return;
+    }
+
+    if (window.testRunner) {
+        gc();
+        finishTheTest();
+    } else {
+        debug("The original blob object we created will go away after garbage collection. Since we can't reliably cause synchronous GC in the browser, we'll wait 5 seconds before continuing the test.");
+        setTimeout(finishTheTest, 5000);
+    }
+}
+
+child = window.open("", "childWindow");
+if (child) {
+    child.close();
+    setTimeout(waitForChildToBeClosed, 0);
+}
+
+var testGenerator;
+
+function continueWithEvent(event)
+{
+    testGenerator.next(event);
+}
+
+function asyncContinue()
+{
+    setTimeout("testGenerator.next();", 0);
+}
+
+function idbRequest(request)
+{
+    request.onerror = continueWithEvent;
+    request.onsuccess = continueWithEvent;
+}
+
+var db;
+
+function finishTheTest()
+{
+    request = window.indexedDB.open("blob-cursor1.html");
+    request.onsuccess = function(event) {
+        db = event.target.result;
+        testGenerator = testSteps();
+        testGenerator.next();
+    }
+}
+
+function* testSteps()
+{
+    debug("Now let's retrieve the blobs using a cursor.");
+
+    var blobResults = [];
+    objectStore = db.transaction("TestObjectStore").objectStore("TestObjectStore");
+    objectStore.openCursor().onsuccess = function(event) {
+        let cursor = event.target.result;
+        if (cursor) {
+            debug("Got item from cursor");
+            blobResults.push(cursor.value);
+            cursor.continue();
+        }
+        else {
+            debug("Finished cursor");
+            asyncContinue();
+        }
+    };
+
+    event = yield;
+    debug("blobResults.length is " + blobResults.length);
+    
+    imageForBlob = function(index, blob) {
+        debug("  Result " + index + " is " + blob);
+
+        const url = URL.createObjectURL(blob);
+
+        img = document.createElement("img");
+        img.onload = function(event) {
+            debug("Image " + index + " loaded successfully");
+            URL.revokeObjectURL(url);
+            asyncContinue();
+        }
+        img.onerror = function(event) {
+            debug("Image " + index + " failed to load");
+            URL.revokeObjectURL(url);
+            asyncContinue();
+        }
+        
+        img.src = url;
+        document.body.appendChild(img);        
+    };
+    
+    for (blob in blobResults)
+        imageForBlob(blob, blobResults[blob]);
+    
+    yield;
+    yield;
+    
+    finishJSTest();
+ }
+ </script>
\ No newline at end of file
index aedb838..8d157f3 100644 (file)
@@ -1,3 +1,15 @@
+2016-06-23  Brady Eidson  <beidson@apple.com>
+
+        Retrieving Blobs from IndexedDB using cursors fails in WK2 (Sandboxing)
+        https://bugs.webkit.org/show_bug.cgi?id=158991
+
+        Reviewed by Alex Christensen.
+
+        Test: storage/indexeddb/modern/blob-cursor.html
+
+        * platform/network/BlobDataFileReference.cpp:
+        (WebCore::BlobDataFileReference::startTrackingModifications): Deleted.
+
 2016-06-23  Alex Christensen  <achristensen@webkit.org>
 
         Remove unused didCancelAuthenticationChallenge
index 04e4aa2..1f8ce0b 100644 (file)
@@ -90,8 +90,6 @@ void BlobDataFileReference::startTrackingModifications()
     // also used to pass paths around before registration. Only registered blobs need to pay
     // the cost of tracking file modifications.
 
-    ASSERT(!isValidFileTime(m_expectedModificationTime));
-
 #if ENABLE(FILE_REPLACEMENT)
     m_replacementShouldBeGenerated = File::shouldReplaceFile(m_path);
 #endif
index 23af5e8..4a416eb 100644 (file)
@@ -323,6 +323,7 @@ set(WebKit2_SOURCES
     Shared/Databases/DatabaseProcessCreationParameters.cpp
 
     Shared/Databases/IndexedDB/IDBUtilities.cpp
+    Shared/Databases/IndexedDB/WebIDBResult.cpp
 
     Shared/Plugins/NPIdentifierData.cpp
     Shared/Plugins/NPObjectMessageReceiver.cpp
index 60fa734..4a748e2 100644 (file)
@@ -1,3 +1,46 @@
+2016-06-23  Brady Eidson  <beidson@apple.com>
+
+        Retrieving Blobs from IndexedDB using cursors fails in WK2 (Sandboxing)
+        https://bugs.webkit.org/show_bug.cgi?id=158991
+
+        Reviewed by Alex Christensen.
+
+        * CMakeLists.txt:
+        * WebKit2.xcodeproj/project.pbxproj:
+
+        * DatabaseProcess/DatabaseProcess.cpp:
+        (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles):
+        (WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles):
+        * DatabaseProcess/DatabaseProcess.h:
+        
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
+        (WebKit::WebIDBConnectionToClient::handleGetResult): Handle creation of sandbox extensions
+          for any result that might contain blob values.
+        (WebKit::WebIDBConnectionToClient::didGetRecord):
+        (WebKit::WebIDBConnectionToClient::didOpenCursor):
+        (WebKit::WebIDBConnectionToClient::didIterateCursor):
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
+        
+        * Shared/Databases/IndexedDB/WebIDBResult.cpp: Added.
+        (WebKit::WebIDBResult::encode):
+        (WebKit::WebIDBResult::decode):
+        * Shared/Databases/IndexedDB/WebIDBResult.h: Added.
+        (WebKit::WebIDBResult::WebIDBResult):
+        (WebKit::WebIDBResult::resultData):
+        (WebKit::WebIDBResult::handles):
+        
+        * Shared/SandboxExtension.h: Make SandboxExtension handles moveable.
+                
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
+        (WebKit::preregisterSandboxExtensionsIfNecessary): Register sandbox extensions with the
+          Networking process for any result that might contain blob values.
+        (WebKit::WebIDBConnectionToServer::didGetRecord):
+        (WebKit::WebIDBConnectionToServer::didOpenCursor):
+        (WebKit::WebIDBConnectionToServer::didIterateCursor):
+        (WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): Deleted.
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
+
 2016-06-23  Alex Christensen  <achristensen@webkit.org>
 
         Remove unused didCancelAuthenticationChallenge
index 3ee6247..03d4bc2 100644 (file)
@@ -284,7 +284,7 @@ Vector<RefPtr<WebCore::SecurityOrigin>> DatabaseProcess::indexedDatabaseOrigins(
 
 #endif
 
-void DatabaseProcess::getSandboxExtensionsForBlobFiles(const Vector<String>& filenames, std::function<void (const SandboxExtension::HandleArray&)> completionHandler)
+void DatabaseProcess::getSandboxExtensionsForBlobFiles(const Vector<String>& filenames, std::function<void (SandboxExtension::HandleArray&&)> completionHandler)
 {
     static uint64_t lastRequestID;
 
@@ -293,10 +293,10 @@ void DatabaseProcess::getSandboxExtensionsForBlobFiles(const Vector<String>& fil
     parentProcessConnection()->send(Messages::DatabaseProcessProxy::GetSandboxExtensionsForBlobFiles(requestID, filenames), 0);
 }
 
-void DatabaseProcess::didGetSandboxExtensionsForBlobFiles(uint64_t requestID, const SandboxExtension::HandleArray& handles)
+void DatabaseProcess::didGetSandboxExtensionsForBlobFiles(uint64_t requestID, SandboxExtension::HandleArray&& handles)
 {
     if (auto handler = m_sandboxExtensionForBlobsCompletionHandlers.take(requestID))
-        handler(handles);
+        handler(WTFMove(handles));
 }
 
 #if !PLATFORM(COCOA)
index d03be94..e83bc31 100644 (file)
@@ -76,7 +76,7 @@ public:
     void accessToTemporaryFileComplete(const String& path) final;
 #endif
 
-    void getSandboxExtensionsForBlobFiles(const Vector<String>& filenames, std::function<void (const SandboxExtension::HandleArray&)> completionHandler);
+    void getSandboxExtensionsForBlobFiles(const Vector<String>& filenames, std::function<void (SandboxExtension::HandleArray&&)> completionHandler);
 
 private:
     DatabaseProcess();
@@ -105,7 +105,7 @@ private:
     void deleteWebsiteDataForOrigins(WebCore::SessionID, OptionSet<WebsiteDataType> websiteDataTypes, const Vector<WebCore::SecurityOriginData>& origins, uint64_t callbackID);
     void grantSandboxExtensionsForBlobs(const Vector<String>& paths, const SandboxExtension::HandleArray&);
 
-    void didGetSandboxExtensionsForBlobFiles(uint64_t requestID, const SandboxExtension::HandleArray&);
+    void didGetSandboxExtensionsForBlobFiles(uint64_t requestID, SandboxExtension::HandleArray&&);
 
 #if ENABLE(INDEXED_DATABASE)
     Vector<RefPtr<WebCore::SecurityOrigin>> indexedDatabaseOrigins();
@@ -124,7 +124,7 @@ private:
     RefPtr<WebCore::IDBServer::IDBServer> m_idbServer;
 #endif
     HashMap<String, RefPtr<SandboxExtension>> m_blobTemporaryFileSandboxExtensions;
-    HashMap<uint64_t, std::function<void (const SandboxExtension::HandleArray&)>> m_sandboxExtensionForBlobsCompletionHandlers;
+    HashMap<uint64_t, std::function<void (SandboxExtension::HandleArray&&)>> m_sandboxExtensionForBlobsCompletionHandlers;
 
     Deque<CrossThreadTask> m_databaseTasks;
     Lock m_databaseTaskMutex;
index aa07aaa..e296051 100644 (file)
@@ -32,6 +32,7 @@
 #include "DatabaseProcess.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebIDBConnectionToServerMessages.h"
+#include "WebIDBResult.h"
 #include <WebCore/IDBError.h>
 #include <WebCore/IDBResultData.h>
 #include <WebCore/IDBValue.h>
@@ -125,25 +126,30 @@ void WebIDBConnectionToClient::didPutOrAdd(const WebCore::IDBResultData& resultD
     send(Messages::WebIDBConnectionToServer::DidPutOrAdd(resultData));
 }
 
-void WebIDBConnectionToClient::didGetRecord(const WebCore::IDBResultData& resultData)
+template<class MessageType> void WebIDBConnectionToClient::handleGetResult(const WebCore::IDBResultData& resultData)
 {
     if (resultData.type() == IDBResultType::Error) {
-        send(Messages::WebIDBConnectionToServer::DidGetRecord(resultData));
+        send(MessageType(resultData));
         return;
     }
 
     auto& blobFilePaths = resultData.getResult().value().blobFilePaths();
     if (blobFilePaths.isEmpty()) {
-        send(Messages::WebIDBConnectionToServer::DidGetRecord(resultData));
+        send(MessageType(resultData));
         return;
     }
 
     RefPtr<WebIDBConnectionToClient> protector(this);
-    DatabaseProcess::singleton().getSandboxExtensionsForBlobFiles(blobFilePaths, [protector, this, resultData](const SandboxExtension::HandleArray& handles) {
-        send(Messages::WebIDBConnectionToServer::DidGetRecordWithSandboxExtensions(resultData, handles));
+    DatabaseProcess::singleton().getSandboxExtensionsForBlobFiles(blobFilePaths, [protector, this, resultData](SandboxExtension::HandleArray&& handles) {
+        send(MessageType({ resultData, WTFMove(handles) }));
     });
 }
 
+void WebIDBConnectionToClient::didGetRecord(const WebCore::IDBResultData& resultData)
+{
+    handleGetResult<Messages::WebIDBConnectionToServer::DidGetRecord>(resultData);
+}
+
 void WebIDBConnectionToClient::didGetCount(const WebCore::IDBResultData& resultData)
 {
     send(Messages::WebIDBConnectionToServer::DidGetCount(resultData));
@@ -156,12 +162,12 @@ void WebIDBConnectionToClient::didDeleteRecord(const WebCore::IDBResultData& res
 
 void WebIDBConnectionToClient::didOpenCursor(const WebCore::IDBResultData& resultData)
 {
-    send(Messages::WebIDBConnectionToServer::DidOpenCursor(resultData));
+    handleGetResult<Messages::WebIDBConnectionToServer::DidOpenCursor>(resultData);
 }
 
 void WebIDBConnectionToClient::didIterateCursor(const WebCore::IDBResultData& resultData)
 {
-    send(Messages::WebIDBConnectionToServer::DidIterateCursor(resultData));
+    handleGetResult<Messages::WebIDBConnectionToServer::DidIterateCursor>(resultData);
 }
 
 void WebIDBConnectionToClient::fireVersionChangeEvent(WebCore::IDBServer::UniqueIDBDatabaseConnection& connection, const WebCore::IDBResourceIdentifier& requestIdentifier, uint64_t requestedVersion)
index 9496c7d..8cbe471 100644 (file)
@@ -119,6 +119,8 @@ private:
 
     IPC::Connection* messageSenderConnection() final;
 
+    template<class MessageType> void handleGetResult(const WebCore::IDBResultData&);
+
     Ref<DatabaseToWebProcessConnection> m_connection;
 
     uint64_t m_identifier;
diff --git a/Source/WebKit2/Shared/Databases/IndexedDB/WebIDBResult.cpp b/Source/WebKit2/Shared/Databases/IndexedDB/WebIDBResult.cpp
new file mode 100644 (file)
index 0000000..a32556e
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebIDBResult.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "ArgumentCoders.h"
+
+namespace WebKit {
+
+void WebIDBResult::encode(IPC::ArgumentEncoder& encoder) const
+{
+    m_resultData.encode(encoder);
+    m_handles.encode(encoder);
+}
+
+bool WebIDBResult::decode(IPC::ArgumentDecoder& decoder, WebIDBResult& result)
+{
+    if (!WebCore::IDBResultData::decode(decoder, result.m_resultData))
+        return false;
+
+    if (!SandboxExtension::HandleArray::decode(decoder, result.m_handles))
+        return false;
+
+    return true;
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebKit2/Shared/Databases/IndexedDB/WebIDBResult.h b/Source/WebKit2/Shared/Databases/IndexedDB/WebIDBResult.h
new file mode 100644 (file)
index 0000000..a93db7f
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "SandboxExtension.h"
+#include <WebCore/IDBResultData.h>
+#include <wtf/Noncopyable.h>
+
+namespace WebKit {
+
+class WebIDBResult {
+    WTF_MAKE_NONCOPYABLE(WebIDBResult);
+public:
+    WebIDBResult()
+    {
+    }
+
+    WebIDBResult(const WebCore::IDBResultData& resultData)
+        : m_resultData(resultData)
+    {
+    }
+
+    WebIDBResult(const WebCore::IDBResultData& resultData, SandboxExtension::HandleArray&& handles)
+        : m_resultData(resultData)
+        , m_handles(WTFMove(handles))
+    {
+    }
+
+    const WebCore::IDBResultData& resultData() const { return m_resultData; }
+    const SandboxExtension::HandleArray& handles() const { return m_handles; }
+
+    void encode(IPC::ArgumentEncoder&) const;
+    static bool decode(IPC::ArgumentDecoder&, WebIDBResult&);
+
+private:
+    WebCore::IDBResultData m_resultData;
+    SandboxExtension::HandleArray m_handles;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)
index c6382b4..f9d174e 100644 (file)
@@ -52,9 +52,9 @@ public:
 
     class Handle {
         WTF_MAKE_NONCOPYABLE(Handle);
-    
     public:
         Handle();
+        Handle(Handle&&) = default;
         ~Handle();
 
         void encode(IPC::ArgumentEncoder&) const;
@@ -69,9 +69,9 @@ public:
 
     class HandleArray {
         WTF_MAKE_NONCOPYABLE(HandleArray);
-        
     public:
         HandleArray();
+        HandleArray(HandleArray&&) = default;
         ~HandleArray();
         void allocate(size_t);
         Handle& operator[](size_t i);
index 610e0ff..cb550c8 100644 (file)
                51A555F5128C6C47009ABCEC /* WKContextMenuItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A555F3128C6C47009ABCEC /* WKContextMenuItem.cpp */; };
                51A555F6128C6C47009ABCEC /* WKContextMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A555F4128C6C47009ABCEC /* WKContextMenuItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51A55601128C6D92009ABCEC /* WKContextMenuItemTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A55600128C6D92009ABCEC /* WKContextMenuItemTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               51A587801D1C5081004BA9AF /* WebIDBResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A5877E1D1C4CB9004BA9AF /* WebIDBResult.cpp */; };
                51A728DE1B1BAD3800102EEE /* WKBundleNavigationActionPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A728DC1B1BAD2D00102EEE /* WKBundleNavigationActionPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51A7F2F3125BF820008AEB1D /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A7F2F2125BF820008AEB1D /* Logging.h */; };
                51A7F2F5125BF8D4008AEB1D /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A7F2F4125BF8D4008AEB1D /* Logging.cpp */; };
                51A555F3128C6C47009ABCEC /* WKContextMenuItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKContextMenuItem.cpp; sourceTree = "<group>"; };
                51A555F4128C6C47009ABCEC /* WKContextMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuItem.h; sourceTree = "<group>"; };
                51A55600128C6D92009ABCEC /* WKContextMenuItemTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuItemTypes.h; sourceTree = "<group>"; };
+               51A5877E1D1C4CB9004BA9AF /* WebIDBResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBResult.cpp; sourceTree = "<group>"; };
+               51A5877F1D1C4CB9004BA9AF /* WebIDBResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIDBResult.h; sourceTree = "<group>"; };
                51A60B29180CCD9000F3BF50 /* DatabaseService.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DatabaseService.xcconfig; sourceTree = "<group>"; };
                51A728DC1B1BAD2D00102EEE /* WKBundleNavigationActionPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleNavigationActionPrivate.h; sourceTree = "<group>"; };
                51A7F2F2125BF820008AEB1D /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = "<group>"; };
                        children = (
                                51E351C8180F2CCC00E53BE9 /* IDBUtilities.cpp */,
                                51E351C9180F2CCC00E53BE9 /* IDBUtilities.h */,
+                               51A5877E1D1C4CB9004BA9AF /* WebIDBResult.cpp */,
+                               51A5877F1D1C4CB9004BA9AF /* WebIDBResult.h */,
                        );
                        path = IndexedDB;
                        sourceTree = "<group>";
                                1A043A0A124D11A900FFBFB5 /* WebProcessConnection.cpp in Sources */,
                                1A043F6912514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp in Sources */,
                                BC306825125A6B9400E71278 /* WebProcessCreationParameters.cpp in Sources */,
+                               51A587801D1C5081004BA9AF /* WebIDBResult.cpp in Sources */,
                                1AFA4B8F1A65A9E2006C4AB4 /* WebProcessLifetimeObserver.cpp in Sources */,
                                1AFA4B8B1A65A1D0006C4AB4 /* WebProcessLifetimeTracker.cpp in Sources */,
                                BC3066BE125A442100E71278 /* WebProcessMessageReceiver.cpp in Sources */,
index 8f9dcc5..b29c7c5 100644 (file)
@@ -33,6 +33,7 @@
 #include "NetworkConnectionToWebProcessMessages.h"
 #include "NetworkProcessConnection.h"
 #include "WebIDBConnectionToClientMessages.h"
+#include "WebIDBResult.h"
 #include "WebProcess.h"
 #include "WebToDatabaseProcessConnection.h"
 #include <WebCore/IDBConnectionToServer.h>
@@ -246,20 +247,20 @@ void WebIDBConnectionToServer::didPutOrAdd(const IDBResultData& result)
     m_connectionToServer->didPutOrAdd(result);
 }
 
-void WebIDBConnectionToServer::didGetRecord(const IDBResultData& result)
+static void preregisterSandboxExtensionsIfNecessary(const WebIDBResult& result)
 {
-    m_connectionToServer->didGetRecord(result);
-}
-
-void WebIDBConnectionToServer::didGetRecordWithSandboxExtensions(const WebCore::IDBResultData& result, const SandboxExtension::HandleArray& handles)
-{
-    const auto& filePaths = result.getResult().value().blobFilePaths();
+    const auto& filePaths = result.resultData().getResult().value().blobFilePaths();
 
-    ASSERT(filePaths.size() == handles.size());
+    ASSERT(filePaths.size() == result.handles().size());
 
-    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::PreregisterSandboxExtensionsForOptionallyFileBackedBlob(filePaths, handles), 0);
+    if (!filePaths.isEmpty())
+        WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::PreregisterSandboxExtensionsForOptionallyFileBackedBlob(filePaths, result.handles()), 0);
+}
 
-    m_connectionToServer->didGetRecord(result);
+void WebIDBConnectionToServer::didGetRecord(const WebIDBResult& result)
+{
+    preregisterSandboxExtensionsIfNecessary(result);
+    m_connectionToServer->didGetRecord(result.resultData());
 }
 
 void WebIDBConnectionToServer::didGetCount(const IDBResultData& result)
@@ -272,14 +273,16 @@ void WebIDBConnectionToServer::didDeleteRecord(const IDBResultData& result)
     m_connectionToServer->didDeleteRecord(result);
 }
 
-void WebIDBConnectionToServer::didOpenCursor(const IDBResultData& result)
+void WebIDBConnectionToServer::didOpenCursor(const WebIDBResult& result)
 {
-    m_connectionToServer->didOpenCursor(result);
+    preregisterSandboxExtensionsIfNecessary(result);
+    m_connectionToServer->didOpenCursor(result.resultData());
 }
 
-void WebIDBConnectionToServer::didIterateCursor(const IDBResultData& result)
+void WebIDBConnectionToServer::didIterateCursor(const WebIDBResult& result)
 {
-    m_connectionToServer->didIterateCursor(result);
+    preregisterSandboxExtensionsIfNecessary(result);
+    m_connectionToServer->didIterateCursor(result.resultData());
 }
 
 void WebIDBConnectionToServer::fireVersionChangeEvent(uint64_t uniqueDatabaseConnectionIdentifier, const IDBResourceIdentifier& requestIdentifier, uint64_t requestedVersion)
index 05f396a..29d50a0 100644 (file)
@@ -33,6 +33,8 @@
 
 namespace WebKit {
 
+class WebIDBResult;
+
 class WebIDBConnectionToServer final : public WebCore::IDBClient::IDBConnectionToServerDelegate, public IPC::MessageSender, public RefCounted<WebIDBConnectionToServer> {
 public:
     static Ref<WebIDBConnectionToServer> create();
@@ -83,12 +85,11 @@ public:
     void didCreateIndex(const WebCore::IDBResultData&);
     void didDeleteIndex(const WebCore::IDBResultData&);
     void didPutOrAdd(const WebCore::IDBResultData&);
-    void didGetRecord(const WebCore::IDBResultData&);
-    void didGetRecordWithSandboxExtensions(const WebCore::IDBResultData&, const SandboxExtension::HandleArray&);
+    void didGetRecord(const WebIDBResult&);
     void didGetCount(const WebCore::IDBResultData&);
     void didDeleteRecord(const WebCore::IDBResultData&);
-    void didOpenCursor(const WebCore::IDBResultData&);
-    void didIterateCursor(const WebCore::IDBResultData&);
+    void didOpenCursor(const WebIDBResult&);
+    void didIterateCursor(const WebIDBResult&);
     void fireVersionChangeEvent(uint64_t uniqueDatabaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& requestIdentifier, uint64_t requestedVersion);
     void didStartTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError&);
     void didCloseFromServer(uint64_t databaseConnectionIdentifier, const WebCore::IDBError&);
index 2d5be28..b3d35aa 100644 (file)
@@ -33,12 +33,11 @@ messages -> WebIDBConnectionToServer {
     DidCreateIndex(WebCore::IDBResultData result)
     DidDeleteIndex(WebCore::IDBResultData result)
     DidPutOrAdd(WebCore::IDBResultData result)
-    DidGetRecord(WebCore::IDBResultData result)
-    DidGetRecordWithSandboxExtensions(WebCore::IDBResultData result, WebKit::SandboxExtension::HandleArray extensions)
+    DidGetRecord(WebKit::WebIDBResult result)
     DidGetCount(WebCore::IDBResultData result)
     DidDeleteRecord(WebCore::IDBResultData result)
-    DidOpenCursor(WebCore::IDBResultData result)
-    DidIterateCursor(WebCore::IDBResultData result)
+    DidOpenCursor(WebKit::WebIDBResult result)
+    DidIterateCursor(WebKit::WebIDBResult result)
 
     FireVersionChangeEvent(uint64_t databaseConnectionIdentifier, WebCore::IDBResourceIdentifier requestIdentifier, uint64_t requestedVersion)
     DidStartTransaction(WebCore::IDBResourceIdentifier transactionIdentifier, WebCore::IDBError error)