Index: Source/core/frame/LocalDOMWindow.cpp |
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp |
index 0ffefbc9f3026c909f369bca438422e598acdad5..e17eb4d4e1d99835b3e34f5e01637eb1884d085a 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* doc = document()) |
+ return doc->requestAnimationFrame(callback); |
return 0; |
} |
void LocalDOMWindow::cancelAnimationFrame(int id) |
{ |
- if (Document* d = document()) |
- d->cancelAnimationFrame(id); |
+ if (Document* doc = document()) |
+ doc->cancelAnimationFrame(id); |
+} |
+ |
+int LocalDOMWindow::requestIdleCallback(IdleRequestCallback* callback, double timeoutMillis) |
+{ |
+ if (Document* doc = document()) |
esprehn
2015/08/21 08:22:21
you can actually use the variable name document, y
rmcilroy
2015/08/21 11:21:52
Ahh of course, thanks. Done.
|
+ return doc->requestIdleCallback(callback, timeoutMillis); |
+ return 0; |
+} |
+ |
+void LocalDOMWindow::cancelIdleCallback(int id) |
+{ |
+ if (Document* doc = document()) |
+ doc->cancelIdleCallback(id); |
} |
bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> prpListener, bool useCapture) |