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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 908453003: Blink changes to record interest rects for http://w3c.github.io/frame-timing/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update LayoutTests for new properties Created 5 years, 7 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/web/WebViewImpl.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 86fef37c19c964bf42635572b5ea415a5d2723a4..290a5390684c979fb31ec961c8ec6ce091a7203e 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -86,6 +86,9 @@
#include "core/page/PointerLockController.h"
#include "core/page/ScopedPageLoadDeferrer.h"
#include "core/page/TouchDisambiguation.h"
+#include "core/paint/DeprecatedPaintLayer.h"
+#include "core/timing/DOMWindowPerformance.h"
+#include "core/timing/Performance.h"
#include "modules/accessibility/AXObject.h"
#include "modules/accessibility/AXObjectCacheImpl.h"
#include "modules/credentialmanager/CredentialManagerClient.h"
@@ -126,6 +129,7 @@
#include "public/web/WebAutofillClient.h"
#include "public/web/WebBeginFrameArgs.h"
#include "public/web/WebElement.h"
+#include "public/web/WebFrame.h"
#include "public/web/WebFrameClient.h"
#include "public/web/WebHitTestResult.h"
#include "public/web/WebInputElement.h"
@@ -4357,6 +4361,27 @@ void WebViewImpl::applyViewportDeltas(
DoubleSize(outerViewportDelta.width, outerViewportDelta.height), /* programmaticScroll */ false);
}
+void WebViewImpl::recordFrameTimingEvent(FrameTimingEventType eventType, int64_t FrameId, const WebVector<WebFrameTimingEvent>& events)
+{
+ Frame* frame = m_page ? m_page->mainFrame() : 0;
+
+ while (frame && frame->frameID() != FrameId) {
+ frame = frame->tree().traverseNext();
+ }
+
+ if (!frame || !frame->domWindow() || !frame->domWindow()->document())
+ return; // Can't find frame, it may have been cleaned up from the DOM.
+
+ blink::DOMWindow* domWindow = frame->domWindow();
+ blink::Performance* performance = DOMWindowPerformance::performance(*domWindow);
+ for (size_t i = 0; i < events.size(); ++i) {
+ if (eventType == CompositeEvent)
+ performance->addCompositeTiming(domWindow->document(), events[i].sourceFrame, events[i].startTime);
+ else if (eventType == RenderEvent)
+ performance->addRenderTiming(domWindow->document(), events[i].sourceFrame, events[i].startTime, events[i].finishTime);
+ }
+}
+
void WebViewImpl::updateLayerTreeViewport()
{
if (!page() || !m_layerTreeView)
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698