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

Issue 1532473002: Add a origin clean flag in ImageBitmap class (Closed)

Created:
5 years ago by xidachen
Modified:
4 years, 11 months ago
Reviewers:
Justin Novosad
CC:
chromium-reviews, philipj_slow, mlamouri+watch-blink_chromium.org, blink-reviews-html_chromium.org, eric.carlson_apple.com, feature-media-reviews_chromium.org, dglazkov+blink, blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a origin clean flag in ImageBitmap class This CL adds a origin clean flag, such that in the case when the source of the ImageBitmap contains cross-origin content, we can simply set this flag instead of reject the promise. BUG=569779 Committed: https://crrev.com/10b9b4435e25fb8ede2122482426ae81c7980630 Cr-Commit-Position: refs/heads/master@{#368595} Committed: https://crrev.com/f3717a3a3a25aa5ddd9dfd4234f09ff13f001575 Cr-Commit-Position: refs/heads/master@{#368681}

Patch Set 1 #

Total comments: 13

Patch Set 2 : better origin clean flag #

Patch Set 3 : handle canvas #

Total comments: 4

Patch Set 4 : better layout test #

Total comments: 12

Patch Set 5 : more on layout test #

Total comments: 4

Patch Set 6 : using promise chain in layout test #

Total comments: 10

Patch Set 7 : better layout test #

Patch Set 8 : correct layout test #

Patch Set 9 : change flag for image and staticbitmapimage #

Total comments: 1

Patch Set 10 : handle createImageBitmap(Blob) #

Patch Set 11 : StaticBitmapImage now has a second parameter for origin clean flag #

Total comments: 8

Patch Set 12 : take care of single security origin #

Total comments: 2

Patch Set 13 : Roll back to PS#10 which works, and remove createImageBitmap(image) #

Total comments: 2

Patch Set 14 : use StaticBitmapImage's origin flag for ImageBitmap #

Patch Set 15 : fix compilation error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -88 lines) Patch
M third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html View 1 2 3 4 5 6 7 1 chunk +63 lines, -27 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap-expected.txt View 1 2 3 4 5 6 7 1 chunk +10 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +8 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +14 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp View 1 2 3 11 12 3 chunks +20 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 2 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageElement.cpp View 1 1 chunk +1 line, -10 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.cpp View 1 1 chunk +1 line, -10 lines 0 comments Download
M third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 50 (13 generated)
xidachen
PTAL
5 years ago (2015-12-16 02:55:33 UTC) #2
Justin Novosad
Where are the tests? See third_party/WebKit/LayoutTests/http/tests/security/canvas* for inspiration https://codereview.chromium.org/1532473002/diff/1/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/1532473002/diff/1/third_party/WebKit/Source/core/frame/ImageBitmap.cpp#newcode73 third_party/WebKit/Source/core/frame/ImageBitmap.cpp:73: ImageBitmap::ImageBitmap(HTMLCanvasElement* ...
5 years ago (2015-12-16 03:34:35 UTC) #3
xidachen
https://codereview.chromium.org/1532473002/diff/1/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/1532473002/diff/1/third_party/WebKit/Source/core/frame/ImageBitmap.cpp#newcode73 third_party/WebKit/Source/core/frame/ImageBitmap.cpp:73: ImageBitmap::ImageBitmap(HTMLCanvasElement* canvas, const IntRect& cropRect) On 2015/12/16 03:34:35, Justin ...
5 years ago (2015-12-22 14:29:40 UTC) #4
Justin Novosad
https://codereview.chromium.org/1532473002/diff/40001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html File third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html (right): https://codereview.chromium.org/1532473002/diff/40001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html#newcode6 third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html:6: description("The image bitmap factories should not throw exceptions on ...
4 years, 12 months ago (2015-12-23 18:06:34 UTC) #5
xidachen
https://codereview.chromium.org/1532473002/diff/40001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html File third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html (right): https://codereview.chromium.org/1532473002/diff/40001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html#newcode6 third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html:6: description("The image bitmap factories should not throw exceptions on ...
4 years, 11 months ago (2015-12-29 15:04:15 UTC) #6
Justin Novosad
https://codereview.chromium.org/1532473002/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html File third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html (right): https://codereview.chromium.org/1532473002/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html#newcode11 third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html:11: function shouldBeAccepted(promise, message) { -> shouldBeAcceptedAndTainted https://codereview.chromium.org/1532473002/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html#newcode23 third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html:23: function ...
4 years, 11 months ago (2015-12-29 17:33:50 UTC) #7
xidachen
https://codereview.chromium.org/1532473002/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html File third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html (right): https://codereview.chromium.org/1532473002/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html#newcode11 third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html:11: function shouldBeAccepted(promise, message) { On 2015/12/29 17:33:50, Justin Novosad ...
4 years, 11 months ago (2015-12-30 17:45:31 UTC) #8
Justin Novosad
https://codereview.chromium.org/1532473002/diff/80001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html File third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html (right): https://codereview.chromium.org/1532473002/diff/80001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html#newcode50 third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html:50: context.drawImage(image, 0, 0, 10, 10); Add a comment that ...
4 years, 11 months ago (2015-12-30 20:42:18 UTC) #9
xidachen
https://codereview.chromium.org/1532473002/diff/80001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html File third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html (right): https://codereview.chromium.org/1532473002/diff/80001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html#newcode50 third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html:50: context.drawImage(image, 0, 0, 10, 10); On 2015/12/30 20:42:18, Justin ...
4 years, 11 months ago (2015-12-31 03:37:01 UTC) #10
Justin Novosad
https://codereview.chromium.org/1532473002/diff/100001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html File third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html (right): https://codereview.chromium.org/1532473002/diff/100001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html#newcode31 third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html:31: testFailed("FAIL: ImageBitmap is not tainted."); No need for "FAIL:" ...
4 years, 11 months ago (2016-01-04 20:45:51 UTC) #11
xidachen
https://codereview.chromium.org/1532473002/diff/100001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html File third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html (right): https://codereview.chromium.org/1532473002/diff/100001/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html#newcode31 third_party/WebKit/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html:31: testFailed("FAIL: ImageBitmap is not tainted."); On 2016/01/04 20:45:51, Justin ...
4 years, 11 months ago (2016-01-05 16:06:44 UTC) #12
Justin Novosad
lgtm
4 years, 11 months ago (2016-01-05 16:51:43 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532473002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532473002/140001
4 years, 11 months ago (2016-01-05 16:56:08 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/155072)
4 years, 11 months ago (2016-01-05 18:29:06 UTC) #17
xidachen
https://codereview.chromium.org/1532473002/diff/160001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/1532473002/diff/160001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp#newcode115 third_party/WebKit/Source/core/frame/ImageBitmap.cpp:115: m_isOriginClean = !image->currentFrameHasSingleSecurityOrigin(); Is this what we want? For ...
4 years, 11 months ago (2016-01-05 20:04:37 UTC) #18
xidachen
Hi Justin, PS#10 is the one that works. PTAL.
4 years, 11 months ago (2016-01-06 03:04:51 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532473002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532473002/180001
4 years, 11 months ago (2016-01-06 18:03:08 UTC) #21
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 11 months ago (2016-01-06 19:06:12 UTC) #23
xidachen
PTAL.
4 years, 11 months ago (2016-01-06 22:05:21 UTC) #24
Justin Novosad
https://codereview.chromium.org/1532473002/diff/200001/third_party/WebKit/Source/core/frame/ImageBitmap.h File third_party/WebKit/Source/core/frame/ImageBitmap.h (right): https://codereview.chromium.org/1532473002/diff/200001/third_party/WebKit/Source/core/frame/ImageBitmap.h#newcode77 third_party/WebKit/Source/core/frame/ImageBitmap.h:77: bool m_isOriginClean = true; This is redundant now that ...
4 years, 11 months ago (2016-01-07 17:12:01 UTC) #25
xidachen
Hi Justin, I made some changes here. Please correct me if I am wrong: ImageBitmap ...
4 years, 11 months ago (2016-01-08 18:07:55 UTC) #26
Justin Novosad
https://codereview.chromium.org/1532473002/diff/220001/third_party/WebKit/Source/platform/graphics/GraphicsTypes.h File third_party/WebKit/Source/platform/graphics/GraphicsTypes.h (right): https://codereview.chromium.org/1532473002/diff/220001/third_party/WebKit/Source/platform/graphics/GraphicsTypes.h#newcode92 third_party/WebKit/Source/platform/graphics/GraphicsTypes.h:92: enum SingleSecurityOriginType { I would rename this SecurityOriginMode. With ...
4 years, 11 months ago (2016-01-08 19:08:43 UTC) #27
Justin Novosad
On 2016/01/08 19:08:43, Justin Novosad wrote: > As discussed live, I would like this to ...
4 years, 11 months ago (2016-01-08 19:18:49 UTC) #28
xidachen
Hi Justin, PS#13 should work. PTAL.
4 years, 11 months ago (2016-01-08 21:47:28 UTC) #29
Justin Novosad
https://codereview.chromium.org/1532473002/diff/240001/third_party/WebKit/Source/core/frame/ImageBitmap.h File third_party/WebKit/Source/core/frame/ImageBitmap.h (right): https://codereview.chromium.org/1532473002/diff/240001/third_party/WebKit/Source/core/frame/ImageBitmap.h#newcode77 third_party/WebKit/Source/core/frame/ImageBitmap.h:77: bool m_isOriginClean = true; Can we safely get rid ...
4 years, 11 months ago (2016-01-08 22:09:39 UTC) #30
xidachen
https://codereview.chromium.org/1532473002/diff/240001/third_party/WebKit/Source/core/frame/ImageBitmap.h File third_party/WebKit/Source/core/frame/ImageBitmap.h (right): https://codereview.chromium.org/1532473002/diff/240001/third_party/WebKit/Source/core/frame/ImageBitmap.h#newcode77 third_party/WebKit/Source/core/frame/ImageBitmap.h:77: bool m_isOriginClean = true; On 2016/01/08 22:09:39, Justin Novosad ...
4 years, 11 months ago (2016-01-09 12:23:48 UTC) #31
Justin Novosad
lgtm
4 years, 11 months ago (2016-01-11 14:54:11 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532473002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532473002/260001
4 years, 11 months ago (2016-01-11 14:54:24 UTC) #34
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 11 months ago (2016-01-11 16:01:32 UTC) #35
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/10b9b4435e25fb8ede2122482426ae81c7980630 Cr-Commit-Position: refs/heads/master@{#368595}
4 years, 11 months ago (2016-01-11 16:02:17 UTC) #37
Marc Treib
A revert of this CL (patchset #14 id:260001) has been created in https://codereview.chromium.org/1577783003/ by treib@chromium.org. ...
4 years, 11 months ago (2016-01-11 16:19:18 UTC) #38
xidachen
It was a careless mistake that cause oilpan failure, I used enable_oilpan=true to compile this ...
4 years, 11 months ago (2016-01-11 16:40:47 UTC) #39
Justin Novosad
lgtm
4 years, 11 months ago (2016-01-11 17:53:23 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532473002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532473002/280001
4 years, 11 months ago (2016-01-11 17:54:50 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1532473002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1532473002/280001
4 years, 11 months ago (2016-01-11 21:49:51 UTC) #46
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 11 months ago (2016-01-11 21:56:24 UTC) #48
commit-bot: I haz the power
4 years, 11 months ago (2016-01-11 21:57:41 UTC) #50
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/f3717a3a3a25aa5ddd9dfd4234f09ff13f001575
Cr-Commit-Position: refs/heads/master@{#368681}

Powered by Google App Engine
This is Rietveld 408576698