Title: [202747] trunk
Revision
202747
Author
[email protected]
Date
2016-07-01 12:10:35 -0700 (Fri, 01 Jul 2016)

Log Message

Blob content type not preserved when retrieving blobs from IndexedDB.
<rdar://problem/27057357> and https://bugs.webkit.org/show_bug.cgi?id=159360

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/blob-svg-image.html

* fileapi/Blob.cpp:
(WebCore::Blob::Blob):

* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::postToMainThread):
(WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): Pass along the content type
  to the blob registry so that if the file-backed blob takes over, it has the content type.
(WebCore::threadableQueue): Deleted.
* fileapi/ThreadableBlobRegistry.h:

* platform/network/BlobRegistry.h:

* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
* platform/network/BlobRegistryImpl.h:

Source/WebKit2:

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:

* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
* WebProcess/FileAPI/BlobRegistryProxy.h:

LayoutTests:

* storage/indexeddb/modern/blob-svg-image-expected.txt: Added.
* storage/indexeddb/modern/blob-svg-image.html: Added.
* storage/indexeddb/modern/resources/blob-svg-image.js: Added.
* storage/indexeddb/modern/resources/blob-svg-image1.html: Added.
* storage/indexeddb/modern/resources/blob-svg-image2.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (202746 => 202747)


--- trunk/LayoutTests/ChangeLog	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/LayoutTests/ChangeLog	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,3 +1,16 @@
+2016-07-01  Brady Eidson  <[email protected]>
+
+        Blob content type not preserved when retrieving blobs from IndexedDB.
+        <rdar://problem/27057357> and https://bugs.webkit.org/show_bug.cgi?id=159360
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/modern/blob-svg-image-expected.txt: Added.
+        * storage/indexeddb/modern/blob-svg-image.html: Added.
+        * storage/indexeddb/modern/resources/blob-svg-image.js: Added.
+        * storage/indexeddb/modern/resources/blob-svg-image1.html: Added.
+        * storage/indexeddb/modern/resources/blob-svg-image2.html: Added.
+
 2016-07-01  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Cleanup inspector/console/console-message.html

Added: trunk/LayoutTests/storage/indexeddb/modern/blob-svg-image-expected.txt (0 => 202747)


--- trunk/LayoutTests/storage/indexeddb/modern/blob-svg-image-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/blob-svg-image-expected.txt	2016-07-01 19:10:35 UTC (rev 202747)
@@ -0,0 +1,7 @@
+Now let's retrieve the svg image blob.
+  Result is [object Blob]
+Image loaded successfully
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/storage/indexeddb/modern/blob-svg-image.html (0 => 202747)


--- trunk/LayoutTests/storage/indexeddb/modern/blob-svg-image.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/blob-svg-image.html	2016-07-01 19:10:35 UTC (rev 202747)
@@ -0,0 +1,13 @@
+<html>
+<body>
+<script>
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+    testRunner.setCanOpenWindows();
+    window.open("resources/blob-svg-image1.html");
+}
+</script>
+<button id="button" _onclick_='window.open("resources/blob-svg-image1.html", "childWindow");'>Click to start test in new window</button>
+</body>
+</html>

Added: trunk/LayoutTests/storage/indexeddb/modern/resources/blob-svg-image.js (0 => 202747)


--- trunk/LayoutTests/storage/indexeddb/modern/resources/blob-svg-image.js	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/resources/blob-svg-image.js	2016-07-01 19:10:35 UTC (rev 202747)
@@ -0,0 +1,57 @@
+description("This tests that retrieving blobs from IDB successfully registers their content type");
+
+indexedDBTest(prepareDatabase);
+
+var testGenerator;
+var svgData = ["<svg xmlns='http://www.w3.org/2000/svg'><circle r='200' cx='200' cy='200' stroke='red' stroke-width='1' fill='yellow' /></svg>"];
+
+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 svg blob and store it in IndexedDB.");
+
+    blob = new Blob(svgData, { type: "image/svg+xml" });
+
+    var transaction = db.transaction("TestObjectStore", "readwrite");
+    transaction._oncomplete_ = continueWithEvent;
+    
+    idbRequest(transaction.objectStore("TestObjectStore").add(blob, "foo"));
+    event = yield;
+    debug("Added blob to database");
+
+    event = yield;
+    debug("Transaction complete. Now let's navigate the original window to continue the test");
+
+    blob = null;
+
+    window.opener.location.href = ""
+}
\ No newline at end of file

Added: trunk/LayoutTests/storage/indexeddb/modern/resources/blob-svg-image1.html (0 => 202747)


--- trunk/LayoutTests/storage/indexeddb/modern/resources/blob-svg-image1.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/resources/blob-svg-image1.html	2016-07-01 19:10:35 UTC (rev 202747)
@@ -0,0 +1,9 @@
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/storage/indexeddb/modern/resources/blob-svg-image2.html (0 => 202747)


--- trunk/LayoutTests/storage/indexeddb/modern/resources/blob-svg-image2.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/resources/blob-svg-image2.html	2016-07-01 19:10:35 UTC (rev 202747)
@@ -0,0 +1,92 @@
+<script src=""
+<script src=""
+<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-svg-image1.html");
+    request._onsuccess_ = function(event) {
+        db = event.target.result;
+        testGenerator = testSteps();
+        testGenerator.next();
+    }
+}
+
+function* testSteps()
+{
+    debug("Now let's retrieve the svg image blob.");
+
+    objectStore = db.transaction("TestObjectStore").objectStore("TestObjectStore");
+    idbRequest(objectStore.get("foo"));
+    event = yield;
+    
+    var blob = event.target.result;
+
+    debug("  Result is " + blob);
+
+    const url = ""
+
+    img = document.createElement("img");
+    img._onload_ = function(event) {
+        debug("Image loaded successfully");
+        URL.revokeObjectURL(url);
+        asyncContinue();
+    }
+    img._onerror_ = function(event) {
+        debug("Image failed to load");
+        URL.revokeObjectURL(url);
+        asyncContinue();
+    }
+    
+    img.src = ""
+    document.body.appendChild(img);        
+
+    yield;
+    
+    finishJSTest();
+ }
+ </script>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (202746 => 202747)


--- trunk/Source/WebCore/ChangeLog	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebCore/ChangeLog	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,3 +1,29 @@
+2016-07-01  Brady Eidson  <[email protected]>
+
+        Blob content type not preserved when retrieving blobs from IndexedDB.
+        <rdar://problem/27057357> and https://bugs.webkit.org/show_bug.cgi?id=159360
+
+        Reviewed by Alex Christensen.
+
+        Test: storage/indexeddb/modern/blob-svg-image.html
+
+        * fileapi/Blob.cpp:
+        (WebCore::Blob::Blob):
+
+        * fileapi/ThreadableBlobRegistry.cpp:
+        (WebCore::postToMainThread):
+        (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): Pass along the content type
+          to the blob registry so that if the file-backed blob takes over, it has the content type.
+        (WebCore::threadableQueue): Deleted.
+        * fileapi/ThreadableBlobRegistry.h:
+
+        * platform/network/BlobRegistry.h:
+
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::BlobRegistryImpl::registerBlobURL):
+        (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
+        * platform/network/BlobRegistryImpl.h:
+
 2016-07-01  Youenn Fablet  <[email protected]>
 
         Make ResourceLoaderOptions derive from FetchOptions

Modified: trunk/Source/WebCore/fileapi/Blob.cpp (202746 => 202747)


--- trunk/Source/WebCore/fileapi/Blob.cpp	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebCore/fileapi/Blob.cpp	2016-07-01 19:10:35 UTC (rev 202747)
@@ -103,7 +103,7 @@
     if (fileBackedPath.isEmpty())
         ThreadableBlobRegistry::registerBlobURL(nullptr, m_internalURL, srcURL);
     else
-        ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked(m_internalURL, srcURL, fileBackedPath);
+        ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked(m_internalURL, srcURL, fileBackedPath, m_type);
 }
 
 Blob::Blob(const URL& srcURL, long long start, long long end, const String& type)

Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp (202746 => 202747)


--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014, 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
@@ -64,7 +65,7 @@
     return *map;
 }
 
-static CrossThreadQueue<CrossThreadTask>& threadableQueue()
+static void postToMainThread(CrossThreadTask&& task)
 {
     static std::once_flag onceFlag;
     static CrossThreadQueue<CrossThreadTask>* queue;
@@ -72,7 +73,13 @@
         queue = new CrossThreadQueue<CrossThreadTask>;
     });
 
-    return *queue;
+    queue->append(WTFMove(task));
+
+    callOnMainThread([] {
+        auto task = queue->tryGetMessage();
+        ASSERT(task);
+        task->performTask();
+    });
 }
 
 void ThreadableBlobRegistry::registerFileBlobURL(const URL& url, const String& path, const String& contentType)
@@ -114,19 +121,12 @@
     }
 }
 
-void ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, const String& fileBackedPath)
+void ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
 {
     if (isMainThread())
-        blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, BlobDataFileReference::create(fileBackedPath));
-    else {
-        threadableQueue().append(createCrossThreadTask(ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked, url, srcURL, fileBackedPath));
-
-        callOnMainThread([] {
-            auto task = threadableQueue().tryGetMessage();
-            ASSERT(task);
-            task->performTask();
-        });
-    }
+        blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, BlobDataFileReference::create(fileBackedPath), contentType);
+    else
+        postToMainThread(createCrossThreadTask(ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked, url, srcURL, fileBackedPath, contentType));
 }
 
 void ThreadableBlobRegistry::registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end)

Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h (202746 => 202747)


--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014, 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
@@ -28,8 +29,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef ThreadableBlobRegistry_h
-#define ThreadableBlobRegistry_h
+#pragma once
 
 #include <wtf/Forward.h>
 #include <wtf/Vector.h>
@@ -45,7 +45,7 @@
     static void registerFileBlobURL(const URL&, const String& path, const String& contentType);
     static void registerBlobURL(const URL&, Vector<BlobPart> blobParts, const String& contentType);
     static void registerBlobURL(SecurityOrigin*, const URL&, const URL& srcURL);
-    static void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath);
+    static void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
     static void registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end);
     static void unregisterBlobURL(const URL&);
 
@@ -57,5 +57,3 @@
 };
 
 } // namespace WebCore
-
-#endif // ThreadableBlobRegistry_h

Modified: trunk/Source/WebCore/platform/network/BlobRegistry.h (202746 => 202747)


--- trunk/Source/WebCore/platform/network/BlobRegistry.h	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.h	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014, 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
@@ -58,7 +59,7 @@
     virtual void registerBlobURL(const URL&, const URL& srcURL) = 0;
 
     // Registers a new blob URL referring to the blob data identified by the specified srcURL or, if none found, referring to the file found at the given path.
-    virtual void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&) = 0;
+    virtual void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) = 0;
 
     // Negative start and end values select from the end.
     virtual void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) = 0;

Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (202746 => 202747)


--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp	2016-07-01 19:10:35 UTC (rev 202747)
@@ -156,10 +156,10 @@
 
 void BlobRegistryImpl::registerBlobURL(const URL& url, const URL& srcURL)
 {
-    registerBlobURLOptionallyFileBacked(url, srcURL, nullptr);
+    registerBlobURLOptionallyFileBacked(url, srcURL, nullptr, { });
 }
 
-void BlobRegistryImpl::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& file)
+void BlobRegistryImpl::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& file, const String& contentType)
 {
     ASSERT(isMainThread());
     registerBlobResourceHandleConstructor();
@@ -173,7 +173,7 @@
     if (!file || file->path().isEmpty())
         return;
 
-    auto backingFile = BlobData::create({ });
+    auto backingFile = BlobData::create(contentType);
     backingFile->appendFile(file.releaseNonNull());
 
     m_blobs.set(url.string(), WTFMove(backingFile));

Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.h (202746 => 202747)


--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.h	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.h	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014, 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
@@ -60,7 +61,7 @@
     void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& contentType) override;
     void registerBlobURL(const URL&, Vector<BlobPart>, const String& contentType) override;
     void registerBlobURL(const URL&, const URL& srcURL) override;
-    void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&) override;
+    void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) override;
     void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) override;
     void unregisterBlobURL(const URL&) override;
     bool isBlobRegistryImpl() const override { return true; }

Modified: trunk/Source/WebKit2/ChangeLog (202746 => 202747)


--- trunk/Source/WebKit2/ChangeLog	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebKit2/ChangeLog	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,3 +1,23 @@
+2016-07-01  Brady Eidson  <[email protected]>
+
+        Blob content type not preserved when retrieving blobs from IndexedDB.
+        <rdar://problem/27057357> and https://bugs.webkit.org/show_bug.cgi?id=159360
+
+        Reviewed by Alex Christensen.
+
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
+        (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+
+        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+        (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
+        * WebProcess/FileAPI/BlobRegistryProxy.h:
+
 2016-07-01  Dan Bernstein  <[email protected]>
 
         [Cocoa] Get rid of WK_NULLABLE_SPECIFIER now that all supported compilers understand _Nullable

Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp (202746 => 202747)


--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-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
@@ -84,12 +84,12 @@
     mapIterator->value.add(url);
 }
 
-void NetworkBlobRegistry::registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess* connection, const URL& url, const URL& srcURL, const String& fileBackedPath)
+void NetworkBlobRegistry::registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess* connection, const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
 {
     auto fileReference = connection->getBlobDataFileReferenceForPath(fileBackedPath);
     ASSERT(fileReference);
 
-    blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(fileReference));
+    blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(fileReference), contentType);
 
     ASSERT(!m_blobsForConnection.get(connection).contains(url));
     BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection);

Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h (202746 => 202747)


--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-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
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef NetworkBlobRegistry_h
-#define NetworkBlobRegistry_h
+#pragma once
 
 #include <WebCore/URLHash.h>
 #include <wtf/Function.h>
@@ -50,7 +49,7 @@
     void registerFileBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const String& path, RefPtr<SandboxExtension>&&, const String& contentType);
     void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType);
     void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL);
-    void registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, const String& fileBackedPath);
+    void registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, const String& fileBackedPath, const String& contentType);
     void registerBlobURLForSlice(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end);
     void unregisterBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&);
     uint64_t blobSize(NetworkConnectionToWebProcess*, const WebCore::URL&);
@@ -68,5 +67,3 @@
 };
 
 }
-
-#endif // NetworkBlobRegistry_h

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (202746 => 202747)


--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp	2016-07-01 19:10:35 UTC (rev 202747)
@@ -286,9 +286,9 @@
     return m_blobDataFileReferences.get(path);
 }
 
-void NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, const String& fileBackedPath)
+void NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
 {
-    NetworkBlobRegistry::singleton().registerBlobURLOptionallyFileBacked(this, url, srcURL, fileBackedPath);
+    NetworkBlobRegistry::singleton().registerBlobURLOptionallyFileBacked(this, url, srcURL, fileBackedPath, contentType);
 }
 
 void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end)

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h (202746 => 202747)


--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h	2016-07-01 19:10:35 UTC (rev 202747)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef NetworkConnectionToWebProcess_h
-#define NetworkConnectionToWebProcess_h
+#pragma once
 
 #include "BlockingResponseMap.h"
 #include "Connection.h"
@@ -95,7 +94,7 @@
     void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType);
     void registerBlobURLFromURL(const WebCore::URL&, const WebCore::URL& srcURL);
     void preregisterSandboxExtensionsForOptionallyFileBackedBlob(const Vector<String>& fileBackedPath, const SandboxExtension::HandleArray&);
-    void registerBlobURLOptionallyFileBacked(const WebCore::URL&, const WebCore::URL& srcURL, const String& fileBackedPath);
+    void registerBlobURLOptionallyFileBacked(const WebCore::URL&, const WebCore::URL& srcURL, const String& fileBackedPath, const String& contentType);
     void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end);
     void blobSize(const WebCore::URL&, uint64_t& resultSize);
     void unregisterBlobURL(const WebCore::URL&);
@@ -110,5 +109,3 @@
 };
 
 } // namespace WebKit
-
-#endif // NetworkConnectionToWebProcess_h

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in (202746 => 202747)


--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in	2016-07-01 19:10:35 UTC (rev 202747)
@@ -44,7 +44,7 @@
     RegisterBlobURL(WebCore::URL url, Vector<WebCore::BlobPart> blobParts, String contentType)
     RegisterBlobURLFromURL(WebCore::URL url, WebCore::URL srcURL)
     PreregisterSandboxExtensionsForOptionallyFileBackedBlob(Vector<String> filePaths, WebKit::SandboxExtension::HandleArray extensionHandles)
-    RegisterBlobURLOptionallyFileBacked(WebCore::URL url, WebCore::URL srcURL, String fileBackedPath)
+    RegisterBlobURLOptionallyFileBacked(WebCore::URL url, WebCore::URL srcURL, String fileBackedPath, String contentType)
     RegisterBlobURLForSlice(WebCore::URL url, WebCore::URL srcURL, int64_t start, int64_t end)
     UnregisterBlobURL(WebCore::URL url)
     BlobSize(WebCore::URL url) -> (uint64_t resultSize)

Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp (202746 => 202747)


--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-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
@@ -57,10 +57,10 @@
     WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL(url, srcURL), 0);
 }
 
-void BlobRegistryProxy::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&& file)
+void BlobRegistryProxy::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&& file, const String& contentType)
 {
     ASSERT(file);
-    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLOptionallyFileBacked(url, srcURL, file->path()), 0);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLOptionallyFileBacked(url, srcURL, file->path(), contentType), 0);
 }
 
 void BlobRegistryProxy::unregisterBlobURL(const URL& url)

Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h (202746 => 202747)


--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h	2016-07-01 19:07:20 UTC (rev 202746)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h	2016-07-01 19:10:35 UTC (rev 202747)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-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
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef BlobRegistryProxy_h
-#define BlobRegistryProxy_h
+#pragma once
 
 #include <WebCore/BlobRegistry.h>
 
@@ -35,7 +34,7 @@
     void registerFileBlobURL(const WebCore::URL&, Ref<WebCore::BlobDataFileReference>&&, const String& contentType) override;
     void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType) override;
     void registerBlobURL(const WebCore::URL&, const WebCore::URL& srcURL) override;
-    void registerBlobURLOptionallyFileBacked(const WebCore::URL&, const WebCore::URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&) override;
+    void registerBlobURLOptionallyFileBacked(const WebCore::URL&, const WebCore::URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) override;
     void unregisterBlobURL(const WebCore::URL&) override;
     void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, long long start, long long end) override;
     unsigned long long blobSize(const WebCore::URL&) override;
@@ -43,5 +42,3 @@
 };
 
 }
-
-#endif // BlobRegistryProxy_h
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to