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

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

Issue 2631853002: Give OOPIF FrameViews their own scroll animation timelines and hosts (Closed)
Patch Set: Fixes from bokan comments Created 3 years, 11 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } else { 388 } else {
389 TRACE_EVENT0("blink", 389 TRACE_EVENT0("blink",
390 "WebPagePopupImpl::setIsAcceleratedCompositingActive(true)"); 390 "WebPagePopupImpl::setIsAcceleratedCompositingActive(true)");
391 391
392 m_layerTreeView = m_widgetClient->initializeLayerTreeView(); 392 m_layerTreeView = m_widgetClient->initializeLayerTreeView();
393 if (m_layerTreeView) { 393 if (m_layerTreeView) {
394 m_layerTreeView->setVisible(true); 394 m_layerTreeView->setVisible(true);
395 m_isAcceleratedCompositingActive = true; 395 m_isAcceleratedCompositingActive = true;
396 m_animationHost = WTF::makeUnique<CompositorAnimationHost>( 396 m_animationHost = WTF::makeUnique<CompositorAnimationHost>(
397 m_layerTreeView->compositorAnimationHost()); 397 m_layerTreeView->compositorAnimationHost());
398 m_page->layerTreeViewInitialized(*m_layerTreeView); 398 m_page->layerTreeViewInitialized(*m_layerTreeView,
399 m_popupClient->ownerElement()
400 .document()
401 .frame()
402 ->localFrameRoot()
403 ->view());
399 } else { 404 } else {
400 m_isAcceleratedCompositingActive = false; 405 m_isAcceleratedCompositingActive = false;
401 m_animationHost = nullptr; 406 m_animationHost = nullptr;
402 } 407 }
403 } 408 }
404 } 409 }
405 410
406 void WebPagePopupImpl::beginFrame(double lastFrameTimeMonotonic) { 411 void WebPagePopupImpl::beginFrame(double lastFrameTimeMonotonic) {
407 if (!m_page) 412 if (!m_page)
408 return; 413 return;
409 // FIXME: This should use lastFrameTimeMonotonic but doing so 414 // FIXME: This should use lastFrameTimeMonotonic but doing so
410 // breaks tests. 415 // breaks tests.
411 PageWidgetDelegate::animate(*m_page, monotonicallyIncreasingTime()); 416 PageWidgetDelegate::animate(*m_page, monotonicallyIncreasingTime());
412 } 417 }
413 418
414 void WebPagePopupImpl::willCloseLayerTreeView() { 419 void WebPagePopupImpl::willCloseLayerTreeView() {
415 if (m_page && m_layerTreeView) 420 if (m_page && m_layerTreeView) {
416 m_page->willCloseLayerTreeView(*m_layerTreeView); 421 m_page->willCloseLayerTreeView(*m_layerTreeView,
422 m_popupClient->ownerElement()
423 .document()
424 .frame()
425 ->localFrameRoot()
426 ->view());
427 }
417 428
418 setIsAcceleratedCompositingActive(false); 429 setIsAcceleratedCompositingActive(false);
419 m_layerTreeView = nullptr; 430 m_layerTreeView = nullptr;
420 m_animationHost = nullptr; 431 m_animationHost = nullptr;
421 } 432 }
422 433
423 void WebPagePopupImpl::updateAllLifecyclePhases() { 434 void WebPagePopupImpl::updateAllLifecyclePhases() {
424 if (!m_page) 435 if (!m_page)
425 return; 436 return;
426 PageWidgetDelegate::updateAllLifecyclePhases( 437 PageWidgetDelegate::updateAllLifecyclePhases(
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 // A WebPagePopupImpl instance usually has two references. 609 // A WebPagePopupImpl instance usually has two references.
599 // - One owned by the instance itself. It represents the visible widget. 610 // - One owned by the instance itself. It represents the visible widget.
600 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the 611 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the
601 // WebPagePopupImpl to close. 612 // WebPagePopupImpl to close.
602 // We need them because the closing operation is asynchronous and the widget 613 // We need them because the closing operation is asynchronous and the widget
603 // can be closed while the WebViewImpl is unaware of it. 614 // can be closed while the WebViewImpl is unaware of it.
604 return adoptRef(new WebPagePopupImpl(client)).leakRef(); 615 return adoptRef(new WebPagePopupImpl(client)).leakRef();
605 } 616 }
606 617
607 } // namespace blink 618 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698