OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 4318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4329 pepper_delegate_.ViewInitiatedPaint(); | 4329 pepper_delegate_.ViewInitiatedPaint(); |
4330 } | 4330 } |
4331 | 4331 |
4332 void RenderViewImpl::DidFlushPaint() { | 4332 void RenderViewImpl::DidFlushPaint() { |
4333 // Notify any pepper plugins that we painted. This will call into the plugin, | 4333 // Notify any pepper plugins that we painted. This will call into the plugin, |
4334 // and we it may ask to close itself as a result. This will, in turn, modify | 4334 // and we it may ask to close itself as a result. This will, in turn, modify |
4335 // our set, possibly invalidating the iterator. So we iterate on a copy that | 4335 // our set, possibly invalidating the iterator. So we iterate on a copy that |
4336 // won't change out from under us. | 4336 // won't change out from under us. |
4337 pepper_delegate_.ViewFlushedPaint(); | 4337 pepper_delegate_.ViewFlushedPaint(); |
4338 | 4338 |
| 4339 // If the RenderWidget is closing down then early-exit, otherwise we'll crash. |
| 4340 // See crbug.com/112921. |
| 4341 if (!webview()) |
| 4342 return; |
| 4343 |
4339 WebFrame* main_frame = webview()->mainFrame(); | 4344 WebFrame* main_frame = webview()->mainFrame(); |
4340 | 4345 |
4341 // If we have a provisional frame we are between the start and commit stages | 4346 // If we have a provisional frame we are between the start and commit stages |
4342 // of loading and we don't want to save stats. | 4347 // of loading and we don't want to save stats. |
4343 if (!main_frame->provisionalDataSource()) { | 4348 if (!main_frame->provisionalDataSource()) { |
4344 WebDataSource* ds = main_frame->dataSource(); | 4349 WebDataSource* ds = main_frame->dataSource(); |
4345 DocumentState* document_state = DocumentState::FromDataSource(ds); | 4350 DocumentState* document_state = DocumentState::FromDataSource(ds); |
4346 | 4351 |
4347 // TODO(jar): The following code should all be inside a method, probably in | 4352 // TODO(jar): The following code should all be inside a method, probably in |
4348 // NavigatorState. | 4353 // NavigatorState. |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4975 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4980 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4976 return !!RenderThreadImpl::current()->compositor_thread(); | 4981 return !!RenderThreadImpl::current()->compositor_thread(); |
4977 } | 4982 } |
4978 | 4983 |
4979 void RenderViewImpl::OnJavaBridgeInit() { | 4984 void RenderViewImpl::OnJavaBridgeInit() { |
4980 DCHECK(!java_bridge_dispatcher_.get()); | 4985 DCHECK(!java_bridge_dispatcher_.get()); |
4981 #if defined(ENABLE_JAVA_BRIDGE) | 4986 #if defined(ENABLE_JAVA_BRIDGE) |
4982 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4987 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
4983 #endif | 4988 #endif |
4984 } | 4989 } |
OLD | NEW |