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

Unified Diff: third_party/WebKit/Source/platform/heap/WrapperVisitor.h

Issue 2609383002: [wrapper-tracing] Simplify tracing and reduce technical debt (Closed)
Patch Set: Rebase on master after landing dep Created 3 years, 11 months 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 | « third_party/WebKit/Source/platform/heap/TraceTraits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/WrapperVisitor.h
diff --git a/third_party/WebKit/Source/platform/heap/WrapperVisitor.h b/third_party/WebKit/Source/platform/heap/WrapperVisitor.h
index bd63dc073f2429efd81af61b96bc649acacb1d39..d93767aca69d03f9d53768f55f08a4cf38ba9a85 100644
--- a/third_party/WebKit/Source/platform/heap/WrapperVisitor.h
+++ b/third_party/WebKit/Source/platform/heap/WrapperVisitor.h
@@ -105,10 +105,7 @@ class PLATFORM_EXPORT WrapperVisitor {
return;
}
- if (pushToMarkingDeque(TraceTrait<T>::traceMarkedWrapper,
- TraceTrait<T>::heapObjectHeader, traceable)) {
- TraceTrait<T>::markWrapperNoTracing(this, traceable);
- }
+ markAndPushToMarkingDeque(traceable);
}
/**
@@ -164,6 +161,15 @@ class PLATFORM_EXPORT WrapperVisitor {
// don't require marking wrappers in all worlds, so just nop on those.
}
+ template <typename T>
+ void markAndPushToMarkingDeque(const T* traceable) const {
+ if (pushToMarkingDeque(TraceTrait<T>::traceMarkedWrapper,
+ TraceTrait<T>::heapObjectHeader, traceable)) {
+ TraceTrait<T>::markWrapperNoTracing(this, traceable);
+ }
+ }
+
+ protected:
// Returns true if pushing to the marking deque was successful.
virtual bool pushToMarkingDeque(
void (*traceWrappersCallback)(const WrapperVisitor*, const void*),
« no previous file with comments | « third_party/WebKit/Source/platform/heap/TraceTraits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698