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

Unified Diff: Source/core/testing/Internals.cpp

Issue 26792002: Reland: Reland: Implement new Blink IDL attribute [SetReference] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years, 2 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
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
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698