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

Issue 2142373002: Make v8AtomicString take a StringView. (Closed)

Created:
4 years, 5 months ago by esprehn
Modified:
4 years, 5 months ago
Reviewers:
haraken, jbroman
CC:
blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make v8AtomicString take a StringView. By accepting a StringView v8AtomicString, which is used for property access all over the engine, can have the length of the input literal strings be computed at compile time. For example v8AtomicString(isolate, "foo") will now compile the length of 3 into the binary directly. This patch also makes v8AtomicString take 8/16 bit strings like all of the other string handling functions and moves the utf8 logic into a new function v8StringFromUtf8. This makes the code more clear since blink rarely ever uses utf8 strings, and should also be faster since v8 strings are either latin1 or utf16 just like blink, so calling the utf8 methods for property access was going through a bunch of logic on the string that wasn't needed. The two callers that actually expect utf8 inputs have been changed, and one caller in WindowProxy::setSecurityToken was switched to not using utf8 since it wasn't actually needed as it was going from a blink String to utf8 and then back into a v8::String which is the same representation as the blink string. BUG=615174 Committed: https://crrev.com/a348d19c81ac29626a38a47a683856f22102bb42 Cr-Commit-Position: refs/heads/master@{#405011}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Woops, pass the length. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -13 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8Binding.h View 1 2 chunks +12 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 17 (9 generated)
esprehn
https://codereview.chromium.org/2142373002/diff/1/third_party/WebKit/Source/bindings/core/v8/V8Binding.h File third_party/WebKit/Source/bindings/core/v8/V8Binding.h (left): https://codereview.chromium.org/2142373002/diff/1/third_party/WebKit/Source/bindings/core/v8/V8Binding.h#oldcode428 third_party/WebKit/Source/bindings/core/v8/V8Binding.h:428: if (LIKELY(v8::String::NewFromUtf8(isolate, str, v8::NewStringType::kInternalized, length).ToLocal(&value))) v8CallOrCrash is a call ...
4 years, 5 months ago (2016-07-13 00:48:54 UTC) #3
haraken
LGTM with a comment. https://codereview.chromium.org/2142373002/diff/1/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp File third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp (right): https://codereview.chromium.org/2142373002/diff/1/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp#newcode195 third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp:195: v8::Local<v8::String> jsonString = v8StringFromUtf8(scriptState->isolate(), utf8Data, ...
4 years, 5 months ago (2016-07-13 01:12:50 UTC) #5
esprehn
https://codereview.chromium.org/2142373002/diff/1/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp File third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp (right): https://codereview.chromium.org/2142373002/diff/1/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp#newcode195 third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp:195: v8::Local<v8::String> jsonString = v8StringFromUtf8(scriptState->isolate(), utf8Data, length); On 2016/07/13 at ...
4 years, 5 months ago (2016-07-13 01:50:30 UTC) #6
haraken
On 2016/07/13 01:50:30, esprehn wrote: > https://codereview.chromium.org/2142373002/diff/1/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp > File third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp (right): > > https://codereview.chromium.org/2142373002/diff/1/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp#newcode195 > ...
4 years, 5 months ago (2016-07-13 01:56:50 UTC) #8
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/2142373002/20001
4 years, 5 months ago (2016-07-13 02:24:28 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 5 months ago (2016-07-13 04:19:00 UTC) #14
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-13 04:19:04 UTC) #15
commit-bot: I haz the power
4 years, 5 months ago (2016-07-13 04:21:06 UTC) #17
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/a348d19c81ac29626a38a47a683856f22102bb42
Cr-Commit-Position: refs/heads/master@{#405011}

Powered by Google App Engine
This is Rietveld 408576698