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

Issue 1100223003: bindings: Add empty checks for toV8() (Closed)

Created:
5 years, 8 months ago by bashi
Modified:
5 years, 7 months ago
Reviewers:
haraken, yurys, Yuki
CC:
blink-reviews, blink-reviews-dom_chromium.org, caseq+blink_chromium.org, arv+blink, vivekg_samsung, sof, eae+blinkwatch, yurys+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, loislo+blink_chromium.org, vivekg, dglazkov+blink, blink-reviews-bindings_chromium.org, kozyatinskiy+blink_chromium.org, devtools-reviews_chromium.org, apavlov+blink_chromium.org, sergeyv+blink_chromium.org, aandrey+blink_chromium.org, rwlbuis, pfeldman, alph, jochen (gone - plz use gerrit)
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

bindings: Add empty checks for toV8() toV8() could return empty handles (e.g. stack overflow). We should check IsEmpty() before we use returned handles. BUG=462402 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=195221

Patch Set 1 : #

Total comments: 24

Patch Set 2 : #

Total comments: 6

Patch Set 3 : #

Patch Set 4 : #

Total comments: 2

Patch Set 5 : #

Patch Set 6 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -21 lines) Patch
M Source/bindings/core/v8/Iterable.h View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/ScriptController.cpp View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M Source/bindings/core/v8/ScriptPromiseProperty.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/ScriptValueSerializer.cpp View 1 2 3 4 5 10 chunks +13 lines, -7 lines 0 comments Download
M Source/bindings/core/v8/V8Binding.cpp View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
M Source/bindings/core/v8/V8CustomElementLifecycleCallbacks.cpp View 1 2 3 chunks +10 lines, -7 lines 0 comments Download
M Source/bindings/core/v8/V8ErrorHandler.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/core/v8/V8EventListener.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/core/v8/V8LazyEventListener.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/core/v8/V8MutationCallback.cpp View 1 chunk +4 lines, -1 line 0 comments Download
M Source/bindings/core/v8/V8NodeFilterCondition.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/WindowProxy.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/custom/V8PopStateEventCustom.cpp View 1 chunk +4 lines, -1 line 0 comments Download
M Source/bindings/modules/v8/ScriptValueSerializerForModules.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/templates/attributes.cpp View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M Source/bindings/templates/methods.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface.cpp View 1 2 3 4 3 chunks +6 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestObject.cpp View 1 2 3 4 18 chunks +36 lines, -0 lines 0 comments Download
M Source/core/dom/DOMDataView.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/DOMTypedArray.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/web/InspectorOverlayImpl.cpp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/web/WebDevToolsFrontendImpl.cpp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/web/WebPluginContainerImpl.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (5 generated)
bashi
PTAL?
5 years, 8 months ago (2015-04-28 04:06:03 UTC) #3
haraken
https://codereview.chromium.org/1100223003/diff/20001/Source/bindings/core/v8/ScriptController.cpp File Source/bindings/core/v8/ScriptController.cpp (right): https://codereview.chromium.org/1100223003/diff/20001/Source/bindings/core/v8/ScriptController.cpp#newcode394 Source/bindings/core/v8/ScriptController.cpp:394: if (v8plugin.IsEmpty() || !v8plugin->IsObject()) I think we can remove ...
5 years, 7 months ago (2015-04-28 04:25:00 UTC) #4
Yuki
https://codereview.chromium.org/1100223003/diff/20001/Source/bindings/core/v8/ScriptController.cpp File Source/bindings/core/v8/ScriptController.cpp (right): https://codereview.chromium.org/1100223003/diff/20001/Source/bindings/core/v8/ScriptController.cpp#newcode394 Source/bindings/core/v8/ScriptController.cpp:394: if (v8plugin.IsEmpty() || !v8plugin->IsObject()) On 2015/04/28 04:24:59, haraken wrote: ...
5 years, 7 months ago (2015-04-28 04:47:57 UTC) #5
bashi
https://codereview.chromium.org/1100223003/diff/20001/Source/bindings/core/v8/ScriptController.cpp File Source/bindings/core/v8/ScriptController.cpp (right): https://codereview.chromium.org/1100223003/diff/20001/Source/bindings/core/v8/ScriptController.cpp#newcode394 Source/bindings/core/v8/ScriptController.cpp:394: if (v8plugin.IsEmpty() || !v8plugin->IsObject()) On 2015/04/28 04:47:57, Yuki wrote: ...
5 years, 7 months ago (2015-04-28 05:41:53 UTC) #7
haraken
LGTM except the ASSERT in the inspector-related code. https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp File Source/web/WebPluginContainerImpl.cpp (right): https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp#newcode466 Source/web/WebPluginContainerImpl.cpp:466: ASSERT(!v8value.IsEmpty() ...
5 years, 7 months ago (2015-04-28 05:50:34 UTC) #8
Yuki
lgtm
5 years, 7 months ago (2015-04-28 06:38:43 UTC) #9
bashi
https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp File Source/web/WebPluginContainerImpl.cpp (right): https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp#newcode466 Source/web/WebPluginContainerImpl.cpp:466: ASSERT(!v8value.IsEmpty() && v8value->IsObject()); On 2015/04/28 05:50:34, haraken wrote: > ...
5 years, 7 months ago (2015-04-28 06:41:15 UTC) #10
Yuki
https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp File Source/web/WebPluginContainerImpl.cpp (right): https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp#newcode466 Source/web/WebPluginContainerImpl.cpp:466: ASSERT(!v8value.IsEmpty() && v8value->IsObject()); On 2015/04/28 06:41:14, bashi1 wrote: > ...
5 years, 7 months ago (2015-04-28 06:43:46 UTC) #11
haraken
https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp File Source/web/WebPluginContainerImpl.cpp (right): https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp#newcode466 Source/web/WebPluginContainerImpl.cpp:466: ASSERT(!v8value.IsEmpty() && v8value->IsObject()); On 2015/04/28 06:43:46, Yuki wrote: > ...
5 years, 7 months ago (2015-04-28 06:46:08 UTC) #12
bashi
https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp File Source/web/WebPluginContainerImpl.cpp (right): https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp#newcode466 Source/web/WebPluginContainerImpl.cpp:466: ASSERT(!v8value.IsEmpty() && v8value->IsObject()); On 2015/04/28 06:46:08, haraken wrote: > ...
5 years, 7 months ago (2015-04-28 06:55:50 UTC) #13
haraken
On 2015/04/28 06:55:50, bashi1 wrote: > https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp > File Source/web/WebPluginContainerImpl.cpp (right): > > https://codereview.chromium.org/1100223003/diff/20001/Source/web/WebPluginContainerImpl.cpp#newcode466 > ...
5 years, 7 months ago (2015-04-28 06:57:42 UTC) #14
yurys
https://codereview.chromium.org/1100223003/diff/80001/Source/core/dom/DOMDataView.cpp File Source/core/dom/DOMDataView.cpp (right): https://codereview.chromium.org/1100223003/diff/80001/Source/core/dom/DOMDataView.cpp#newcode33 Source/core/dom/DOMDataView.cpp:33: return v8::Handle<v8::Object>(); AFAIU this is where v8::MaybeLocal should be ...
5 years, 7 months ago (2015-04-28 07:05:25 UTC) #15
bashi
https://codereview.chromium.org/1100223003/diff/80001/Source/core/dom/DOMDataView.cpp File Source/core/dom/DOMDataView.cpp (right): https://codereview.chromium.org/1100223003/diff/80001/Source/core/dom/DOMDataView.cpp#newcode33 Source/core/dom/DOMDataView.cpp:33: return v8::Handle<v8::Object>(); On 2015/04/28 07:05:25, yurys wrote: > AFAIU ...
5 years, 7 months ago (2015-04-28 07:09:45 UTC) #16
yurys
On 2015/04/28 07:09:45, bashi1 wrote: > We use MaybeLocal if we can guarantee that the ...
5 years, 7 months ago (2015-04-28 07:41:22 UTC) #17
bashi
On 2015/04/28 07:41:22, yurys wrote: > What's the fundamental difference between exception being thrown and ...
5 years, 7 months ago (2015-04-28 08:20:27 UTC) #18
yurys
On 2015/04/28 08:20:27, bashi1 wrote: > On 2015/04/28 07:41:22, yurys wrote: > > What's the ...
5 years, 7 months ago (2015-04-28 09:22:47 UTC) #19
bashi
On 2015/04/28 09:22:47, yurys wrote: > TryCatch allows you to catch thrown exception. You have ...
5 years, 7 months ago (2015-05-01 02:11:32 UTC) #20
yurys
On 2015/05/01 02:11:32, bashi1(ooo til May 12) wrote: > On 2015/04/28 09:22:47, yurys wrote: > ...
5 years, 7 months ago (2015-05-06 11:16:59 UTC) #21
bashi
On 2015/05/06 11:16:59, yurys wrote: > On 2015/05/01 02:11:32, bashi1(ooo til May 12) wrote: > ...
5 years, 7 months ago (2015-05-08 03:18:45 UTC) #22
bashi
I'm going to land this CL.
5 years, 7 months ago (2015-05-12 02:14:14 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1100223003/120001
5 years, 7 months ago (2015-05-12 02:14:49 UTC) #26
commit-bot: I haz the power
Committed patchset #6 (id:120001) as https://src.chromium.org/viewvc/blink?view=rev&revision=195221
5 years, 7 months ago (2015-05-12 03:38:23 UTC) #27
yurys
On 2015/05/08 03:18:45, bashi1 wrote: > > This is already false as far as I ...
5 years, 7 months ago (2015-05-20 00:48:44 UTC) #28
bashi
5 years, 7 months ago (2015-05-20 00:55:25 UTC) #29
Message was sent while issue was closed.
On 2015/05/20 00:48:44, yurys wrote:
> On 2015/05/08 03:18:45, bashi1 wrote:
> > > This is already false as far as I can see, in many places in
<v8>/src/api.cc
> > > MaybeLocal<Value>() is returned without throwing an exception (see e.g.
> > > v8::Object::GetRealNamedPropertyInPrototypeChain), am I missing something?
> > There are few exceptions and dcarney@ was working on removing such
exceptions,
> > but I'm not sure the current plan as he left the project.
> > https://codereview.chromium.org/1003043002/#msg21
> > 
> 
> It would make sense to fix those to avoid further confusion. I wonder if
someone
> is going to take over this effort?

+jochen@

I'm also curious on this. jochen@, is anyone working on this?

Powered by Google App Engine
This is Rietveld 408576698