Title: [168554] trunk
Revision
168554
Author
a...@apple.com
Date
2014-05-09 14:24:01 -0700 (Fri, 09 May 2014)

Log Message

REGRESSION (r168518): Multiple tests for workers in blobs assert
https://bugs.webkit.org/show_bug.cgi?id=132728

Reviewed by Geoffrey Garen.

Source/WebCore:
Change File serialization to include name, so that we don't have to regenerate anything
on a secondary thread after deserialization.

Files and Blobs can't be stored persistently, because URLs are transient (IndexedDB
has an explicit check, and fails if there were any blob URLs). API doesn't have the
check, but given that anyone who tried to use these to serialize a File would fail,
it seems OK to change the format.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::write):
(WebCore::CloneDeserializer::readFile):
* fileapi/File.cpp:
(WebCore::File::File):
* fileapi/File.h:

LayoutTests:
* platform/mac/TestExpectations: Unskip the tests.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (168553 => 168554)


--- trunk/LayoutTests/ChangeLog	2014-05-09 21:20:08 UTC (rev 168553)
+++ trunk/LayoutTests/ChangeLog	2014-05-09 21:24:01 UTC (rev 168554)
@@ -1,3 +1,12 @@
+2014-05-09  Alexey Proskuryakov  <a...@apple.com>
+
+        REGRESSION (r168518): Multiple tests for workers in blobs assert
+        https://bugs.webkit.org/show_bug.cgi?id=132728
+
+        Reviewed by Geoffrey Garen.
+
+        * platform/mac/TestExpectations: Unskip the tests.
+
 2014-05-09  Zsolt Borbely  <zsborbely.u-sze...@partner.samsung.com>
 
         ASSERTION FAILED: object->style()->overflowX() == object->style()->overflowY()

Modified: trunk/LayoutTests/platform/mac/TestExpectations (168553 => 168554)


--- trunk/LayoutTests/platform/mac/TestExpectations	2014-05-09 21:20:08 UTC (rev 168553)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2014-05-09 21:24:01 UTC (rev 168554)
@@ -1370,10 +1370,3 @@
 webkit.org/b/132385 compositing/repaint/repaint-on-layer-grouping-change.html [ Pass Failure ]
 
 webkit.org/b/132491 [ MountainLion ] http/tests/media/hls/video-controls-live-stream.html [ WontFix ]
-
-webkit.org/b/132728 [ Debug ] fast/files/workers/worker-apply-blob-url-to-xhr.html [ Skip ]
-webkit.org/b/132728 [ Debug ] fast/files/workers/worker-read-blob-async.html [ Skip ]
-webkit.org/b/132728 [ Debug ] fast/files/workers/worker-read-blob-sync.html [ Skip ]
-webkit.org/b/132728 [ Debug ] fast/files/workers/worker-read-file-async.html [ Skip ]
-webkit.org/b/132728 [ Debug ] fast/files/workers/worker-read-file-sync.html [ Skip ]
-webkit.org/b/132728 [ Debug ] fast/workers/worker-copy-shared-blob-url.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (168553 => 168554)


--- trunk/Source/WebCore/ChangeLog	2014-05-09 21:20:08 UTC (rev 168553)
+++ trunk/Source/WebCore/ChangeLog	2014-05-09 21:24:01 UTC (rev 168554)
@@ -1,3 +1,25 @@
+2014-05-09  Alexey Proskuryakov  <a...@apple.com>
+
+        REGRESSION (r168518): Multiple tests for workers in blobs assert
+        https://bugs.webkit.org/show_bug.cgi?id=132728
+
+        Reviewed by Geoffrey Garen.
+
+        Change File serialization to include name, so that we don't have to regenerate anything
+        on a secondary thread after deserialization.
+
+        Files and Blobs can't be stored persistently, because URLs are transient (IndexedDB
+        has an explicit check, and fails if there were any blob URLs). API doesn't have the
+        check, but given that anyone who tried to use these to serialize a File would fail,
+        it seems OK to change the format.
+
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneSerializer::write):
+        (WebCore::CloneDeserializer::readFile):
+        * fileapi/File.cpp:
+        (WebCore::File::File):
+        * fileapi/File.h:
+
 2014-05-08  Mark Hahnenberg  <mhahnenb...@apple.com>
 
         JSDOMWindow should have a WatchpointSet to fire on window close

Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (168553 => 168554)


--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp	2014-05-09 21:20:08 UTC (rev 168553)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp	2014-05-09 21:24:01 UTC (rev 168554)
@@ -316,7 +316,7 @@
  *    FileTag FileData
  *
  * FileData :-
- *    <path:StringData> <url:StringData> <type:StringData>
+ *    <path:StringData> <url:StringData> <type:StringData> <name:StringData>
  *
  * FileList :-
  *    FileListTag <length:uint32_t>(<file:FileData>){length}
@@ -1029,6 +1029,7 @@
         write(file->path());
         write(file->url());
         write(file->type());
+        write(file->name());
     }
 
 #if ENABLE(SUBTLE_CRYPTO)
@@ -1730,8 +1731,11 @@
         CachedStringRef type;
         if (!readStringData(type))
             return 0;
+        CachedStringRef name;
+        if (!readStringData(name))
+            return 0;
         if (m_isDOMGlobalObject)
-            file = File::deserialize(path->string(), URL(URL(), url->string()), type->string());
+            file = File::deserialize(path->string(), URL(URL(), url->string()), type->string(), name->string());
         return true;
     }
 

Modified: trunk/Source/WebCore/fileapi/File.cpp (168553 => 168554)


--- trunk/Source/WebCore/fileapi/File.cpp	2014-05-09 21:20:08 UTC (rev 168553)
+++ trunk/Source/WebCore/fileapi/File.cpp	2014-05-09 21:24:01 UTC (rev 168554)
@@ -57,13 +57,11 @@
     ThreadableBlobRegistry::registerFileBlobURL(m_internalURL, path, m_type);
 }
 
-File::File(DeserializationContructor, const String& path, const URL& url, const String& type)
+File::File(DeserializationContructor, const String& path, const URL& url, const String& type, const String& name)
     : Blob(deserializationContructor, url, type, -1)
     , m_path(path)
+    , m_name(name)
 {
-    // FIXME: File object serialization/deserialization does not include m_name, see SerializedScriptValue.cpp.
-    // Once it does, we should take deserialized name verbatim, not compute it again.
-    computeNameAndContentType(m_path, String(), m_name, m_type);
 }
 
 double File::lastModifiedDate() const

Modified: trunk/Source/WebCore/fileapi/File.h (168553 => 168554)


--- trunk/Source/WebCore/fileapi/File.h	2014-05-09 21:20:08 UTC (rev 168553)
+++ trunk/Source/WebCore/fileapi/File.h	2014-05-09 21:24:01 UTC (rev 168554)
@@ -41,9 +41,9 @@
         return adoptRef(new File(path));
     }
 
-    static PassRefPtr<File> deserialize(const String& path, const URL& srcURL, const String& type)
+    static PassRefPtr<File> deserialize(const String& path, const URL& srcURL, const String& type, const String& name)
     {
-        return adoptRef(new File(deserializationContructor, path, srcURL, type));
+        return adoptRef(new File(deserializationContructor, path, srcURL, type, name));
     }
 
     // Create a file with a name exposed to the author (via File.name and associated DOM properties) that differs from the one provided in the path.
@@ -72,7 +72,7 @@
     explicit File(const String& path);
     File(const String& path, const String& nameOverride);
 
-    File(DeserializationContructor, const String& path, const URL& srcURL, const String& type);
+    File(DeserializationContructor, const String& path, const URL& srcURL, const String& type, const String& name);
 
     static void computeNameAndContentType(const String& path, const String& nameOverride, String& effectiveName, String& effectiveContentType);
 #if ENABLE(FILE_REPLACEMENT)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to