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

Unified Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 1119683003: Implement requestIdleCallback API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 4 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 | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/frame/RemoteDOMWindow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index 0ffefbc9f3026c909f369bca438422e598acdad5..a88f7d8a69bca1ab291495d357f2affb44ad78ef 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -1264,23 +1264,36 @@ void LocalDOMWindow::resizeTo(int width, int height) const
int LocalDOMWindow::requestAnimationFrame(FrameRequestCallback* callback)
{
callback->m_useLegacyTimeBase = false;
- if (Document* d = document())
- return d->requestAnimationFrame(callback);
+ if (Document* doc = document())
+ return doc->requestAnimationFrame(callback);
return 0;
}
int LocalDOMWindow::webkitRequestAnimationFrame(FrameRequestCallback* callback)
{
callback->m_useLegacyTimeBase = true;
- if (Document* d = document())
- return d->requestAnimationFrame(callback);
+ if (Document* document = this->document())
+ return document->requestAnimationFrame(callback);
return 0;
}
void LocalDOMWindow::cancelAnimationFrame(int id)
{
- if (Document* d = document())
- d->cancelAnimationFrame(id);
+ if (Document* document = this->document())
+ document->cancelAnimationFrame(id);
+}
+
+int LocalDOMWindow::requestIdleCallback(IdleRequestCallback* callback, double timeoutMillis)
+{
+ if (Document* document = this->document())
+ return document->requestIdleCallback(callback, timeoutMillis);
+ return 0;
+}
+
+void LocalDOMWindow::cancelIdleCallback(int id)
+{
+ if (Document* document = this->document())
+ document->cancelIdleCallback(id);
}
bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> prpListener, bool useCapture)
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/frame/RemoteDOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698