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

Unified Diff: third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp

Issue 1995733003: Forbid Oilpan GC in blink::testing::runPendingTasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « 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/platform/testing/UnitTestHelpers.cpp
diff --git a/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp b/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
index 4c4909b3c16c89b6ba6ec61e9ba12b2b6f8162be..d66bc310ce619cf0584c7e5c09bac75319970434 100644
--- a/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
+++ b/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
@@ -31,6 +31,7 @@
#include "base/path_service.h"
#include "platform/SharedBuffer.h"
#include "platform/Timer.h"
+#include "platform/heap/Handle.h"
#include "public/platform/FilePathConversion.h"
#include "public/platform/Platform.h"
#include "public/platform/WebString.h"
@@ -45,7 +46,12 @@ namespace testing {
void runPendingTasks()
{
Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, bind(&exitRunLoop));
+
+ // We forbid GC in the tasks. Otherwise the registered GCTaskObserver tries
+ // to run GC with NoHeapPointerOnStack.
+ ThreadState::current()->enterGCForbiddenScope();
enterRunLoop();
+ ThreadState::current()->leaveGCForbiddenScope();
}
void runDelayedTasks(double delayMs)
« 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