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

Issue 196343011: document.location bindings fix (Closed)

Created:
6 years, 9 months ago by Nate Chapin
Modified:
6 years, 9 months ago
CC:
blink-reviews, kojih, arv+blink, jsbell+bindings_chromium.org, sof, kouhei+bindings_chromium.org, abarth-chromium, marja+watch_chromium.org, adamk+blink_chromium.org, Inactive
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : + bindings update #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -9 lines) Patch
M Source/bindings/templates/attributes.cpp View 1 chunk +1 line, -1 line 4 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/V8TestObjectPython.cpp View 1 6 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
jochen (gone - plz use gerrit)
https://codereview.chromium.org/196343011/diff/20001/Source/bindings/templates/attributes.cpp File Source/bindings/templates/attributes.cpp (right): https://codereview.chromium.org/196343011/diff/20001/Source/bindings/templates/attributes.cpp#newcode247 Source/bindings/templates/attributes.cpp:247: {{attribute.v8_value_to_local_cpp_value}}; alternatively, we could just move this up, no?
6 years, 9 months ago (2014-03-13 23:26:48 UTC) #1
haraken
LGTM
6 years, 9 months ago (2014-03-13 23:26:57 UTC) #2
Nate Chapin
On 2014/03/13 23:26:48, jochen wrote: > https://codereview.chromium.org/196343011/diff/20001/Source/bindings/templates/attributes.cpp > File Source/bindings/templates/attributes.cpp (right): > > https://codereview.chromium.org/196343011/diff/20001/Source/bindings/templates/attributes.cpp#newcode247 > ...
6 years, 9 months ago (2014-03-13 23:29:34 UTC) #3
jochen (gone - plz use gerrit)
oh well, it's certainly safe to use a RefPtr<> so lgtm for merging back, you'll ...
6 years, 9 months ago (2014-03-13 23:33:26 UTC) #4
Nate Chapin
On 2014/03/13 23:33:26, jochen wrote: > oh well, it's certainly safe to use a RefPtr<> ...
6 years, 9 months ago (2014-03-13 23:34:16 UTC) #5
Nate Chapin
Committed patchset #2 manually as r169176 (presubmit successful).
6 years, 9 months ago (2014-03-13 23:38:00 UTC) #6
haraken
Just a follow-up: - The problem happens in places where C++ raw pointers are initialized ...
6 years, 9 months ago (2014-03-13 23:47:14 UTC) #7
eseidel
I have audited all calls to ToString and *V8STRINGRESOURCE* macros in bindings/custom to make sure ...
6 years, 9 months ago (2014-03-13 23:50:16 UTC) #8
haraken
On 2014/03/13 23:50:16, eseidel wrote: > I have audited all calls to ToString and *V8STRINGRESOURCE* ...
6 years, 9 months ago (2014-03-13 23:51:36 UTC) #9
Nils Barth (inactive)
On 2014/03/13 23:29:34, Nate Chapin wrote: > https://codereview.chromium.org/196343011/diff/20001/Source/bindings/templates/attributes.cpp#newcode247 > > Source/bindings/templates/attributes.cpp:247: > > {{attribute.v8_value_to_local_cpp_value}}; > ...
6 years, 9 months ago (2014-03-14 00:49:16 UTC) #10
Nils Barth (inactive)
Question for Jochen (and Nate); we could rearrange the code if that would catch errors ...
6 years, 9 months ago (2014-03-20 07:20:28 UTC) #11
jochen (gone - plz use gerrit)
https://codereview.chromium.org/196343011/diff/20001/Source/bindings/templates/attributes.cpp File Source/bindings/templates/attributes.cpp (right): https://codereview.chromium.org/196343011/diff/20001/Source/bindings/templates/attributes.cpp#newcode247 Source/bindings/templates/attributes.cpp:247: {{attribute.v8_value_to_local_cpp_value}}; On 2014/03/20 07:20:29, Nils Barth wrote: > On ...
6 years, 9 months ago (2014-03-20 07:42:13 UTC) #12
Nils Barth (inactive)
https://codereview.chromium.org/196343011/diff/20001/Source/bindings/templates/attributes.cpp File Source/bindings/templates/attributes.cpp (right): https://codereview.chromium.org/196343011/diff/20001/Source/bindings/templates/attributes.cpp#newcode247 Source/bindings/templates/attributes.cpp:247: {{attribute.v8_value_to_local_cpp_value}}; On 2014/03/20 07:42:13, jochen wrote: > On 2014/03/20 ...
6 years, 9 months ago (2014-03-24 05:06:08 UTC) #13
jochen (gone - plz use gerrit)
6 years, 9 months ago (2014-03-24 06:09:31 UTC) #14
Message was sent while issue was closed.
On 2014/03/24 05:06:08, Nils Barth wrote:
>
https://codereview.chromium.org/196343011/diff/20001/Source/bindings/template...
> File Source/bindings/templates/attributes.cpp (right):
> 
>
https://codereview.chromium.org/196343011/diff/20001/Source/bindings/template...
> Source/bindings/templates/attributes.cpp:247:
> {{attribute.v8_value_to_local_cpp_value}};
> On 2014/03/20 07:42:13, jochen wrote:
> > On 2014/03/20 07:20:29, Nils Barth wrote:
> > > On 2014/03/13 23:26:49, jochen wrote:
> > > > alternatively, we could just move this up, no?
> > > 
> > > How would this help?
> > > (Honest question; might be a good change.)
> > > 
> > > I.e., would it be good to do the local variable assignment
> > > *before* we get impl?
> > > 
> > > AFAICT the problem was in the assignment to |imp| (renamed to |impl|),
> right?
> > > 
> > > {{v8_value_to_local_cpp_value}} assigns to a local variable
> > > whose type depends on the attribute (in this case
> > > the target attribute of the [PutForwards]).
> > > In this case Document.location (type Location)
> > > forwards to Location.href (type DOMString)
> > > ...so the line it generates is:
> > > V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue,
jsValue);
> > 
> > this executes arbitrary javascript. Local variables assigned before aren't
> > guaranteed to be valid anymore afterwards.
> 
> Ok, so rearranging the generated code wouldn't help, right?

If we move all JavaScript execution before assigning raw pointers, we're safe

Powered by Google App Engine
This is Rietveld 408576698