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

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

Issue 1292143003: Don't resume commits after every layout. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Always resume commits after the main document has finished parsing. Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3866 matching lines...) Expand 10 before | Expand all | Expand 10 after
3877 if (!m_page->mainFrame()->isLocalFrame()) 3877 if (!m_page->mainFrame()->isLocalFrame())
3878 return; 3878 return;
3879 3879
3880 // If we get to the <body> tag and we have no pending stylesheet and import load, we 3880 // If we get to the <body> tag and we have no pending stylesheet and import load, we
3881 // can be fairly confident we'll have something sensible to paint soon and 3881 // can be fairly confident we'll have something sensible to paint soon and
3882 // can turn off deferred commits. 3882 // can turn off deferred commits.
3883 if (m_page->deprecatedLocalMainFrame()->document()->isRenderingReady()) 3883 if (m_page->deprecatedLocalMainFrame()->document()->isRenderingReady())
3884 resumeTreeViewCommits(); 3884 resumeTreeViewCommits();
3885 } 3885 }
3886 3886
3887 void WebViewImpl::didFinishDocumentLoad(WebLocalFrameImpl* webframe)
3888 {
3889 if (webframe != mainFrameImpl())
3890 return;
3891 // If we finished parsing and there's no sheets to load start painting.
3892 if (webframe->frame()->document()->isRenderingReady())
3893 resumeTreeViewCommits();
3894 }
3895
3887 void WebViewImpl::didRemoveAllPendingStylesheet(WebLocalFrameImpl* webframe) 3896 void WebViewImpl::didRemoveAllPendingStylesheet(WebLocalFrameImpl* webframe)
3888 { 3897 {
3889 if (webframe != mainFrameImpl()) 3898 if (webframe != mainFrameImpl())
3890 return; 3899 return;
3891 3900
3892 // If we have no more stylesheets to load and we're past the body tag, 3901 // If we have no more stylesheets to load and we're past the body tag,
3893 // we should have something to paint and should start as soon as possible. 3902 // we should have something to paint and should start as soon as possible.
3894 if (m_page->deprecatedLocalMainFrame()->document()->body()) 3903 if (m_page->deprecatedLocalMainFrame()->document()->body())
3895 resumeTreeViewCommits(); 3904 resumeTreeViewCommits();
3896 } 3905 }
(...skipping 11 matching lines...) Expand all
3908 view->resize(mainFrameSize()); 3917 view->resize(mainFrameSize());
3909 else 3918 else
3910 view->resize(webframe->frameView()->size()); 3919 view->resize(webframe->frameView()->size());
3911 } 3920 }
3912 3921
3913 void WebViewImpl::layoutUpdated(WebLocalFrameImpl* webframe) 3922 void WebViewImpl::layoutUpdated(WebLocalFrameImpl* webframe)
3914 { 3923 {
3915 if (!m_client || !webframe->frame()->isLocalRoot()) 3924 if (!m_client || !webframe->frame()->isLocalRoot())
3916 return; 3925 return;
3917 3926
3918 // If we finished a layout while in deferred commit mode,
3919 // that means it's time to start producing frames again so un-defer.
3920 resumeTreeViewCommits();
3921
3922 if (m_shouldAutoResize && webframe->frame() && webframe->frame()->view()) { 3927 if (m_shouldAutoResize && webframe->frame() && webframe->frame()->view()) {
3923 WebSize frameSize = webframe->frame()->view()->frameRect().size(); 3928 WebSize frameSize = webframe->frame()->view()->frameRect().size();
3924 if (frameSize != m_size) { 3929 if (frameSize != m_size) {
3925 m_size = frameSize; 3930 m_size = frameSize;
3926 3931
3927 page()->frameHost().visualViewport().setSize(m_size); 3932 page()->frameHost().visualViewport().setSize(m_size);
3928 pageScaleConstraintsSet().didChangeViewSize(m_size); 3933 pageScaleConstraintsSet().didChangeViewSize(m_size);
3929 3934
3930 m_client->didAutoResize(m_size); 3935 m_client->didAutoResize(m_size);
3931 sendResizeEventAndRepaint(); 3936 sendResizeEventAndRepaint();
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
4419 if (m_pageColorOverlay) 4424 if (m_pageColorOverlay)
4420 m_pageColorOverlay->update(); 4425 m_pageColorOverlay->update();
4421 if (m_inspectorOverlay) { 4426 if (m_inspectorOverlay) {
4422 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); 4427 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay();
4423 if (inspectorPageOverlay) 4428 if (inspectorPageOverlay)
4424 inspectorPageOverlay->update(); 4429 inspectorPageOverlay->update();
4425 } 4430 }
4426 } 4431 }
4427 4432
4428 } // namespace blink 4433 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698