| 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/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 waiting_for_screen_rects_ack_ = false; | 1230 waiting_for_screen_rects_ack_ = false; |
| 1231 | 1231 |
| 1232 // Must reset these to ensure that keyboard events work with a new renderer. | 1232 // Must reset these to ensure that keyboard events work with a new renderer. |
| 1233 suppress_next_char_events_ = false; | 1233 suppress_next_char_events_ = false; |
| 1234 | 1234 |
| 1235 // Reset some fields in preparation for recovering from a crash. | 1235 // Reset some fields in preparation for recovering from a crash. |
| 1236 ResetSizeAndRepaintPendingFlags(); | 1236 ResetSizeAndRepaintPendingFlags(); |
| 1237 current_size_.SetSize(0, 0); | 1237 current_size_.SetSize(0, 0); |
| 1238 // After the renderer crashes, the view is destroyed and so the | 1238 // After the renderer crashes, the view is destroyed and so the |
| 1239 // RenderWidgetHost cannot track its visibility anymore. We assume such | 1239 // RenderWidgetHost cannot track its visibility anymore. We assume such |
| 1240 // RenderWidgetHost to be visible for the sake of internal accounting - be | 1240 // RenderWidgetHost to be invisible for the sake of internal accounting - be |
| 1241 // careful about changing this - see http://crbug.com/401859. | 1241 // careful about changing this - see http://crbug.com/401859 and |
| 1242 // http://crbug.com/522795. |
| 1242 // | 1243 // |
| 1243 // We need to at least make sure that the RenderProcessHost is notified about | 1244 // We need to at least make sure that the RenderProcessHost is notified about |
| 1244 // the |is_hidden_| change, so that the renderer will have correct visibility | 1245 // the |is_hidden_| change, so that the renderer will have correct visibility |
| 1245 // set when respawned. | 1246 // set when respawned. |
| 1246 if (is_hidden_) { | 1247 if (!is_hidden_) { |
| 1247 process_->WidgetRestored(); | 1248 process_->WidgetHidden(); |
| 1248 is_hidden_ = false; | 1249 is_hidden_ = true; |
| 1249 } | 1250 } |
| 1250 | 1251 |
| 1251 // Reset this to ensure the hung renderer mechanism is working properly. | 1252 // Reset this to ensure the hung renderer mechanism is working properly. |
| 1252 in_flight_event_count_ = 0; | 1253 in_flight_event_count_ = 0; |
| 1253 StopHangMonitorTimeout(); | 1254 StopHangMonitorTimeout(); |
| 1254 | 1255 |
| 1255 if (view_) { | 1256 if (view_) { |
| 1256 GpuSurfaceTracker::Get()->SetSurfaceHandle(surface_id_, | 1257 GpuSurfaceTracker::Get()->SetSurfaceHandle(surface_id_, |
| 1257 gfx::GLSurfaceHandle()); | 1258 gfx::GLSurfaceHandle()); |
| 1258 view_->RenderProcessGone(status, exit_code); | 1259 view_->RenderProcessGone(status, exit_code); |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 } | 2130 } |
| 2130 | 2131 |
| 2131 #if defined(OS_WIN) | 2132 #if defined(OS_WIN) |
| 2132 gfx::NativeViewAccessible | 2133 gfx::NativeViewAccessible |
| 2133 RenderWidgetHostImpl::GetParentNativeViewAccessible() { | 2134 RenderWidgetHostImpl::GetParentNativeViewAccessible() { |
| 2134 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; | 2135 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; |
| 2135 } | 2136 } |
| 2136 #endif | 2137 #endif |
| 2137 | 2138 |
| 2138 } // namespace content | 2139 } // namespace content |
| OLD | NEW |