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

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

Issue 1459023002: Compositor Animation Timelines: Fix frame swapping tests in WebFrameTest.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check if m_page is null in WebPagePopupImpl. Created 5 years 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 m_isAcceleratedCompositingActive = true; 337 m_isAcceleratedCompositingActive = true;
338 } else { 338 } else {
339 TRACE_EVENT0("blink", "WebPagePopupImpl::setIsAcceleratedCompositingActi ve(true)"); 339 TRACE_EVENT0("blink", "WebPagePopupImpl::setIsAcceleratedCompositingActi ve(true)");
340 340
341 m_widgetClient->initializeLayerTreeView(); 341 m_widgetClient->initializeLayerTreeView();
342 m_layerTreeView = m_widgetClient->layerTreeView(); 342 m_layerTreeView = m_widgetClient->layerTreeView();
343 if (m_layerTreeView) { 343 if (m_layerTreeView) {
344 m_layerTreeView->setVisible(true); 344 m_layerTreeView->setVisible(true);
345 m_isAcceleratedCompositingActive = true; 345 m_isAcceleratedCompositingActive = true;
346 m_layerTreeView->setDeviceScaleFactor(m_webView->deviceScaleFactor() ); 346 m_layerTreeView->setDeviceScaleFactor(m_webView->deviceScaleFactor() );
347 m_page->layerTreeViewInitialized(*m_layerTreeView);
347 } else { 348 } else {
348 m_isAcceleratedCompositingActive = false; 349 m_isAcceleratedCompositingActive = false;
349 } 350 }
350 } 351 }
351 } 352 }
352 353
353 void WebPagePopupImpl::beginFrame(double lastFrameTimeMonotonic) 354 void WebPagePopupImpl::beginFrame(double lastFrameTimeMonotonic)
354 { 355 {
355 if (!m_page) 356 if (!m_page)
356 return; 357 return;
357 // FIXME: This should use lastFrameTimeMonotonic but doing so 358 // FIXME: This should use lastFrameTimeMonotonic but doing so
358 // breaks tests. 359 // breaks tests.
359 PageWidgetDelegate::animate(*m_page, monotonicallyIncreasingTime()); 360 PageWidgetDelegate::animate(*m_page, monotonicallyIncreasingTime());
360 } 361 }
361 362
362 void WebPagePopupImpl::willCloseLayerTreeView() 363 void WebPagePopupImpl::willCloseLayerTreeView()
363 { 364 {
365 if (m_page && m_layerTreeView)
366 m_page->willCloseLayerTreeView(*m_layerTreeView);
367
364 setIsAcceleratedCompositingActive(false); 368 setIsAcceleratedCompositingActive(false);
365 m_layerTreeView = 0; 369 m_layerTreeView = 0;
366 } 370 }
367 371
368 void WebPagePopupImpl::updateAllLifecyclePhases() 372 void WebPagePopupImpl::updateAllLifecyclePhases()
369 { 373 {
370 if (!m_page) 374 if (!m_page)
371 return; 375 return;
372 PageWidgetDelegate::updateAllLifecyclePhases(*m_page, *m_page->deprecatedLoc alMainFrame()); 376 PageWidgetDelegate::updateAllLifecyclePhases(*m_page, *m_page->deprecatedLoc alMainFrame());
373 } 377 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 // A WebPagePopupImpl instance usually has two references. 536 // A WebPagePopupImpl instance usually has two references.
533 // - One owned by the instance itself. It represents the visible widget. 537 // - One owned by the instance itself. It represents the visible widget.
534 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the 538 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the
535 // WebPagePopupImpl to close. 539 // WebPagePopupImpl to close.
536 // We need them because the closing operation is asynchronous and the widget 540 // We need them because the closing operation is asynchronous and the widget
537 // can be closed while the WebViewImpl is unaware of it. 541 // can be closed while the WebViewImpl is unaware of it.
538 return adoptRef(new WebPagePopupImpl(client)).leakRef(); 542 return adoptRef(new WebPagePopupImpl(client)).leakRef();
539 } 543 }
540 544
541 } // namespace blink 545 } // 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