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

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

Issue 1502093002: Improve ScriptForbiddenScope handling in cross-threaded code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased up past r363426 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/HeapPage.cpp
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.cpp b/third_party/WebKit/Source/platform/heap/HeapPage.cpp
index 136413569200bb7bcb158e12db2e3063881a04cb..40fe3cfdaedfa69b43b52e586abb9ded97bfac19 100644
--- a/third_party/WebKit/Source/platform/heap/HeapPage.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.cpp
@@ -298,17 +298,11 @@ Address BaseHeap::lazySweep(size_t allocationSize, size_t gcInfoIndex)
return nullptr;
TRACE_EVENT0("blink_gc", "BaseHeap::lazySweepPages");
- ThreadState::SweepForbiddenScope scope(threadState());
- double startTime = WTF::currentTimeMS();
-
- if (threadState()->isMainThread())
- ScriptForbiddenScope::enter();
+ ThreadState::SweepForbiddenScope sweepForbidden(threadState());
+ ScriptForbiddenIfMainThreadScope scriptForbidden;
+ double startTime = WTF::currentTimeMS();
Address result = lazySweepPages(allocationSize, gcInfoIndex);
-
- if (threadState()->isMainThread())
- ScriptForbiddenScope::exit();
-
threadState()->accumulateSweepingTime(WTF::currentTimeMS() - startTime);
Heap::reportMemoryUsageForTracing();
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.cpp ('k') | third_party/WebKit/Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698