Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 m_isAcceleratedCompositingActive = true; | 336 m_isAcceleratedCompositingActive = true; |
| 337 } else { | 337 } else { |
| 338 TRACE_EVENT0("blink", "WebPagePopupImpl::setIsAcceleratedCompositingActi ve(true)"); | 338 TRACE_EVENT0("blink", "WebPagePopupImpl::setIsAcceleratedCompositingActi ve(true)"); |
| 339 | 339 |
| 340 m_widgetClient->initializeLayerTreeView(); | 340 m_widgetClient->initializeLayerTreeView(); |
| 341 m_layerTreeView = m_widgetClient->layerTreeView(); | 341 m_layerTreeView = m_widgetClient->layerTreeView(); |
| 342 if (m_layerTreeView) { | 342 if (m_layerTreeView) { |
| 343 m_layerTreeView->setVisible(true); | 343 m_layerTreeView->setVisible(true); |
| 344 m_isAcceleratedCompositingActive = true; | 344 m_isAcceleratedCompositingActive = true; |
| 345 m_layerTreeView->setDeviceScaleFactor(m_webView->deviceScaleFactor() ); | 345 m_layerTreeView->setDeviceScaleFactor(m_webView->deviceScaleFactor() ); |
| 346 if (m_page) | |
|
dcheng
2015/12/01 01:16:30
Is the m_page test here necessary? It looks asymme
loyso (OOO)
2015/12/01 05:41:03
WebPagePopupImpl tests m_page for nullptr almost e
| |
| 347 m_page->layerTreeViewInitialized(*m_layerTreeView); | |
| 346 } else { | 348 } else { |
| 347 m_isAcceleratedCompositingActive = false; | 349 m_isAcceleratedCompositingActive = false; |
| 348 } | 350 } |
| 349 } | 351 } |
| 350 } | 352 } |
| 351 | 353 |
| 352 void WebPagePopupImpl::beginFrame(double lastFrameTimeMonotonic) | 354 void WebPagePopupImpl::beginFrame(double lastFrameTimeMonotonic) |
| 353 { | 355 { |
| 354 if (!m_page) | 356 if (!m_page) |
| 355 return; | 357 return; |
| 356 // FIXME: This should use lastFrameTimeMonotonic but doing so | 358 // FIXME: This should use lastFrameTimeMonotonic but doing so |
| 357 // breaks tests. | 359 // breaks tests. |
| 358 PageWidgetDelegate::animate(*m_page, monotonicallyIncreasingTime()); | 360 PageWidgetDelegate::animate(*m_page, monotonicallyIncreasingTime()); |
| 359 } | 361 } |
| 360 | 362 |
| 361 void WebPagePopupImpl::willCloseLayerTreeView() | 363 void WebPagePopupImpl::willCloseLayerTreeView() |
| 362 { | 364 { |
| 365 if (m_page && m_layerTreeView) | |
| 366 m_page->willCloseLayerTreeView(*m_layerTreeView); | |
| 367 | |
| 363 setIsAcceleratedCompositingActive(false); | 368 setIsAcceleratedCompositingActive(false); |
| 364 m_layerTreeView = 0; | 369 m_layerTreeView = 0; |
| 365 } | 370 } |
| 366 | 371 |
| 367 void WebPagePopupImpl::updateAllLifecyclePhases() | 372 void WebPagePopupImpl::updateAllLifecyclePhases() |
| 368 { | 373 { |
| 369 if (!m_page) | 374 if (!m_page) |
| 370 return; | 375 return; |
| 371 PageWidgetDelegate::updateAllLifecyclePhases(*m_page, *m_page->deprecatedLoc alMainFrame()); | 376 PageWidgetDelegate::updateAllLifecyclePhases(*m_page, *m_page->deprecatedLoc alMainFrame()); |
| 372 } | 377 } |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 531 // A WebPagePopupImpl instance usually has two references. | 536 // A WebPagePopupImpl instance usually has two references. |
| 532 // - One owned by the instance itself. It represents the visible widget. | 537 // - One owned by the instance itself. It represents the visible widget. |
| 533 // - 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 |
| 534 // WebPagePopupImpl to close. | 539 // WebPagePopupImpl to close. |
| 535 // 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 |
| 536 // can be closed while the WebViewImpl is unaware of it. | 541 // can be closed while the WebViewImpl is unaware of it. |
| 537 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 542 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 538 } | 543 } |
| 539 | 544 |
| 540 } // namespace blink | 545 } // namespace blink |
| OLD | NEW |