Commit 9281d2eb authored by Timothy Loh's avatar Timothy Loh Committed by Commit Bot

Revert "v8binding: Stops using the copyable ver of v8::Persistent."

This reverts commit d4dd5c37.

Reason for revert: Causes 40+ layout tests to leak, e.g. https://ci.chromium.org/buildbot/chromium.webkit/WebKit%20Linux%20Trusty%20Leak/12726

Original change's description:
> v8binding: Stops using the copyable ver of v8::Persistent.
> 
> I learnt that v8::Persistent provides two variations of copying.
> One actually copies, and the other actually shares the underlying
> slot.
> 
> This patch changes CallbackFunctionBase::Persistent from the
> "share" version to the "copy" (= make another independent slot)
> version.
> 
> Bug: 779036
> Change-Id: I1fae7a1547af2abefa932458f398d8e2b50ecaa3
> Reviewed-on: https://chromium-review.googlesource.com/798820
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Hitoshi Yoshida <peria@chromium.org>
> Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#520528}

TBR=peria@chromium.org,yukishiino@chromium.org,haraken@chromium.org

Change-Id: I15cccba7606269da57e4b3c48d8e9bfa3b1c103c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 779036
Reviewed-on: https://chromium-review.googlesource.com/802715Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Commit-Queue: Timothy Loh <timloh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520844}
parent 4a7469f7
......@@ -75,24 +75,11 @@ class CallbackFunctionBase::Persistent
if (raw)
function_.Reset(raw->GetIsolate(), raw->callback_function_.Get());
}
Persistent(const Persistent& other) : Parent(other) {
if (other)
function_.Reset(other->GetIsolate(), other.function_);
}
Persistent(const Persistent& other)
: Parent(other), function_(other.function_) {}
~Persistent() = default;
Persistent& operator=(const Persistent& other) {
if (this == &other)
return *this;
if (other) {
Parent::operator=(other);
function_.Reset(other->GetIsolate(), other.function_);
} else {
Clear();
}
return *this;
}
Persistent& operator=(const Persistent& other) = default;
void Clear() {
Parent::Clear();
......@@ -100,7 +87,8 @@ class CallbackFunctionBase::Persistent
}
private:
v8::Persistent<v8::Function> function_;
v8::Persistent<v8::Function, v8::CopyablePersistentTraits<v8::Function>>
function_;
};
template <typename T>
......
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