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

Issue 1031783003: Add V8ObjectBuilder helper and use in modules/crypto/ (Closed)

Created:
5 years, 9 months ago by Jens Widell
Modified:
5 years, 9 months ago
Reviewers:
haraken, vivekg, bashi
CC:
arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, vivekg_samsung
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Add V8ObjectBuilder helper and use in modules/crypto/ V8ObjectBuilder is used to create simple V8 objects, and replaces the corresponding functionality in Dictionary (Dictionary::createEmpty() and the various Dictionary::set() functions), making Dictionary a read-only accessor of an object's properties. BUG=469650 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192599

Patch Set 1 #

Total comments: 13

Patch Set 2 : use ScriptState #

Total comments: 1

Patch Set 3 : include Handle.h #

Patch Set 4 : add missing include #

Patch Set 5 : make DictionaryBuilder STACK_ALLOCATED too #

Patch Set 6 : drop STACK_ALLOCATED #

Total comments: 7

Patch Set 7 : add STACK_ALLOCATED again :-) #

Patch Set 8 : add error handling #

Patch Set 9 : add final #

Patch Set 10 : add generic add() #

Total comments: 1

Patch Set 11 : use "const String&" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+132 lines, -64 lines) Patch
M Source/bindings/core/v8/Dictionary.h View 1 chunk +0 lines, -11 lines 0 comments Download
M Source/bindings/core/v8/Dictionary.cpp View 2 chunks +0 lines, -31 lines 0 comments Download
A Source/bindings/core/v8/V8ObjectBuilder.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +51 lines, -0 lines 0 comments Download
A Source/bindings/core/v8/V8ObjectBuilder.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +61 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/v8.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/modules/crypto/CryptoKey.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +14 lines, -16 lines 0 comments Download
M Source/modules/crypto/CryptoResultImpl.cpp View 1 2 3 2 chunks +4 lines, -6 lines 0 comments Download

Messages

Total messages: 29 (4 generated)
Jens Widell
PTAL I've modified V8ObjectBuilder a bit here, mostly to address the comments in https://codereview.chromium.org/1029093003/.
5 years, 9 months ago (2015-03-24 12:04:11 UTC) #2
haraken
https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.cpp File Source/bindings/core/v8/V8ObjectBuilder.cpp (right): https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.cpp#newcode20 Source/bindings/core/v8/V8ObjectBuilder.cpp:20: return ScriptValue(ScriptState::current(m_isolate), m_object); Using ScriptState::current is not nice, since ...
5 years, 9 months ago (2015-03-24 14:33:33 UTC) #3
Jens Widell
https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.cpp File Source/bindings/core/v8/V8ObjectBuilder.cpp (right): https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.cpp#newcode61 Source/bindings/core/v8/V8ObjectBuilder.cpp:61: m_object->ForceSet(m_isolate->GetCurrentContext(), v8String(m_isolate, name), value); On 2015/03/24 14:33:32, haraken wrote: ...
5 years, 9 months ago (2015-03-24 14:38:40 UTC) #4
haraken
On 2015/03/24 14:38:40, Jens Widell wrote: > https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.cpp > File Source/bindings/core/v8/V8ObjectBuilder.cpp (right): > > https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.cpp#newcode61 ...
5 years, 9 months ago (2015-03-24 14:44:44 UTC) #5
Jens Widell
https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.h File Source/bindings/core/v8/V8ObjectBuilder.h (right): https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.h#newcode29 Source/bindings/core/v8/V8ObjectBuilder.h:29: V8ObjectBuilder& addString(String name, String value); On 2015/03/24 14:33:33, haraken ...
5 years, 9 months ago (2015-03-24 14:51:46 UTC) #6
Jens Widell
On 2015/03/24 14:44:44, haraken wrote: > On 2015/03/24 14:38:40, Jens Widell wrote: > > > ...
5 years, 9 months ago (2015-03-24 15:03:10 UTC) #7
haraken
On 2015/03/24 14:51:46, Jens Widell wrote: > https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.h > File Source/bindings/core/v8/V8ObjectBuilder.h (right): > > https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.h#newcode29 ...
5 years, 9 months ago (2015-03-24 15:05:45 UTC) #8
haraken
On 2015/03/24 15:03:10, Jens Widell wrote: > On 2015/03/24 14:44:44, haraken wrote: > > On ...
5 years, 9 months ago (2015-03-24 15:13:52 UTC) #9
Jens Widell
https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.cpp File Source/bindings/core/v8/V8ObjectBuilder.cpp (right): https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.cpp#newcode20 Source/bindings/core/v8/V8ObjectBuilder.cpp:20: return ScriptValue(ScriptState::current(m_isolate), m_object); On 2015/03/24 14:33:32, haraken wrote: > ...
5 years, 9 months ago (2015-03-24 15:16:29 UTC) #10
haraken
LGTM (but I'm curious about the relationship between [[DefineOwnProperty]] and ForceSet().) https://codereview.chromium.org/1031783003/diff/20001/Source/bindings/core/v8/V8ObjectBuilder.h File Source/bindings/core/v8/V8ObjectBuilder.h (right): ...
5 years, 9 months ago (2015-03-24 15:26:25 UTC) #11
Jens Widell
On 2015/03/24 15:13:52, haraken wrote: > On 2015/03/24 15:03:10, Jens Widell wrote: > > On ...
5 years, 9 months ago (2015-03-24 15:33:48 UTC) #12
haraken
On 2015/03/24 15:33:48, Jens Widell wrote: > On 2015/03/24 15:13:52, haraken wrote: > > On ...
5 years, 9 months ago (2015-03-24 15:38:33 UTC) #13
Jens Widell
https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.h File Source/bindings/core/v8/V8ObjectBuilder.h (right): https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.h#newcode15 Source/bindings/core/v8/V8ObjectBuilder.h:15: class V8ObjectBuilder { On 2015/03/24 15:16:29, Jens Widell wrote: ...
5 years, 9 months ago (2015-03-24 16:22:37 UTC) #14
haraken
On 2015/03/24 16:22:37, Jens Widell wrote: > https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.h > File Source/bindings/core/v8/V8ObjectBuilder.h (right): > > https://codereview.chromium.org/1031783003/diff/1/Source/bindings/core/v8/V8ObjectBuilder.h#newcode15 ...
5 years, 9 months ago (2015-03-24 16:42:53 UTC) #15
bashi
LGTM On 2015/03/24 16:42:53, haraken wrote: > Ah, this is the issue bashi-san faced before... ...
5 years, 9 months ago (2015-03-25 01:09:14 UTC) #16
bashi
https://codereview.chromium.org/1031783003/diff/100001/Source/bindings/core/v8/V8ObjectBuilder.cpp File Source/bindings/core/v8/V8ObjectBuilder.cpp (right): https://codereview.chromium.org/1031783003/diff/100001/Source/bindings/core/v8/V8ObjectBuilder.cpp#newcode61 Source/bindings/core/v8/V8ObjectBuilder.cpp:61: m_object->ForceSet(m_scriptState->context(), v8String(m_scriptState->isolate(), name), value); Just a note: In the ...
5 years, 9 months ago (2015-03-25 01:09:25 UTC) #17
Jens Widell
On 2015/03/25 01:09:14, bashi1 wrote: > How about passing a stack allocated V8ObjectBuilder to DictionaryBuilder ...
5 years, 9 months ago (2015-03-25 11:16:04 UTC) #18
Jens Widell
https://codereview.chromium.org/1031783003/diff/100001/Source/modules/crypto/CryptoKey.cpp File Source/modules/crypto/CryptoKey.cpp (right): https://codereview.chromium.org/1031783003/diff/100001/Source/modules/crypto/CryptoKey.cpp#newcode129 Source/modules/crypto/CryptoKey.cpp:129: m_builder.add(propertyName, ScriptValue::from(m_builder.scriptState(), DOMUint8Array::create(vector.data(), vector.size()))); On 2015/03/25 11:16:04, Jens Widell ...
5 years, 9 months ago (2015-03-25 11:34:01 UTC) #19
bashi
LGTM. Thanks!
5 years, 9 months ago (2015-03-26 01:25:48 UTC) #20
vivekg
https://codereview.chromium.org/1031783003/diff/180001/Source/bindings/core/v8/V8ObjectBuilder.h File Source/bindings/core/v8/V8ObjectBuilder.h (right): https://codereview.chromium.org/1031783003/diff/180001/Source/bindings/core/v8/V8ObjectBuilder.h#newcode25 Source/bindings/core/v8/V8ObjectBuilder.h:25: V8ObjectBuilder& add(String name, const V8ObjectBuilder&); nit: Can we use ...
5 years, 9 months ago (2015-03-26 03:46:50 UTC) #22
haraken
On 2015/03/26 03:46:50, vivekg_ wrote: > https://codereview.chromium.org/1031783003/diff/180001/Source/bindings/core/v8/V8ObjectBuilder.h > File Source/bindings/core/v8/V8ObjectBuilder.h (right): > > https://codereview.chromium.org/1031783003/diff/180001/Source/bindings/core/v8/V8ObjectBuilder.h#newcode25 > ...
5 years, 9 months ago (2015-03-26 03:57:24 UTC) #23
vivekg
On 2015/03/26 at 03:57:24, haraken wrote: > On 2015/03/26 03:46:50, vivekg_ wrote: > > https://codereview.chromium.org/1031783003/diff/180001/Source/bindings/core/v8/V8ObjectBuilder.h ...
5 years, 9 months ago (2015-03-26 04:01:49 UTC) #24
Jens Widell
On 2015/03/26 04:01:49, vivekg_ wrote: > On 2015/03/26 at 03:57:24, haraken wrote: > > On ...
5 years, 9 months ago (2015-03-26 09:26:30 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1031783003/200001
5 years, 9 months ago (2015-03-26 09:27:09 UTC) #28
commit-bot: I haz the power
5 years, 9 months ago (2015-03-26 12:18:01 UTC) #29
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=192599

Powered by Google App Engine
This is Rietveld 408576698