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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1897123002: Remove current implementation of frame timing events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 4364 matching lines...) Expand 10 before | Expand all | Expand 10 after
4375 DoublePoint layoutViewportPosition = layoutViewport->scrollPositionDouble() 4375 DoublePoint layoutViewportPosition = layoutViewport->scrollPositionDouble()
4376 + DoubleSize(layoutViewportDelta.width, layoutViewportDelta.height); 4376 + DoubleSize(layoutViewportDelta.width, layoutViewportDelta.height);
4377 4377
4378 if (layoutViewport->scrollPositionDouble() != layoutViewportPosition) { 4378 if (layoutViewport->scrollPositionDouble() != layoutViewportPosition) {
4379 layoutViewport->setScrollPosition(layoutViewportPosition, CompositorScro ll); 4379 layoutViewport->setScrollPosition(layoutViewportPosition, CompositorScro ll);
4380 if (DocumentLoader* documentLoader = mainFrameImpl()->frame()->loader(). documentLoader()) 4380 if (DocumentLoader* documentLoader = mainFrameImpl()->frame()->loader(). documentLoader())
4381 documentLoader->initialScrollState().wasScrolledByUser = true; 4381 documentLoader->initialScrollState().wasScrolledByUser = true;
4382 } 4382 }
4383 } 4383 }
4384 4384
4385 void WebViewImpl::recordFrameTimingEvent(FrameTimingEventType eventType, int64_t FrameId, const WebVector<WebFrameTimingEvent>& events)
4386 {
4387 Frame* frame = m_page ? m_page->mainFrame() : 0;
4388
4389 while (frame && frame->frameID() != FrameId) {
4390 frame = frame->tree().traverseNext();
4391 }
4392
4393 if (!frame || !frame->domWindow() || !frame->domWindow()->document())
4394 return; // Can't find frame, it may have been cleaned up from the DOM.
4395
4396 blink::DOMWindow* domWindow = frame->domWindow();
4397 blink::Performance* performance = DOMWindowPerformance::performance(*domWind ow);
4398 for (size_t i = 0; i < events.size(); ++i) {
4399 if (eventType == CompositeEvent)
4400 performance->addCompositeTiming(domWindow->document(), events[i].sou rceFrame, events[i].startTime);
4401 else if (eventType == RenderEvent)
4402 performance->addRenderTiming(domWindow->document(), events[i].source Frame, events[i].startTime, events[i].finishTime);
4403 }
4404 }
4405
4406 void WebViewImpl::updateLayerTreeViewport() 4385 void WebViewImpl::updateLayerTreeViewport()
4407 { 4386 {
4408 if (!page() || !m_layerTreeView) 4387 if (!page() || !m_layerTreeView)
4409 return; 4388 return;
4410 4389
4411 m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), minimumPageS caleFactor(), maximumPageScaleFactor()); 4390 m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), minimumPageS caleFactor(), maximumPageScaleFactor());
4412 } 4391 }
4413 4392
4414 void WebViewImpl::updateLayerTreeBackgroundColor() 4393 void WebViewImpl::updateLayerTreeBackgroundColor()
4415 { 4394 {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
4590 { 4569 {
4591 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4570 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4592 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4571 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4593 if (!page()) 4572 if (!page())
4594 return 1; 4573 return 1;
4595 4574
4596 return page()->deviceScaleFactor(); 4575 return page()->deviceScaleFactor();
4597 } 4576 }
4598 4577
4599 } // namespace blink 4578 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698