Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Issue 57483002: Implement File constructor. (Closed)

Created:
7 years, 1 month ago by pwnall-personal
Modified:
7 years, 1 month ago
CC:
blink-reviews, Nils Barth (inactive), kojih, arv+blink, jsbell+bindings_chromium.org, abarth-chromium, kinuko, marja+watch_chromium.org, dglazkov+blink, adamk+blink_chromium.org, Nate Chapin
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Implement File constructor. The feature is behind the FileConstructor RuntimeEnabledFeature with status=experimental. BUG=164933 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162116

Patch Set 1 : #

Total comments: 10

Patch Set 2 : Addressed feedback, minus sequence vs array in File/Blob constructor. #

Total comments: 4

Patch Set 3 : Answered feedback, part 2. #

Total comments: 14

Patch Set 4 : Addressed feedback on tests. #

Total comments: 15

Patch Set 5 : Addressed feedback. #

Patch Set 6 : Rebased against master. #

Total comments: 4

Patch Set 7 : Feedback and a small improvement. #

Total comments: 1

Patch Set 8 : isOnFilesystem() -> hasBackingFile() #

Total comments: 4

Patch Set 9 : Addressed feedback. #

Total comments: 4

Patch Set 10 : Fixed nits. #

Total comments: 2

Patch Set 11 : Factored common code out of Blob and File custom constructors. #

Total comments: 1

Patch Set 12 : Updated for https://codereview.chromium.org/67953004/ #

Patch Set 13 : Rebased against master, updated patch. #

Total comments: 22

Patch Set 14 : Addressed feedback, updated for 61733022. #

Patch Set 15 : Rebased against master. #

Total comments: 2

Patch Set 16 : Addressed feedback. #

Total comments: 33

Patch Set 17 : Addressed most feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1257 lines, -530 lines) Patch
M LayoutTests/fast/files/blob-constructor.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +118 lines, -8 lines 0 comments Download
M LayoutTests/fast/files/blob-constructor-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +5 lines, -5 lines 0 comments Download
A LayoutTests/fast/files/blob-parts-slice-test.html View 1 2 3 4 5 1 chunk +55 lines, -0 lines 0 comments Download
A LayoutTests/fast/files/blob-parts-slice-test-expected.txt View 1 2 3 1 chunk +117 lines, -0 lines 0 comments Download
M LayoutTests/fast/files/blob-slice-test.html View 1 2 3 4 5 1 chunk +34 lines, -80 lines 0 comments Download
M LayoutTests/fast/files/blob-slice-test-expected.txt View 1 2 3 1 chunk +116 lines, -27 lines 0 comments Download
A LayoutTests/fast/files/file-constructor.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +146 lines, -0 lines 0 comments Download
A LayoutTests/fast/files/file-constructor-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +100 lines, -0 lines 0 comments Download
A LayoutTests/fast/files/resources/blob-slice-common.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +49 lines, -0 lines 0 comments Download
D LayoutTests/fast/files/script-tests/blob-constructor.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -114 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/post-blob-content-type-async.html View 1 2 3 4 5 1 chunk +68 lines, -63 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/post-blob-content-type-async-expected.txt View 1 chunk +16 lines, -11 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/post-blob-content-type-sync.html View 1 2 3 4 5 1 chunk +60 lines, -56 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/post-blob-content-type-sync-expected.txt View 1 chunk +16 lines, -11 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/post-blob-content-type-tests.js View 1 chunk +22 lines, -1 line 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/post-content-type.html View 1 2 3 2 chunks +2 lines, -4 lines 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/post-formdata.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +89 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/post-formdata-expected.txt View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
M LayoutTests/virtual/stable/webexposed/global-constructors-listing-dedicated-worker-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/virtual/stable/webexposed/global-constructors-listing-shared-worker-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/webexposed/global-constructors-listing-dedicated-worker-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/webexposed/global-constructors-listing-shared-worker-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/bindings.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8BindingMacros.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +11 lines, -0 lines 0 comments Download
M Source/bindings/v8/custom/V8BlobCustom.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +9 lines, -53 lines 0 comments Download
A + Source/bindings/v8/custom/V8BlobCustomHelpers.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +20 lines, -22 lines 0 comments Download
A + Source/bindings/v8/custom/V8BlobCustomHelpers.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +34 lines, -55 lines 0 comments Download
A Source/bindings/v8/custom/V8FileCustom.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +86 lines, -0 lines 0 comments Download
M Source/core/fileapi/Blob.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/fileapi/Blob.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/fileapi/BlobBuilder.h View 1 2 3 4 2 chunks +3 lines, -7 lines 0 comments Download
M Source/core/fileapi/BlobBuilder.cpp View 1 2 3 4 5 6 7 3 chunks +18 lines, -3 lines 0 comments Download
M Source/core/fileapi/File.h View 1 2 3 4 5 6 7 4 chunks +12 lines, -4 lines 0 comments Download
M Source/core/fileapi/File.cpp View 1 2 3 4 5 6 7 8 5 chunks +15 lines, -0 lines 0 comments Download
M Source/core/fileapi/File.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -1 line 0 comments Download
M Source/core/fileapi/FileReader.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/FormDataList.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/xml/XMLHttpRequest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 40 (0 generated)
pwnall-personal
Apologies for the large patch. Can you please take a look? After I implemented File ...
7 years, 1 month ago (2013-11-04 03:40:44 UTC) #1
Inactive
https://codereview.chromium.org/57483002/diff/110001/Source/bindings/v8/custom/V8FileCustom.cpp File Source/bindings/v8/custom/V8FileCustom.cpp (right): https://codereview.chromium.org/57483002/diff/110001/Source/bindings/v8/custom/V8FileCustom.cpp#newcode54 Source/bindings/v8/custom/V8FileCustom.cpp:54: RefPtr<Blob> blob = Blob::create(); Why are we creating a ...
7 years, 1 month ago (2013-11-04 14:13:10 UTC) #2
pwnall-personal
Thank you for the very fast and really good feedback! I addressed everything except for ...
7 years, 1 month ago (2013-11-04 17:16:25 UTC) #3
Inactive
https://codereview.chromium.org/57483002/diff/200001/Source/bindings/v8/custom/V8FileCustom.cpp File Source/bindings/v8/custom/V8FileCustom.cpp (right): https://codereview.chromium.org/57483002/diff/200001/Source/bindings/v8/custom/V8FileCustom.cpp#newcode58 Source/bindings/v8/custom/V8FileCustom.cpp:58: if (!firstArg->IsArray()) { Filing a bug and adding a ...
7 years, 1 month ago (2013-11-04 18:33:52 UTC) #4
pwnall-personal
Thank you for your guidance and patience! https://codereview.chromium.org/57483002/diff/200001/Source/bindings/v8/custom/V8FileCustom.cpp File Source/bindings/v8/custom/V8FileCustom.cpp (right): https://codereview.chromium.org/57483002/diff/200001/Source/bindings/v8/custom/V8FileCustom.cpp#newcode58 Source/bindings/v8/custom/V8FileCustom.cpp:58: if (!firstArg->IsArray()) ...
7 years, 1 month ago (2013-11-04 19:20:52 UTC) #5
esprehn
https://codereview.chromium.org/57483002/diff/320001/LayoutTests/fast/files/file-constructor.html File LayoutTests/fast/files/file-constructor.html (right): https://codereview.chromium.org/57483002/diff/320001/LayoutTests/fast/files/file-constructor.html#newcode7 LayoutTests/fast/files/file-constructor.html:7: <script src="script-tests/file-constructor.js"></script> Blah script tests suck, I wish we'd ...
7 years, 1 month ago (2013-11-04 19:28:08 UTC) #6
pwnall-personal
Thank you very much for the feedback! I addressed most of it, and have a ...
7 years, 1 month ago (2013-11-04 23:01:20 UTC) #7
Inactive
https://codereview.chromium.org/57483002/diff/240005/LayoutTests/fast/files/blob-constructor.html File LayoutTests/fast/files/blob-constructor.html (right): https://codereview.chromium.org/57483002/diff/240005/LayoutTests/fast/files/blob-constructor.html#newcode8 LayoutTests/fast/files/blob-constructor.html:8: shouldBeTrue("(new Blob()) instanceof window.Blob"); nit: Would be nice to ...
7 years, 1 month ago (2013-11-05 00:38:47 UTC) #8
pwnall-personal
Thank you so much for the feedback!! I'm not sure about what {Blob, File}.length should ...
7 years, 1 month ago (2013-11-05 01:14:23 UTC) #9
kinuko
https://codereview.chromium.org/57483002/diff/240005/Source/core/fileapi/BlobBuilder.h File Source/core/fileapi/BlobBuilder.h (right): https://codereview.chromium.org/57483002/diff/240005/Source/core/fileapi/BlobBuilder.h#newcode52 Source/core/fileapi/BlobBuilder.h:52: PassRefPtr<File> getFile(const String& contentType, const String& fileName, double modificationTime); ...
7 years, 1 month ago (2013-11-05 11:20:28 UTC) #10
pwnall-personal
I created a new bug to track the BlobBuilder refactoring. http://crbug.com/315038 https://codereview.chromium.org/57483002/diff/660001/Source/bindings/v8/custom/V8FileCustom.cpp File Source/bindings/v8/custom/V8FileCustom.cpp (right): ...
7 years, 1 month ago (2013-11-05 11:44:34 UTC) #11
Inactive
On 2013/11/05 01:14:23, pwnall wrote: > Thank you so much for the feedback!! > > ...
7 years, 1 month ago (2013-11-05 14:36:14 UTC) #12
Inactive
https://codereview.chromium.org/57483002/diff/730001/LayoutTests/fast/files/blob-constructor.html File LayoutTests/fast/files/blob-constructor.html (right): https://codereview.chromium.org/57483002/diff/730001/LayoutTests/fast/files/blob-constructor.html#newcode70 LayoutTests/fast/files/blob-constructor.html:70: shouldBe("window.Blob.length", "2"); This should be 0 as per Web ...
7 years, 1 month ago (2013-11-05 14:37:51 UTC) #13
Inactive
On 2013/11/05 11:20:28, kinuko wrote: > https://codereview.chromium.org/57483002/diff/240005/Source/core/fileapi/BlobBuilder.h > File Source/core/fileapi/BlobBuilder.h (right): > > https://codereview.chromium.org/57483002/diff/240005/Source/core/fileapi/BlobBuilder.h#newcode52 > ...
7 years, 1 month ago (2013-11-05 14:43:38 UTC) #14
pwnall-personal
On 2013/11/05 14:43:38, Chris Dumez wrote: > https://codereview.chromium.org/57483002/diff/660001/Source/core/fileapi/File.h > > File Source/core/fileapi/File.h (right): > > ...
7 years, 1 month ago (2013-11-05 17:21:32 UTC) #15
Inactive
On 2013/11/05 17:21:32, pwnall wrote: > On 2013/11/05 14:43:38, Chris Dumez wrote: > > > ...
7 years, 1 month ago (2013-11-05 19:49:34 UTC) #16
pwnall-personal
On 2013/11/05 19:49:34, Chris Dumez wrote: > If we want to keep the method, I ...
7 years, 1 month ago (2013-11-05 21:21:56 UTC) #17
Inactive
https://codereview.chromium.org/57483002/diff/820001/LayoutTests/fast/files/blob-constructor.html File LayoutTests/fast/files/blob-constructor.html (right): https://codereview.chromium.org/57483002/diff/820001/LayoutTests/fast/files/blob-constructor.html#newcode70 LayoutTests/fast/files/blob-constructor.html:70: shouldBe("window.Blob.length", "2"); This should be 0, not 2. https://codereview.chromium.org/57483002/diff/820001/LayoutTests/fast/files/file-constructor.html ...
7 years, 1 month ago (2013-11-07 14:27:43 UTC) #18
pwnall-personal
Thank you very much for the feedback! Can you please take another look? Asides from ...
7 years, 1 month ago (2013-11-08 07:36:40 UTC) #19
Inactive
lgtm % nits. Please let an API owner take a look before landing. kinuko will ...
7 years, 1 month ago (2013-11-08 20:37:13 UTC) #20
Inactive
https://codereview.chromium.org/57483002/diff/890001/LayoutTests/fast/files/file-constructor-expected.txt File LayoutTests/fast/files/file-constructor-expected.txt (right): https://codereview.chromium.org/57483002/diff/890001/LayoutTests/fast/files/file-constructor-expected.txt#newcode27 LayoutTests/fast/files/file-constructor-expected.txt:27: FAIL (new File([new Blob([new File([new Blob], 'world.txt')]])], 'world.html')) instanceof ...
7 years, 1 month ago (2013-11-08 20:37:33 UTC) #21
pwnall-personal
Thank you for the thorough and speedy review! I added kinuko as a reviewer, and ...
7 years, 1 month ago (2013-11-08 21:25:06 UTC) #22
abarth-chromium
https://codereview.chromium.org/57483002/diff/890007/Source/bindings/v8/custom/V8FileCustom.cpp File Source/bindings/v8/custom/V8FileCustom.cpp (right): https://codereview.chromium.org/57483002/diff/890007/Source/bindings/v8/custom/V8FileCustom.cpp#newcode45 Source/bindings/v8/custom/V8FileCustom.cpp:45: void V8File::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info) This code appears to be ...
7 years, 1 month ago (2013-11-09 20:19:15 UTC) #23
pwnall-personal
On 2013/11/09 20:19:15, abarth wrote: > https://codereview.chromium.org/57483002/diff/890007/Source/bindings/v8/custom/V8FileCustom.cpp > File Source/bindings/v8/custom/V8FileCustom.cpp (right): > > https://codereview.chromium.org/57483002/diff/890007/Source/bindings/v8/custom/V8FileCustom.cpp#newcode45 > ...
7 years, 1 month ago (2013-11-09 20:22:32 UTC) #24
pwnall-personal
I took a stab at the refactoring. Please take a look? https://codereview.chromium.org/57483002/diff/890007/Source/bindings/v8/custom/V8FileCustom.cpp File Source/bindings/v8/custom/V8FileCustom.cpp (right): ...
7 years, 1 month ago (2013-11-10 03:14:57 UTC) #25
pwnall-personal
I updated this patch twice because the code underneath changed. Adam, Kinuko, can you please ...
7 years, 1 month ago (2013-11-14 03:42:22 UTC) #26
kinuko
Mostly nits. (Sorry for my slow review) https://codereview.chromium.org/57483002/diff/1390001/LayoutTests/fast/files/blob-constructor.html File LayoutTests/fast/files/blob-constructor.html (left): https://codereview.chromium.org/57483002/diff/1390001/LayoutTests/fast/files/blob-constructor.html#oldcode7 LayoutTests/fast/files/blob-constructor.html:7: <script src="script-tests/blob-constructor.js"></script> ...
7 years, 1 month ago (2013-11-14 05:41:05 UTC) #27
pwnall-personal
Thank you very much for the thorough feedback! I hope I addressed everything. Can you ...
7 years, 1 month ago (2013-11-14 14:31:17 UTC) #28
kinuko
lgtm, please have v8/binding part reviewed by abarth or haraken or someone who know the ...
7 years, 1 month ago (2013-11-15 02:16:30 UTC) #29
pwnall-personal
Thank you very much for the feedback! I'm really grateful for the opportunity to contribute! ...
7 years, 1 month ago (2013-11-15 03:36:42 UTC) #30
haraken
Let me take a detailed look today.
7 years, 1 month ago (2013-11-15 06:28:04 UTC) #31
haraken
LGTM https://codereview.chromium.org/57483002/diff/1720001/Source/bindings/v8/custom/V8BlobCustom.cpp File Source/bindings/v8/custom/V8BlobCustom.cpp (right): https://codereview.chromium.org/57483002/diff/1720001/Source/bindings/v8/custom/V8BlobCustom.cpp#newcode36 Source/bindings/v8/custom/V8BlobCustom.cpp:36: #include "wtf/RefPtr.h" Nit: This won't be needed. https://codereview.chromium.org/57483002/diff/1720001/Source/bindings/v8/custom/V8BlobCustom.cpp#newcode44 ...
7 years, 1 month ago (2013-11-15 08:40:04 UTC) #32
pwnall-personal
Thank you very much for the review! I'll post an updated patch in a bit. ...
7 years, 1 month ago (2013-11-15 08:58:41 UTC) #33
haraken
https://codereview.chromium.org/57483002/diff/1720001/Source/bindings/v8/custom/V8BlobCustom.cpp File Source/bindings/v8/custom/V8BlobCustom.cpp (right): https://codereview.chromium.org/57483002/diff/1720001/Source/bindings/v8/custom/V8BlobCustom.cpp#newcode67 Source/bindings/v8/custom/V8BlobCustom.cpp:67: if (!V8BlobCustomHelpers::processBlobPropertyBag(info[1], info.GetIsolate(), "Blob", contentType, endings)) On 2013/11/15 08:58:42, ...
7 years, 1 month ago (2013-11-15 09:09:39 UTC) #34
pwnall-personal
Thank you very much for your feedback once again! There were a couple of places ...
7 years, 1 month ago (2013-11-15 10:28:51 UTC) #35
haraken
LGTM https://codereview.chromium.org/57483002/diff/1720001/Source/bindings/v8/custom/V8BlobCustom.cpp File Source/bindings/v8/custom/V8BlobCustom.cpp (right): https://codereview.chromium.org/57483002/diff/1720001/Source/bindings/v8/custom/V8BlobCustom.cpp#newcode53 Source/bindings/v8/custom/V8BlobCustom.cpp:53: if (toV8Sequence(info[sequenceArgumentIndex], length, info.GetIsolate()).IsEmpty()) { On 2013/11/15 10:28:53, ...
7 years, 1 month ago (2013-11-15 10:39:11 UTC) #36
esprehn
lgtm
7 years, 1 month ago (2013-11-15 11:17:10 UTC) #37
pwnall-personal
On 2013/11/15 11:17:10, esprehn wrote: > lgtm Thank you very much!!
7 years, 1 month ago (2013-11-15 11:29:11 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/costan@gmail.com/57483002/1900001
7 years, 1 month ago (2013-11-15 12:09:29 UTC) #39
commit-bot: I haz the power
7 years, 1 month ago (2013-11-15 13:24:44 UTC) #40
Message was sent while issue was closed.
Change committed as 162116

Powered by Google App Engine
This is Rietveld 408576698