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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h

Issue 2567463003: [wrapper-tracing] Fix write barrier in copy ctor (Closed)
Patch Set: Fix swap for TraceWrapperMember Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h b/third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h
index 39b25602ae48d5ab737c80c0c0996c2dc412209b..660f519ec316dd4b30305c503dfd0c28af7381d2 100644
--- a/third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h
+++ b/third_party/WebKit/Source/bindings/core/v8/TraceWrapperMember.h
@@ -39,8 +39,7 @@ class TraceWrapperMember : public Member<T> {
*/
TraceWrapperMember(const TraceWrapperMember& other) { *this = other; }
- template <typename U>
- TraceWrapperMember& operator=(const TraceWrapperMember<U>& other) {
+ TraceWrapperMember& operator=(const TraceWrapperMember& other) {
DCHECK(other.m_parent);
m_parent = other.m_parent;
Member<T>::operator=(other);
@@ -48,16 +47,14 @@ class TraceWrapperMember : public Member<T> {
return *this;
}
- template <typename U>
- TraceWrapperMember& operator=(const Member<U>& other) {
+ TraceWrapperMember& operator=(const Member<T>& other) {
DCHECK(!traceWrapperMemberIsNotInitialized());
Member<T>::operator=(other);
ScriptWrappableVisitor::writeBarrier(m_parent, other);
return *this;
}
- template <typename U>
- TraceWrapperMember& operator=(U* other) {
+ TraceWrapperMember& operator=(T* other) {
DCHECK(!traceWrapperMemberIsNotInitialized());
Member<T>::operator=(other);
ScriptWrappableVisitor::writeBarrier(m_parent, other);
@@ -121,7 +118,7 @@ void swap(HeapVector<TraceWrapperMember<T>>& a,
HeapVector<TraceWrapperMember<T>> temp;
temp.reserveCapacity(a.size());
for (auto item : a) {
- temp.push_back(TraceWrapperMember<T>(nullptr, item.get()));
+ temp.push_back(TraceWrapperMember<T>(item.parent(), item.get()));
}
a.clear();
a.reserveCapacity(b.size());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698