Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(98)

Issue 1153613007: bindings: Use CreateDataProperty() instead of ForceSet() (Closed)

Created:
4 years, 11 months ago by bashi
Modified:
4 years, 10 months ago
CC:
arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-html_chromium.org, dglazkov+blink, vivekg_samsung, vivekg
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

bindings: Use CreateDataProperty() instead of ForceSet() We use ForceSet() to avoid executing user-provided JS while running callbacks, but ForceSet() is deprecated because it is difficult to use properly. Use CreateDataProperty() instead. It is a safer way to do that. BUG=475206 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197156

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Total comments: 3

Patch Set 3 : #

Total comments: 2

Patch Set 4 : DefineOwnProperty() doesn't work in V8InjectedScriptHost::setNonEnumPropertyMethodCustom #

Total comments: 4

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : Fix uninitialized error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+119 lines, -121 lines) Patch
M Source/bindings/core/v8/CustomElementConstructorBuilder.cpp View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M Source/bindings/core/v8/ScriptValueSerializer.cpp View 1 2 3 4 5 6 2 chunks +9 lines, -5 lines 0 comments Download
M Source/bindings/core/v8/V8LazyEventListener.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/bindings/core/v8/V8ObjectBuilder.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/core/v8/WindowProxy.cpp View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/inspector/V8InjectedScriptHost.cpp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/modules/v8/V8BindingForModules.cpp View 1 2 3 4 5 4 chunks +4 lines, -8 lines 0 comments Download
M Source/bindings/scripts/v8_attributes.py View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/templates/dictionary_v8.cpp View 1 chunk +2 lines, -3 lines 0 comments Download
M Source/bindings/templates/interface.cpp View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/templates/interface_base.cpp View 1 2 3 4 3 chunks +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestDictionary.cpp View 1 2 1 chunk +44 lines, -45 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp View 1 chunk +4 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface.cpp View 1 2 3 4 5 3 chunks +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp View 1 2 3 4 5 3 chunks +5 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestObject.cpp View 1 2 3 4 5 8 chunks +13 lines, -13 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestTypedefs.cpp View 1 2 3 4 5 3 chunks +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/modules/V8TestInterface5.cpp View 1 2 3 4 5 3 chunks +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/ImageData.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 22 (4 generated)
bashi
PTAL? I added some TODO comments where I'm not sure how I can replace ForceSet() ...
4 years, 11 months ago (2015-05-29 05:46:33 UTC) #2
jsbell
lgtm on the actual code changes; I didn't review the TODOs closely, though.
4 years, 11 months ago (2015-05-29 16:39:23 UTC) #3
jsbell
https://codereview.chromium.org/1153613007/diff/1/Source/bindings/templates/interface_base.cpp File Source/bindings/templates/interface_base.cpp (right): https://codereview.chromium.org/1153613007/diff/1/Source/bindings/templates/interface_base.cpp#newcode51 Source/bindings/templates/interface_base.cpp:51: static void {{cpp_class}}ForceSetAttributeOnThis(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info) ...
4 years, 11 months ago (2015-05-29 16:57:21 UTC) #4
bashi
jochen@ added DefineOwnProperty. Once it is rolled into chromium, we can replace all ForceSet with ...
4 years, 11 months ago (2015-06-02 00:12:54 UTC) #5
jochen (gone - plz use gerrit)
there are a bunch of ForceSet() calls where it's not immediately obvious why you can't ...
4 years, 11 months ago (2015-06-02 16:14:48 UTC) #6
bashi
DefineOwnProperty is rolled in. PTAL? https://codereview.chromium.org/1153613007/diff/20001/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp File Source/bindings/core/v8/custom/V8MessageEventCustom.cpp (right): https://codereview.chromium.org/1153613007/diff/20001/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp#newcode95 Source/bindings/core/v8/custom/V8MessageEventCustom.cpp:95: if (!v8CallBoolean(info.Holder()->ForceSet(info.GetIsolate()->GetCurrentContext(), v8AtomicString(info.GetIsolate(), "data"), ...
4 years, 11 months ago (2015-06-03 00:16:37 UTC) #7
bashi
https://codereview.chromium.org/1153613007/diff/40001/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp File Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp (right): https://codereview.chromium.org/1153613007/diff/40001/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp#newcode569 Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp:569: auto unused = object->DefineOwnProperty(info.GetIsolate()->GetCurrentContext(), key, info[2], v8::DontEnum); This causes ...
4 years, 11 months ago (2015-06-03 03:05:31 UTC) #8
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1153613007/diff/60001/Source/bindings/core/v8/WindowProxy.cpp File Source/bindings/core/v8/WindowProxy.cpp (right): https://codereview.chromium.org/1153613007/diff/60001/Source/bindings/core/v8/WindowProxy.cpp#newcode378 Source/bindings/core/v8/WindowProxy.cpp:378: // global proxy objects. why? https://codereview.chromium.org/1153613007/diff/60001/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp File Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp (right): ...
4 years, 11 months ago (2015-06-03 10:55:17 UTC) #9
bashi
https://codereview.chromium.org/1153613007/diff/60001/Source/bindings/core/v8/WindowProxy.cpp File Source/bindings/core/v8/WindowProxy.cpp (right): https://codereview.chromium.org/1153613007/diff/60001/Source/bindings/core/v8/WindowProxy.cpp#newcode378 Source/bindings/core/v8/WindowProxy.cpp:378: // global proxy objects. On 2015/06/03 10:55:17, jochen wrote: ...
4 years, 11 months ago (2015-06-05 01:10:27 UTC) #10
jochen (gone - plz use gerrit)
Toon, what should we do about the remaining ForceSet(). Apparently we can't DefineOwnProperty on the ...
4 years, 11 months ago (2015-06-05 12:12:58 UTC) #12
jochen (gone - plz use gerrit)
bashi@ after talking to Toon I still thing defineOwnProperty() *should* work. Can you post a ...
4 years, 10 months ago (2015-06-08 11:36:06 UTC) #13
bashi
On 2015/06/08 11:36:06, jochen wrote: > bashi@ after talking to Toon I still thing defineOwnProperty() ...
4 years, 10 months ago (2015-06-08 23:38:40 UTC) #14
jochen (gone - plz use gerrit)
Ah, I guess what happens is that "document" is already defined in Window.idl as an ...
4 years, 10 months ago (2015-06-09 08:11:33 UTC) #15
Toon Verwaest
I've fixed the issue underlying the assert, so you will be able to try this ...
4 years, 10 months ago (2015-06-11 19:23:26 UTC) #16
jochen (gone - plz use gerrit)
lgtm
4 years, 10 months ago (2015-06-12 09:49:31 UTC) #17
bashi
I'm going to land this. We will address WindowProxy issue separately.
4 years, 10 months ago (2015-06-16 03:13:36 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1153613007/120001
4 years, 10 months ago (2015-06-16 03:13:49 UTC) #21
commit-bot: I haz the power
4 years, 10 months ago (2015-06-16 03:20:33 UTC) #22
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=197156

Powered by Google App Engine
This is Rietveld 408576698