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

Issue 2496533002: binding: Makes Dictionary handle a possible exception in [[Get]]. (Closed)

Created:
4 years, 1 month ago by Yuki
Modified:
4 years, 1 month ago
Reviewers:
haraken, domenic, bashi
CC:
chromium-reviews, blink-reviews, blink-reviews-bindings_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

binding: Makes Dictionary handle a possible exception in [[Get]]. Dictionary retrieves a dictionary member through the [[Get]] internal method of the dictionary object. Since the properties can be accessor properties, arbitrary script may run in [[Get]], so we have to handle a possible exception in [[Get]]. The right fix is to propagate the exception up to the caller, however, there are so many callers and the issue is urgent. So simply swallowing all the exceptions in this CL, and fix it re-throws in a follow-up CL. BUG=644237 Committed: https://crrev.com/5f971b7bafe1c9a8574e66525b593644e4b9d658 Cr-Commit-Position: refs/heads/master@{#431848}

Patch Set 1 #

Patch Set 2 : Added a layout test. #

Total comments: 15

Patch Set 3 : Synced. #

Patch Set 4 : Added TODO comments + updated a test expectation. #

Total comments: 5

Patch Set 5 : Synced. #

Patch Set 6 : Addressed review comments. #

Patch Set 7 : Really added a short comment. (forgotten in the previous patch) #

Patch Set 8 : Fixed a coding style. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -22 lines) Patch
A third_party/WebKit/LayoutTests/fast/dom/dictionary-member-get-throws.html View 1 1 chunk +23 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/imported/wpt/web-animations/interfaces/KeyframeEffect/constructor-expected.txt View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp View 1 2 3 4 5 6 4 chunks +11 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp View 1 2 3 4 5 6 7 2 chunks +34 lines, -19 lines 0 comments Download

Messages

Total messages: 55 (31 generated)
bashi
lgtm, thank you for fixing bugs in Dictionary. https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp File third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp (left): https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp#oldcode32 third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp:32: // ...
4 years, 1 month ago (2016-11-10 13:32:42 UTC) #6
haraken
https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp File third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp (right): https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp#newcode66 third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp:66: if (v8Call(resultObject->Get(m_isolate->GetCurrentContext(), m_doneKey), Isn't it possible that this Get ...
4 years, 1 month ago (2016-11-10 13:32:48 UTC) #8
bashi
https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp File third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp (right): https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp#newcode66 third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp:66: if (v8Call(resultObject->Get(m_isolate->GetCurrentContext(), m_doneKey), On 2016/11/10 13:32:48, haraken wrote: > ...
4 years, 1 month ago (2016-11-10 13:35:00 UTC) #9
bashi
https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp File third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp (right): https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp#newcode66 third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp:66: if (v8Call(resultObject->Get(m_isolate->GetCurrentContext(), m_doneKey), On 2016/11/10 13:35:00, bashi1 wrote: > ...
4 years, 1 month ago (2016-11-10 13:44:39 UTC) #10
haraken
Hmm. As discussed in this bug (https://bugs.chromium.org/p/chromium/issues/detail?id=629070#c10), a right fix would be to replace Dictionary::get(...) ...
4 years, 1 month ago (2016-11-10 13:46:03 UTC) #11
Yuki
> - On the other hand, I'm not sure if this CL is doing a ...
4 years, 1 month ago (2016-11-10 13:58:09 UTC) #12
haraken
On 2016/11/10 13:58:09, Yuki wrote: > > - On the other hand, I'm not sure ...
4 years, 1 month ago (2016-11-10 14:02:45 UTC) #13
bashi
On 2016/11/10 13:46:03, haraken wrote: > Hmm. > > As discussed in this bug > ...
4 years, 1 month ago (2016-11-10 14:04:13 UTC) #14
bashi
https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp File third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp (left): https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp#oldcode32 third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp:32: // TODO(alancutter): Support callable objects as well as functions. ...
4 years, 1 month ago (2016-11-10 14:08:30 UTC) #15
Yuki
Hi Domenic, Could you give us advice? We're considering what should happen if a dictionary ...
4 years, 1 month ago (2016-11-10 14:10:36 UTC) #17
blink-reviews
You should rethrow the exception:). There are several other places in that algorithm that cause ...
4 years, 1 month ago (2016-11-10 18:44:18 UTC) #20
chromium-reviews
You should rethrow the exception:). There are several other places in that algorithm that cause ...
4 years, 1 month ago (2016-11-10 18:44:18 UTC) #21
blink-reviews
Posted https://github.com/heycam/webidl/pull/234 to make this clearer. On Thu, Nov 10, 2016 at 1:44 PM Domenic ...
4 years, 1 month ago (2016-11-10 19:28:23 UTC) #22
chromium-reviews
Posted https://github.com/heycam/webidl/pull/234 to make this clearer. On Thu, Nov 10, 2016 at 1:44 PM Domenic ...
4 years, 1 month ago (2016-11-10 19:28:24 UTC) #23
Yuki
Thanks Domenic. I'll update the CL to rethrow the exception.
4 years, 1 month ago (2016-11-11 07:43:02 UTC) #24
Yuki
It turned out that it wouldn't be easy to fix all the callers to pass ...
4 years, 1 month ago (2016-11-11 15:14:29 UTC) #28
bashi
https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp File third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp (right): https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp#newcode34 third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp:34: if (!v8Call(m_iterator->Get(m_isolate->GetCurrentContext(), m_nextKey), On 2016/11/11 15:14:29, Yuki wrote: > ...
4 years, 1 month ago (2016-11-12 01:16:59 UTC) #31
haraken
LGTM as a short-term fix. https://codereview.chromium.org/2496533002/diff/60001/third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp File third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp (right): https://codereview.chromium.org/2496533002/diff/60001/third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp#newcode140 third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp:140: if (!v8CallBoolean(object->Has(v8Context(), key))) Just ...
4 years, 1 month ago (2016-11-12 07:45:13 UTC) #32
Yuki
https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp File third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp (right): https://codereview.chromium.org/2496533002/diff/20001/third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp#newcode34 third_party/WebKit/Source/bindings/core/v8/DictionaryIterator.cpp:34: if (!v8Call(m_iterator->Get(m_isolate->GetCurrentContext(), m_nextKey), On 2016/11/12 01:16:59, bashi1 wrote: > ...
4 years, 1 month ago (2016-11-14 06:57:25 UTC) #35
haraken
https://codereview.chromium.org/2496533002/diff/60001/third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp File third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp (right): https://codereview.chromium.org/2496533002/diff/60001/third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp#newcode140 third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp:140: if (!v8CallBoolean(object->Has(v8Context(), key))) On 2016/11/14 06:57:25, Yuki wrote: > ...
4 years, 1 month ago (2016-11-14 07:13:25 UTC) #38
bashi
still lgtm
4 years, 1 month ago (2016-11-14 07:15:39 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2496533002/140001
4 years, 1 month ago (2016-11-14 09:21:06 UTC) #51
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 1 month ago (2016-11-14 10:06:00 UTC) #53
commit-bot: I haz the power
4 years, 1 month ago (2016-11-14 10:09:49 UTC) #55
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/5f971b7bafe1c9a8574e66525b593644e4b9d658
Cr-Commit-Position: refs/heads/master@{#431848}

Powered by Google App Engine
This is Rietveld 408576698