Bug 165218

Summary: [WebIDL] Remove custom bindings for File and Blob constructors
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, rniwa
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from ews123 for ios-simulator-wk2
none
Archive of layout-test-results from ews107 for mac-yosemite-wk2
none
Archive of layout-test-results from ews115 for mac-yosemite
none
Patch darin: review+

Description Sam Weinig 2016-11-30 13:53:37 PST
[WebIDL] Remove custom bindings for File and Blob constructors
Comment 1 Sam Weinig 2016-11-30 13:59:17 PST
Created attachment 295763 [details]
Patch
Comment 2 WebKit Commit Bot 2016-11-30 14:01:01 PST
Attachment 295763 [details] did not pass style-queue:


ERROR: Source/WebCore/fileapi/Blob.h:103:  The parameter name "propertyBag" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 28 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Sam Weinig 2016-11-30 14:17:47 PST
Created attachment 295768 [details]
Patch
Comment 4 WebKit Commit Bot 2016-11-30 14:20:21 PST
Attachment 295768 [details] did not pass style-queue:


ERROR: Source/WebCore/fileapi/Blob.h:103:  The parameter name "propertyBag" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 31 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Sam Weinig 2016-11-30 14:21:48 PST
Created attachment 295769 [details]
Patch
Comment 6 Sam Weinig 2016-11-30 15:19:41 PST
Created attachment 295778 [details]
Patch
Comment 7 Build Bot 2016-11-30 16:27:23 PST
Comment on attachment 295778 [details]
Patch

Attachment 295778 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/2597808

New failing tests:
imported/w3c/web-platform-tests/fetch/api/basic/request-headers.html
fast/files/blob-constructor.html
fast/files/file-constructor.html
imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker.html
http/tests/fetch/fetch-as-blob-worker.html
http/tests/fetch/fetch-as-blob.html
Comment 8 Build Bot 2016-11-30 16:27:26 PST
Created attachment 295785 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 9 Build Bot 2016-11-30 16:29:01 PST
Comment on attachment 295778 [details]
Patch

Attachment 295778 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/2597839

New failing tests:
imported/w3c/web-platform-tests/fetch/api/basic/request-headers.html
fast/files/blob-constructor.html
fast/files/file-constructor.html
imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker.html
http/tests/fetch/fetch-as-blob-worker.html
http/tests/fetch/fetch-as-blob.html
Comment 10 Build Bot 2016-11-30 16:29:03 PST
Created attachment 295786 [details]
Archive of layout-test-results from ews107 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 11 Build Bot 2016-11-30 16:54:44 PST
Comment on attachment 295778 [details]
Patch

Attachment 295778 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2597926

New failing tests:
imported/w3c/web-platform-tests/fetch/api/basic/request-headers.html
fast/files/blob-constructor.html
fast/files/file-constructor.html
imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker.html
http/tests/fetch/fetch-as-blob-worker.html
http/tests/fetch/fetch-as-blob.html
Comment 12 Build Bot 2016-11-30 16:54:47 PST
Created attachment 295791 [details]
Archive of layout-test-results from ews115 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 13 Sam Weinig 2016-11-30 17:37:22 PST
Created attachment 295797 [details]
Patch
Comment 14 Darin Adler 2016-11-30 20:30:56 PST
Comment on attachment 295797 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=295797&action=review

> Source/WebCore/fileapi/Blob.h:37
>  #include <wtf/RefCounted.h>

No need for RefCounted.h once we include URL.h.

> Source/WebCore/fileapi/Blob.h:39
>  #include <wtf/text/WTFString.h>

No need for WTFString.h once we include URL.h.

> Source/WebCore/fileapi/Blob.h:44
> +};

No need for a semicolon here.

> Source/WebCore/fileapi/BlobBuilder.cpp:73
> +    CString utf8Text = UTF8Encoding().encode(text, EntitiesForUnencodables);

Don’t we have a better way to convert to UTF-8? Annoying to have to use a CString.

> Source/WebCore/fileapi/BlobBuilder.h:51
> +    void append(RefPtr<JSC::ArrayBuffer>&&);
>      void append(RefPtr<JSC::ArrayBufferView>&&);
> +    void append(RefPtr<Blob>&&);

Why RefPtr&& instead of const RefPtr& for these? Separately, why can’t these just take raw pointers instead?

> Source/WebCore/fileapi/File.idl:35
>      Exposed=(Window),
>      JSGenerateToNativeObject,
>      JSGenerateToJSObject,
>      ExportMacro=WEBCORE_EXPORT,
> -    CustomConstructor(sequence<any> fileBits, DOMString fileName, optional FilePropertyBag options),
> +    Constructor(sequence<BlobPart> fileBits, USVString fileName, optional FilePropertyBag options),

Normally we sort extended attributes alphabetically.
Comment 15 Sam Weinig 2016-12-01 10:05:19 PST
Committed r209184: <http://trac.webkit.org/changeset/209184>