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

Unified Diff: third_party/WebKit/Source/platform/heap/Heap.cpp

Issue 1502093002: Improve ScriptForbiddenScope handling in cross-threaded code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary include Created 5 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
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 fd2b765e5fb3dccf9ab3f7b998422668810d292d..39e97da142fd36bf68952100002d9a9fb418c703 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.cpp
+++ b/third_party/WebKit/Source/platform/heap/Heap.cpp
@@ -397,9 +397,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,
@@ -462,9 +460,6 @@ void Heap::collectGarbage(BlinkGC::StackState stackState, BlinkGC::GCType gcType
s_gcGeneration = 1;
}
#endif
-
- if (state->isMainThread())
- ScriptForbiddenScope::exit();
}
void Heap::collectGarbageForTerminatingThread(ThreadState* state)

Powered by Google App Engine
This is Rietveld 408576698