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

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

Issue 1376003002: Make rendering timeouts work even if paint data received early (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cursor
Patch Set: Rebase that maybe works this time Created 5 years, 2 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 , m_flingModifier(0) 442 , m_flingModifier(0)
443 , m_flingSourceDevice(false) 443 , m_flingSourceDevice(false)
444 , m_fullscreenController(FullscreenController::create(this)) 444 , m_fullscreenController(FullscreenController::create(this))
445 , m_showFPSCounter(false) 445 , m_showFPSCounter(false)
446 , m_baseBackgroundColor(Color::white) 446 , m_baseBackgroundColor(Color::white)
447 , m_backgroundColorOverride(Color::transparent) 447 , m_backgroundColorOverride(Color::transparent)
448 , m_zoomFactorOverride(0) 448 , m_zoomFactorOverride(0)
449 , m_userGestureObserved(false) 449 , m_userGestureObserved(false)
450 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false) 450 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false)
451 , m_shouldDispatchFirstLayoutAfterFinishedParsing(false) 451 , m_shouldDispatchFirstLayoutAfterFinishedParsing(false)
452 , m_shouldDispatchFirstPaintAfterLoad(false)
452 , m_displayMode(WebDisplayModeBrowser) 453 , m_displayMode(WebDisplayModeBrowser)
453 , m_elasticOverscroll(FloatSize()) 454 , m_elasticOverscroll(FloatSize())
454 { 455 {
455 Page::PageClients pageClients; 456 Page::PageClients pageClients;
456 pageClients.chromeClient = m_chromeClientImpl.get(); 457 pageClients.chromeClient = m_chromeClientImpl.get();
457 pageClients.contextMenuClient = &m_contextMenuClientImpl; 458 pageClients.contextMenuClient = &m_contextMenuClientImpl;
458 pageClients.editorClient = &m_editorClientImpl; 459 pageClients.editorClient = &m_editorClientImpl;
459 pageClients.dragClient = &m_dragClientImpl; 460 pageClients.dragClient = &m_dragClientImpl;
460 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; 461 pageClients.spellCheckerClient = &m_spellCheckerClientImpl;
461 462
(...skipping 3398 matching lines...) Expand 10 before | Expand all | Expand 10 after
3860 #endif 3861 #endif
3861 } 3862 }
3862 3863
3863 void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag e) 3864 void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag e)
3864 { 3865 {
3865 if (isNewNavigation && !isNavigationWithinPage) { 3866 if (isNewNavigation && !isNavigationWithinPage) {
3866 pageScaleConstraintsSet().setNeedsReset(true); 3867 pageScaleConstraintsSet().setNeedsReset(true);
3867 m_pageImportanceSignals.onCommitLoad(); 3868 m_pageImportanceSignals.onCommitLoad();
3868 } 3869 }
3869 3870
3871 if (m_shouldDispatchFirstPaintAfterLoad) {
3872 m_shouldDispatchFirstPaintAfterLoad = false;
dcheng 2015/09/30 21:16:03 Why does this dispatch the didFirstPaintAfterLoad(
kenrb 2015/09/30 21:40:41 I've changed the name. The fact that it will queue
3873 client()->didFirstPaintAfterLoad();
3874 }
3875
3870 // Give the visual viewport's scroll layer its initial size. 3876 // Give the visual viewport's scroll layer its initial size.
3871 page()->frameHost().visualViewport().mainFrameDidChangeSize(); 3877 page()->frameHost().visualViewport().mainFrameDidChangeSize();
3872 3878
3873 // Make sure link highlight from previous page is cleared. 3879 // Make sure link highlight from previous page is cleared.
3874 m_linkHighlights.clear(); 3880 m_linkHighlights.clear();
3875 endActiveFlingAnimation(); 3881 endActiveFlingAnimation();
3876 m_userGestureObserved = false; 3882 m_userGestureObserved = false;
3877 } 3883 }
3878 3884
3879 void WebViewImpl::documentElementAvailable(WebLocalFrameImpl* webframe) 3885 void WebViewImpl::documentElementAvailable(WebLocalFrameImpl* webframe)
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
4140 m_rootGraphicsLayer = nullptr; 4146 m_rootGraphicsLayer = nullptr;
4141 m_rootLayer = nullptr; 4147 m_rootLayer = nullptr;
4142 m_rootTransformLayer = nullptr; 4148 m_rootTransformLayer = nullptr;
4143 // This means that we're transitioning to a new page. Suppress 4149 // This means that we're transitioning to a new page. Suppress
4144 // commits until Blink generates invalidations so we don't 4150 // commits until Blink generates invalidations so we don't
4145 // attempt to paint too early in the next page load. 4151 // attempt to paint too early in the next page load.
4146 m_layerTreeView->setDeferCommits(true); 4152 m_layerTreeView->setDeferCommits(true);
4147 m_layerTreeView->clearRootLayer(); 4153 m_layerTreeView->clearRootLayer();
4148 m_shouldDispatchFirstVisuallyNonEmptyLayout = true; 4154 m_shouldDispatchFirstVisuallyNonEmptyLayout = true;
4149 m_shouldDispatchFirstLayoutAfterFinishedParsing = true; 4155 m_shouldDispatchFirstLayoutAfterFinishedParsing = true;
4156 m_shouldDispatchFirstPaintAfterLoad = true;
4150 page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeV iew); 4157 page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeV iew);
4151 } 4158 }
4152 } 4159 }
4153 4160
4154 void WebViewImpl::invalidateRect(const IntRect& rect) 4161 void WebViewImpl::invalidateRect(const IntRect& rect)
4155 { 4162 {
4156 if (m_layerTreeView) 4163 if (m_layerTreeView)
4157 updateLayerTreeViewport(); 4164 updateLayerTreeViewport();
4158 else if (m_client) 4165 else if (m_client)
4159 m_client->didInvalidateRect(rect); 4166 m_client->didInvalidateRect(rect);
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
4452 if (m_pageColorOverlay) 4459 if (m_pageColorOverlay)
4453 m_pageColorOverlay->update(); 4460 m_pageColorOverlay->update();
4454 if (InspectorOverlay* overlay = inspectorOverlay()) { 4461 if (InspectorOverlay* overlay = inspectorOverlay()) {
4455 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); 4462 PageOverlay* inspectorPageOverlay = overlay->pageOverlay();
4456 if (inspectorPageOverlay) 4463 if (inspectorPageOverlay)
4457 inspectorPageOverlay->update(); 4464 inspectorPageOverlay->update();
4458 } 4465 }
4459 } 4466 }
4460 4467
4461 } // namespace blink 4468 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698