Bug 176800 - [Cleanup] Cleanup uses of the FileList class
Summary: [Cleanup] Cleanup uses of the FileList class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-09-12 13:13 PDT by Sam Weinig
Modified: 2017-09-27 12:27 PDT (History)
6 users (show)

See Also:


Attachments
Patch (29.34 KB, patch)
2017-09-12 13:42 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (29.35 KB, patch)
2017-09-12 14:34 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2017-09-12 13:13:06 PDT
[Cleanup] Cleanup uses of the FileList class
Comment 1 Sam Weinig 2017-09-12 13:42:31 PDT
Created attachment 320564 [details]
Patch
Comment 2 Build Bot 2017-09-12 13:44:32 PDT
Attachment 320564 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/gtk/DragDataGtk.cpp:0:  No copyright message found.  You should have a line: "Copyright [year] <Copyright Owner>"  [legal/copyright] [5]
Total errors found: 1 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Sam Weinig 2017-09-12 14:34:35 PDT
Created attachment 320568 [details]
Patch
Comment 4 Build Bot 2017-09-12 14:37:10 PDT
Attachment 320568 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/gtk/DragDataGtk.cpp:0:  No copyright message found.  You should have a line: "Copyright [year] <Copyright Owner>"  [legal/copyright] [5]
Total errors found: 1 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Alex Christensen 2017-09-13 23:43:58 PDT
Comment on attachment 320568 [details]
Patch

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

> Source/WebCore/bindings/js/SerializedScriptValue.cpp:2700
>                  if (!readFile(file))
>                      return JSValue();
>                  if (m_isDOMGlobalObject)
> -                    files.append(WTFMove(file));
> +                    files.append(file.releaseNonNull());

This would be nicer if you made readFile take no parameters and return a RefPtr.
Comment 6 WebKit Commit Bot 2017-09-14 09:22:11 PDT
Comment on attachment 320568 [details]
Patch

Clearing flags on attachment: 320568

Committed r222025: <http://trac.webkit.org/changeset/222025>
Comment 7 WebKit Commit Bot 2017-09-14 09:22:12 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Darin Adler 2017-09-14 17:45:01 PDT
Comment on attachment 320568 [details]
Patch

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

> Source/WebCore/html/FileInputType.cpp:156
> +    auto* fileList = element().files();
> +    ASSERT(fileList);

I would write:

    ASSERT(element().files());
    auto& fileList = *element().files();

> Source/WebCore/html/FormController.h:48
> +        m_values.append(value);

Can this be done more efficiently? Seems like this will allocate a larger Vector than is needed.
Comment 9 Sam Weinig 2017-09-15 08:47:58 PDT
(In reply to Darin Adler from comment #8)
> Comment on attachment 320568 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=320568&action=review
> 
> > Source/WebCore/html/FileInputType.cpp:156
> > +    auto* fileList = element().files();
> > +    ASSERT(fileList);
> 
> I would write:
> 
>     ASSERT(element().files());
>     auto& fileList = *element().files();
> 
> > Source/WebCore/html/FormController.h:48
> > +        m_values.append(value);
> 
> Can this be done more efficiently? Seems like this will allocate a larger
> Vector than is needed.

Thanks. I'll address these with https://bugs.webkit.org/show_bug.cgi?id=177004.
Comment 10 Radar WebKit Bug Importer 2017-09-27 12:27:54 PDT
<rdar://problem/34693325>