Bug 211477 - Introduce wrapper class for FileReaderLoader
Summary: Introduce wrapper class for FileReaderLoader
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nikos Mouchtaris
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-05 16:17 PDT by Nikos Mouchtaris
Modified: 2022-02-10 15:43 PST (History)
1 user (show)

See Also:


Attachments
Patch (12.53 KB, patch)
2020-05-05 16:23 PDT, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Mouchtaris 2020-05-05 16:17:54 PDT
Introduce wrapper class for FileReaderLoader
Comment 1 Nikos Mouchtaris 2020-05-05 16:23:29 PDT
Created attachment 398563 [details]
Patch
Comment 2 Wenson Hsieh 2020-05-06 14:51:48 PDT
Comment on attachment 398563 [details]
Patch

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

> Source/WebCore/page/FileReaderLoaderWrapper.cpp:49
> +    

Nit - extra newline here.

> Source/WebCore/page/FileReaderLoaderWrapper.cpp:77
> +    

Nit - extra newline here.

> Source/WebCore/page/FileReaderLoaderWrapper.cpp:82
> +    

Nit - extra newline here.

> Source/WebCore/page/FileReaderLoaderWrapper.cpp:91
> +}

Nit - newline after this closing brace.

> Source/WebCore/page/FileReaderLoaderWrapper.h:43
> +    static Ref<FileReaderLoaderWrapper> create(int id, CompletionHandler<void(ExceptionOr<int>)>&& completionHandler) { return adoptRef(*new FileReaderLoaderWrapper(id, WTFMove(completionHandler))); }

Nit - we generally avoid using `id` by itself as a variable name, since it will mean that this header cannot be included in Objective-C++ files (*.mm).

Since this is an index into a Vector, perhaps it should also be a `size_t` instead of an `int`?

> Source/WebCore/page/FileReaderLoaderWrapper.h:47
> +    RefPtr<SharedBuffer> readBuffer() const { return m_blobData; }

Nit - this should be marked const.

> Source/WebCore/page/FileReaderLoaderWrapper.h:48
> +    String fileName() { return m_fileName; }

const here too.