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

Issue 2260233002: [DevTools] Migrate v8_inspector/public from String16 to String{View,Buffer}. (Closed)

Created:
4 years, 4 months ago by dgozman
Modified:
4 years, 3 months ago
Reviewers:
caseq, esprehn, pfeldman
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-bindings_chromium.org, caseq+blink_chromium.org, chromium-reviews, cmumford, devtools-reviews_chromium.org, Eric Willigers, haraken, jsbell+idb_chromium.org, kozyatinskiy+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, rjwright, shans
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[DevTools] Migrate v8_inspector/public from String16 to String{View,Buffer}. Using StringView for inbound parameters and StringBuffer for outbound helps to avoid copies in important places (mostly when passing large protocol messages around). This opens possibility to: - use WTF::String in core/inspector instead of String16; - make String16 an alias to std::basic_string<uint16_t> to leverage all existing optimizations. One possible optimization is to migrate search utility (in V8StringUtil) to StringView and avoid any copies of content there. BUG=637032 Committed: https://crrev.com/101f402f95f5a67df948347edc4dce050ce482c7 Cr-Commit-Position: refs/heads/master@{#414846}

Patch Set 1 #

Patch Set 2 : better #

Total comments: 12

Patch Set 3 : using WTF::StringView #

Total comments: 10

Patch Set 4 : StringBuffer #

Patch Set 5 : better #

Total comments: 6

Patch Set 6 : small fixes #

Total comments: 28

Patch Set 7 : rebase #

Patch Set 8 : addressed comments #

Patch Set 9 : compile on win #

Total comments: 2

Patch Set 10 : styling #

Unified diffs Side-by-side diffs Delta from patch set Stats (+594 lines, -293 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/SourceLocation.cpp View 1 2 3 4 chunks +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp View 1 2 3 4 5 6 7 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp View 1 2 3 4 5 6 7 9 chunks +32 lines, -44 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorSession.cpp View 1 2 3 4 chunks +8 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/MainThreadDebugger.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp View 1 2 3 4 5 6 7 8 4 chunks +18 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/ThreadDebugger.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp View 1 2 3 4 5 6 7 8 5 chunks +22 lines, -14 lines 0 comments Download
A third_party/WebKit/Source/core/inspector/V8InspectorString.h View 1 2 3 4 5 6 7 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/inspector/V8InspectorString.cpp View 1 2 3 4 5 6 7 1 chunk +37 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/WorkerThreadDebugger.cpp View 1 2 3 4 chunks +11 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp View 1 2 3 4 chunks +7 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/blink_platform.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/inspector_protocol/DispatcherBase_cpp.template View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/inspector_protocol/DispatcherBase_h.template View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/inspector_protocol/InspectorProtocol_cpp.template View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/inspector_protocol/Parser_cpp.template View 1 2 3 4 5 6 7 8 16 chunks +79 lines, -24 lines 0 comments Download
M third_party/WebKit/Source/platform/inspector_protocol/Parser_h.template View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/inspector_protocol/String16_cpp.template View 1 2 3 4 5 1 chunk +0 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/platform/inspector_protocol/String16_h.template View 1 2 3 4 5 4 chunks +0 lines, -35 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/InspectedContext.cpp View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/String16STL.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/String16WTF.h View 1 2 3 3 chunks +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp View 1 2 3 4 5 6 7 8 4 chunks +7 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8ConsoleMessage.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8Debugger.h View 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8Debugger.cpp View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8InspectorImpl.h View 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8InspectorImpl.cpp View 3 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.h View 1 2 3 4 5 6 7 2 chunks +12 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp View 1 2 3 4 5 6 7 10 chunks +37 lines, -27 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8StackTraceImpl.h View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8StackTraceImpl.cpp View 1 2 3 4 5 4 chunks +9 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h View 1 2 3 4 5 6 7 2 chunks +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.cpp View 1 2 3 4 5 4 chunks +72 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/v8_inspector/public/StringBuffer.h View 1 2 3 4 5 6 7 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/v8_inspector/public/StringView.h View 1 2 3 4 5 6 7 8 9 1 chunk +51 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/public/V8ContextInfo.h View 1 2 3 4 5 6 7 3 chunks +14 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/public/V8Inspector.h View 4 5 6 7 2 chunks +7 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/public/V8InspectorClient.h View 1 2 3 4 5 6 7 3 chunks +7 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/public/V8InspectorSession.h View 1 2 3 4 5 6 7 2 chunks +11 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/public/V8StackTrace.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/v8_inspector/v8_inspector.gyp View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 44 (27 generated)
dgozman
Hi, Could you please take a look? Andrey - at everything. Pavel and Elliott - ...
4 years, 4 months ago (2016-08-19 18:41:45 UTC) #4
esprehn
This puts a string copy at for every toCoreString() that didn't used to be there, ...
4 years, 4 months ago (2016-08-19 18:53:13 UTC) #6
dgozman
PTAL, using WTF::StringView in converter now. https://codereview.chromium.org/2260233002/diff/20001/third_party/WebKit/Source/core/inspector/V8InspectorStringView.cpp File third_party/WebKit/Source/core/inspector/V8InspectorStringView.cpp (right): https://codereview.chromium.org/2260233002/diff/20001/third_party/WebKit/Source/core/inspector/V8InspectorStringView.cpp#newcode14 third_party/WebKit/Source/core/inspector/V8InspectorStringView.cpp:14: return v8_inspector::StringView(); On ...
4 years, 4 months ago (2016-08-19 20:50:12 UTC) #7
caseq
https://codereview.chromium.org/2260233002/diff/40001/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp (right): https://codereview.chromium.org/2260233002/diff/40001/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp#newcode42 third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp:42: static const char animationObjectGroup[] = "animation"; please move it ...
4 years, 4 months ago (2016-08-19 21:57:03 UTC) #8
dgozman
Please take another look. I've added StringBuffer to pass results with ownership. https://codereview.chromium.org/2260233002/diff/40001/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp ...
4 years, 4 months ago (2016-08-20 02:04:51 UTC) #10
caseq
https://codereview.chromium.org/2260233002/diff/100001/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h File third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h (right): https://codereview.chromium.org/2260233002/diff/100001/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h#newcode42 third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h:42: static std::unique_ptr<StringBufferImpl> create(String16&); s/create/adopt/ This way you've got a ...
4 years, 4 months ago (2016-08-22 17:53:02 UTC) #21
dgozman
PTAL https://codereview.chromium.org/2260233002/diff/100001/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h File third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h (right): https://codereview.chromium.org/2260233002/diff/100001/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h#newcode42 third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.h:42: static std::unique_ptr<StringBufferImpl> create(String16&); On 2016/08/22 17:53:02, caseq wrote: ...
4 years, 4 months ago (2016-08-22 22:35:19 UTC) #22
caseq
lgtm % pfeldman's concerns over growing complexity. I.e. I think this is correct now, but ...
4 years, 4 months ago (2016-08-22 23:46:11 UTC) #23
dgozman
@esprehn: would you like to take another look?
4 years, 4 months ago (2016-08-23 17:15:34 UTC) #24
esprehn
Maybe I just missed it, but I don't see where you did: "make String16 an ...
4 years, 4 months ago (2016-08-23 17:35:39 UTC) #25
dgozman
Elliott, please take another look. > Maybe I just missed it, but I don't see ...
4 years, 4 months ago (2016-08-24 00:45:01 UTC) #26
dgozman
@esprehn: could you please take another look?
4 years, 4 months ago (2016-08-25 01:35:30 UTC) #31
esprehn
lgtm https://codereview.chromium.org/2260233002/diff/180001/third_party/WebKit/Source/platform/v8_inspector/public/StringView.h File third_party/WebKit/Source/platform/v8_inspector/public/StringView.h (right): https://codereview.chromium.org/2260233002/diff/180001/third_party/WebKit/Source/platform/v8_inspector/public/StringView.h#newcode18 third_party/WebKit/Source/platform/v8_inspector/public/StringView.h:18: StringView() : m_is8Bit(true), m_length(0), m_characters8(nullptr) { } We ...
4 years, 3 months ago (2016-08-26 04:55:49 UTC) #36
dgozman
Thanks everyone for review! https://codereview.chromium.org/2260233002/diff/180001/third_party/WebKit/Source/platform/v8_inspector/public/StringView.h File third_party/WebKit/Source/platform/v8_inspector/public/StringView.h (right): https://codereview.chromium.org/2260233002/diff/180001/third_party/WebKit/Source/platform/v8_inspector/public/StringView.h#newcode18 third_party/WebKit/Source/platform/v8_inspector/public/StringView.h:18: StringView() : m_is8Bit(true), m_length(0), m_characters8(nullptr) ...
4 years, 3 months ago (2016-08-26 18:50:52 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2260233002/200001
4 years, 3 months ago (2016-08-26 21:01:33 UTC) #40
commit-bot: I haz the power
Committed patchset #10 (id:200001)
4 years, 3 months ago (2016-08-26 22:55:30 UTC) #42
commit-bot: I haz the power
4 years, 3 months ago (2016-08-26 22:58:57 UTC) #44
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/101f402f95f5a67df948347edc4dce050ce482c7
Cr-Commit-Position: refs/heads/master@{#414846}

Powered by Google App Engine
This is Rietveld 408576698