Index: Source/core/testing/Internals.cpp |
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp |
index 9bf0518789a7975968df1f5739340519ecfbf542..e8d630783453996f22c3049ff7415a52d448df75 100644 |
--- a/Source/core/testing/Internals.cpp |
+++ b/Source/core/testing/Internals.cpp |
@@ -210,6 +210,7 @@ Internals::Internals(Document* document) |
: ContextLifecycleObserver(document) |
, m_runtimeFlags(InternalRuntimeFlags::create()) |
, m_scrollingCoordinator(document->page() ? document->page()->scrollingCoordinator() : 0) |
+ , m_gcWithoutContextTimer(this, &Internals::garbageCollectV8WithoutContextTimerFired) |
{ |
} |
@@ -2279,4 +2280,16 @@ bool Internals::loseSharedGraphicsContext3D() |
return true; |
} |
+void Internals::garbageCollectV8WithoutContext() |
+{ |
+ m_gcWithoutContextTimer.startOneShot(0); |
+} |
+ |
+void Internals::garbageCollectV8WithoutContextTimerFired(Timer<Internals>*) |
+{ |
+ const int largeEnoughValueToTriggerMajorGC = 10000; |
+ for (int i = 0; i < 100; ++i) |
+ v8::V8::IdleNotification(largeEnoughValueToTriggerMajorGC); |
haraken
2013/10/25 08:54:12
This looks fragile. Probably you can use V8GCContr
|
+} |
+ |
} |