Index: third_party/WebKit/Source/platform/heap/Heap.cpp |
diff --git a/third_party/WebKit/Source/platform/heap/Heap.cpp b/third_party/WebKit/Source/platform/heap/Heap.cpp |
index 0dc2f08ce9bda691f1909f4c577d5ea738496b5f..d1d40cecd69a74a6b92aa011b29b09f28e4ea7be 100644 |
--- a/third_party/WebKit/Source/platform/heap/Heap.cpp |
+++ b/third_party/WebKit/Source/platform/heap/Heap.cpp |
@@ -396,9 +396,7 @@ void Heap::collectGarbage(BlinkGC::StackState stackState, BlinkGC::GCType gcType |
// Resume all parked threads upon leaving this scope. |
ResumeThreadScope resumeThreads(gcType); |
- |
- if (state->isMainThread()) |
- ScriptForbiddenScope::enter(); |
+ ScriptForbiddenIfMainThreadScope scriptForbidden; |
TRACE_EVENT2("blink_gc", "Heap::collectGarbage", |
"lazySweeping", gcType == BlinkGC::GCWithoutSweep, |
@@ -461,9 +459,6 @@ void Heap::collectGarbage(BlinkGC::StackState stackState, BlinkGC::GCType gcType |
s_gcGeneration = 1; |
} |
#endif |
- |
- if (state->isMainThread()) |
- ScriptForbiddenScope::exit(); |
} |
void Heap::collectGarbageForTerminatingThread(ThreadState* state) |