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

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: create/check wrapper on creationContext 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 f9e810b7c49f4b004153d3ce468b08482ceb3304..45201669d84f042285e71bd3f9444fdb084ba283 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -207,6 +207,7 @@ Internals::Internals(Document* document)
: ContextLifecycleObserver(document)
, m_runtimeFlags(InternalRuntimeFlags::create())
, m_scrollingCoordinator(document->page() ? document->page()->scrollingCoordinator() : 0)
+ , m_gcWithoutContextTimer(this, &Internals::garbageCollectV8WithoutContextTimerFired)
{
}
@@ -2240,4 +2241,16 @@ bool Internals::loseSharedGraphicsContext3D()
return true;
}
+void Internals::garbageCollectV8WithoutContext()
haraken 2013/10/29 01:14:53 garbageCollectV8WithoutContext => collectGarbageWi
+{
+ m_gcWithoutContextTimer.startOneShot(0);
haraken 2013/10/29 01:14:53 Why do you need a timer?
+}
+
+void Internals::garbageCollectV8WithoutContextTimerFired(Timer<Internals>*)
+{
+ const int largeEnoughValueToTriggerMajorGC = 10000;
+ for (int i = 0; i < 100; ++i)
+ v8::V8::IdleNotification(largeEnoughValueToTriggerMajorGC);
haraken 2013/10/29 01:14:53 This is not a reliable way to trigger GC. Instead
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698