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

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

Issue 453523002: Fix shutdown assertions in WebViewImpl (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | « no previous file | 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 3973 matching lines...) Expand 10 before | Expand all | Expand 10 after
3984 3984
3985 m_page->settings().setAcceleratedCompositingEnabled(m_layerTreeView != 0); 3985 m_page->settings().setAcceleratedCompositingEnabled(m_layerTreeView != 0);
3986 3986
3987 // FIXME: only unittests, click to play, Android priting, and printing (for headers and footers) 3987 // FIXME: only unittests, click to play, Android priting, and printing (for headers and footers)
3988 // make this assert necessary. We should make them not hit this code and the n delete allowsBrokenNullLayerTreeView. 3988 // make this assert necessary. We should make them not hit this code and the n delete allowsBrokenNullLayerTreeView.
3989 ASSERT(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeVi ew()); 3989 ASSERT(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeVi ew());
3990 } 3990 }
3991 3991
3992 void WebViewImpl::setIsAcceleratedCompositingActive(bool active) 3992 void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
3993 { 3993 {
3994 // In the middle of shutting down; don't try to spin back up a compositor.
3995 // FIXME: compositing startup/shutdown should be refactored so that it
3996 // turns on explicitly rather than lazily, which causes this awkwardness.
3997 if (m_layerTreeViewClosed)
3998 return;
3999
3994 ASSERT(!active || m_layerTreeView); 4000 ASSERT(!active || m_layerTreeView);
3995 blink::Platform::current()->histogramEnumeration("GPU.setIsAcceleratedCompos itingActive", active * 2 + m_isAcceleratedCompositingActive, 4); 4001 blink::Platform::current()->histogramEnumeration("GPU.setIsAcceleratedCompos itingActive", active * 2 + m_isAcceleratedCompositingActive, 4);
3996 4002
3997 if (m_isAcceleratedCompositingActive == active) 4003 if (m_isAcceleratedCompositingActive == active)
3998 return; 4004 return;
3999 4005
4000 if (!m_client) 4006 if (!m_client)
4001 return; 4007 return;
4002 4008
4003 // In the middle of shutting down; don't try to spin back up a compositor.
4004 if (m_layerTreeViewClosed)
4005 return;
4006
4007 if (!active) { 4009 if (!active) {
4008 m_isAcceleratedCompositingActive = false; 4010 m_isAcceleratedCompositingActive = false;
4009 if (!m_layerTreeViewCommitsDeferred) { 4011 if (!m_layerTreeViewCommitsDeferred) {
4010 ASSERT(m_layerTreeView); 4012 ASSERT(m_layerTreeView);
4011 // This means that we're transitioning to a new page. Suppress commi ts until WebKit generates invalidations so 4013 // This means that we're transitioning to a new page. Suppress commi ts until WebKit generates invalidations so
4012 // we don't attempt to paint too early in the next page load. 4014 // we don't attempt to paint too early in the next page load.
4013 m_layerTreeView->setDeferCommits(true); 4015 m_layerTreeView->setDeferCommits(true);
4014 m_layerTreeViewCommitsDeferred = true; 4016 m_layerTreeViewCommitsDeferred = true;
4015 } 4017 }
4016 } else { 4018 } else {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
4235 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4237 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4236 4238
4237 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4239 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4238 return false; 4240 return false;
4239 4241
4240 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4242 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4241 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4243 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4242 } 4244 }
4243 4245
4244 } // namespace blink 4246 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698