diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-03-15 23:00:44 +0100 |
---|---|---|
committer | Refael Ackermann <refack@gmail.com> | 2019-03-28 16:38:12 -0400 |
commit | 8181811d733174d77c74e2896281889d2fecc63c (patch) | |
tree | a082db4811f2887426196ab981f5ccf5e9d68010 /deps/v8/src/api.cc | |
parent | 1f03fb4d492ea6ba1e6f7f50f68257d7c49817b8 (diff) | |
download | android-node-v8-8181811d733174d77c74e2896281889d2fecc63c.tar.gz android-node-v8-8181811d733174d77c74e2896281889d2fecc63c.tar.bz2 android-node-v8-8181811d733174d77c74e2896281889d2fecc63c.zip |
deps: V8: cherry-pick d82c9af
Original commit message:
[api] Add unique_ptr constructor for StreamedSource
Since StreamedSource takes ownership of the ExternalSourceStream
passed into it, it should take it by unique_ptr rather than raw
pointer to signal this transfer of ownership. The old constructor
is now deprecated.
Change-Id: I24681926c2f3141f7dd3664f72019a4c6deabfd7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1520713
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60232}
Refs: https://github.com/v8/v8/commit/d82c9afb8c79255efd8ef65257b14bcf9c64a9c2
PR-URL: https://github.com/nodejs/node/pull/26685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'deps/v8/src/api.cc')
-rw-r--r-- | deps/v8/src/api.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index 6742907a70..360bb78407 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -2071,7 +2071,11 @@ void ScriptCompiler::ExternalSourceStream::ResetToBookmark() { UNREACHABLE(); } ScriptCompiler::StreamedSource::StreamedSource(ExternalSourceStream* stream, Encoding encoding) - : impl_(new i::ScriptStreamingData(stream, encoding)) {} + : StreamedSource(std::unique_ptr<ExternalSourceStream>(stream), encoding) {} + +ScriptCompiler::StreamedSource::StreamedSource( + std::unique_ptr<ExternalSourceStream> stream, Encoding encoding) + : impl_(new i::ScriptStreamingData(std::move(stream), encoding)) {} ScriptCompiler::StreamedSource::~StreamedSource() = default; |