Commit 6f8d5c83 authored by Albert J. Wong's avatar Albert J. Wong Committed by Commit Bot

Refactor ToBlinkStringView() to be faster.

The last implementation accidentally caused an AtomicString to be
created even if externalization was not possible. The new code only
generates an AtomicString when externalization can happen.

This is broken out of
  https://chromium-review.googlesource.com/c/chromium/src/+/2204539

which in turn is broken out of
  https://chromium-review.googlesource.com/c/chromium/src/+/1557854

Bug: 1083392
Change-Id: I091872fcd0f8cf26d6d6e1a0fac4a3e115f7543b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2268584Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Albert J. Wong <ajwong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784499}
parent 0a975ef8
......@@ -254,6 +254,13 @@ PLATFORM_EXPORT StringView ToBlinkStringView(v8::Local<v8::String>,
PLATFORM_EXPORT String ToBlinkString(int value);
// The returned StringView is guaranteed to be valid as long as `backing_store`
// and `v8_string` are alive.
PLATFORM_EXPORT StringView
ToBlinkStringView(v8::Local<v8::String> v8_string,
StringView::StackBackingStore& backing_store,
ExternalMode external);
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_STRING_RESOURCE_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment