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

Issue 1020233002: [bindings] [devtools] Migrate the usage of ScriptValue.toJSONValue() to ScriptValue::to<JSONValuePt… (Closed)

Created:
5 years, 9 months ago by vivekg_samsung
Modified:
5 years, 9 months ago
Reviewers:
haraken, vivekg, yurys
CC:
aandrey+blink_chromium.org, apavlov+blink_chromium.org, arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, caseq+blink_chromium.org, cmumford, devtools-reviews_chromium.org, dgrogan, eustas+blink_chromium.org, jsbell+idb_chromium.org, kozyatinskiy+blink_chromium.org, loislo+blink_chromium.org, lushnikov+blink_chromium.org, malch+blink_chromium.org, pfeldman+blink_chromium.org, sergeyv+blink_chromium.org, vivekg_samsung, yurys+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

[bindings] [devtools] Migrate the usage of ScriptValue.toJSONValue() to ScriptValue::to<JSONValuePtr>() Now that the CL [1] added method, ScriptValue::to<T>, supports conversion of values using the NativeValueTraits<T>, we should replace the usages of toJSONValue with the above API. R=haraken@chromium.org, yurys@chromium.org [1] https://codereview.chromium.org/1009503003 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192499

Patch Set 1 #

Total comments: 4

Patch Set 2 : Review comments addressed! #

Total comments: 2

Patch Set 3 : Patch for landing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -24 lines) Patch
M Source/bindings/core/v8/ScriptDebugServer.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M Source/bindings/core/v8/ScriptValue.h View 2 chunks +7 lines, -2 lines 0 comments Download
M Source/bindings/core/v8/ScriptValue.cpp View 1 chunk +0 lines, -7 lines 0 comments Download
M Source/bindings/core/v8/V8Binding.h View 1 3 chunks +7 lines, -2 lines 0 comments Download
M Source/bindings/core/v8/V8Binding.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InjectedScript.cpp View 1 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/inspector/InjectedScriptBase.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InjectedScriptBase.cpp View 1 2 3 chunks +11 lines, -1 line 0 comments Download
M Source/modules/indexeddb/InspectorIndexedDBAgent.cpp View 1 chunk +6 lines, -3 lines 0 comments Download

Messages

Total messages: 17 (3 generated)
vivekg
This is a WIP patch. haraken@: I tried removing the ScriptState::Scope creation but that results ...
5 years, 9 months ago (2015-03-20 15:12:39 UTC) #2
vivekg
ping!
5 years, 9 months ago (2015-03-24 04:46:11 UTC) #3
haraken
What's the crash trace?
5 years, 9 months ago (2015-03-24 04:57:29 UTC) #4
vivekg
https://codereview.chromium.org/1020233002/diff/1/Source/core/inspector/InjectedScriptBase.cpp File Source/core/inspector/InjectedScriptBase.cpp (right): https://codereview.chromium.org/1020233002/diff/1/Source/core/inspector/InjectedScriptBase.cpp#newcode51 Source/core/inspector/InjectedScriptBase.cpp:51: ScriptState::Scope scope(scriptState); When I remove above scope, we get ...
5 years, 9 months ago (2015-03-24 05:21:49 UTC) #5
vivekg
On 2015/03/24 at 05:21:49, vivekg_ wrote: > https://codereview.chromium.org/1020233002/diff/1/Source/core/inspector/InjectedScriptBase.cpp > File Source/core/inspector/InjectedScriptBase.cpp (right): > > https://codereview.chromium.org/1020233002/diff/1/Source/core/inspector/InjectedScriptBase.cpp#newcode51 ...
5 years, 9 months ago (2015-03-24 15:07:33 UTC) #6
haraken
https://codereview.chromium.org/1020233002/diff/1/Source/core/inspector/InjectedScript.cpp File Source/core/inspector/InjectedScript.cpp (right): https://codereview.chromium.org/1020233002/diff/1/Source/core/inspector/InjectedScript.cpp#newcode283 Source/core/inspector/InjectedScript.cpp:283: RefPtr<JSONValue> result = toJSONValue(scriptState(), callFramesValue); I think we are ...
5 years, 9 months ago (2015-03-24 15:23:10 UTC) #7
vivekg
On 2015/03/24 at 15:23:10, haraken wrote: > https://codereview.chromium.org/1020233002/diff/1/Source/core/inspector/InjectedScript.cpp > File Source/core/inspector/InjectedScript.cpp (right): > > https://codereview.chromium.org/1020233002/diff/1/Source/core/inspector/InjectedScript.cpp#newcode283 ...
5 years, 9 months ago (2015-03-25 04:20:35 UTC) #8
haraken
LGTM https://codereview.chromium.org/1020233002/diff/20001/Source/core/inspector/InjectedScriptBase.cpp File Source/core/inspector/InjectedScriptBase.cpp (right): https://codereview.chromium.org/1020233002/diff/20001/Source/core/inspector/InjectedScriptBase.cpp#newcode54 Source/core/inspector/InjectedScriptBase.cpp:54: return ScriptValue::to<JSONValuePtr>(scriptState->isolate(), value, exceptionState); Nit: As far as ...
5 years, 9 months ago (2015-03-25 04:39:16 UTC) #9
vivekg
On 2015/03/25 at 04:39:16, haraken wrote: > LGTM > Thank you. > https://codereview.chromium.org/1020233002/diff/20001/Source/core/inspector/InjectedScriptBase.cpp > File ...
5 years, 9 months ago (2015-03-25 04:49:59 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1020233002/40001
5 years, 9 months ago (2015-03-25 05:55:28 UTC) #13
vivekg
On 2015/03/25 at 04:39:16, haraken wrote: > > https://codereview.chromium.org/1020233002/diff/20001/Source/core/inspector/InjectedScriptBase.cpp#newcode54 > Source/core/inspector/InjectedScriptBase.cpp:54: return ScriptValue::to<JSONValuePtr>(scriptState->isolate(), value, exceptionState); ...
5 years, 9 months ago (2015-03-25 06:11:00 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://src.chromium.org/viewvc/blink?view=rev&revision=192499
5 years, 9 months ago (2015-03-25 06:25:00 UTC) #15
haraken
On 2015/03/25 06:11:00, vivekg_ wrote: > On 2015/03/25 at 04:39:16, haraken wrote: > > > ...
5 years, 9 months ago (2015-03-25 12:20:45 UTC) #16
vivekg
5 years, 9 months ago (2015-03-25 12:37:38 UTC) #17
Message was sent while issue was closed.
On 2015/03/25 at 12:20:45, haraken wrote:
> On 2015/03/25 06:11:00, vivekg_ wrote:
> > On 2015/03/25 at 04:39:16, haraken wrote:
> > > 
> > >
> >
https://codereview.chromium.org/1020233002/diff/20001/Source/core/inspector/I...
> > > Source/core/inspector/InjectedScriptBase.cpp:54: return
> > ScriptValue::to<JSONValuePtr>(scriptState->isolate(), value,
exceptionState);
> > > 
> > > Nit: As far as I see V8Binding.h, toScriptValue (not ScriptValue::to)
might be
> > more consistent with other conversion methods. It seems bindings use
Value::from
> > and toValue.
> > > 
> > 
> > Actually the method ScriptValue::to is returning the T so calling it
> > toScriptValue would not be appropriate.
> > I moved it to be a static method of ScriptValue so as the call site can read
it
> > like "ScriptValue::to<T>(...)" in literal terms. :) 
> > Have you got any better naming here?
> 
> Your point sounds reasonable :)

hehe, thank you. So we will retain it as is.

Powered by Google App Engine
This is Rietveld 408576698