| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_RENDER_WIDGET_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDER_WIDGET_HOST_H_ |
| 6 #define CHROME_BROWSER_RENDER_WIDGET_HOST_H_ | 6 #define CHROME_BROWSER_RENDER_WIDGET_HOST_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include "base/gfx/size.h" | 10 #include "base/gfx/size.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // warning too soon. | 187 // warning too soon. |
| 188 void RestartHangMonitorTimeout(); | 188 void RestartHangMonitorTimeout(); |
| 189 | 189 |
| 190 // Stops all existing hang monitor timeouts and assumes the renderer is | 190 // Stops all existing hang monitor timeouts and assumes the renderer is |
| 191 // responsive. | 191 // responsive. |
| 192 void StopHangMonitorTimeout(); | 192 void StopHangMonitorTimeout(); |
| 193 | 193 |
| 194 // Starts a hang monitor timeout. If there's already a hang monitor timeout | 194 // Starts a hang monitor timeout. If there's already a hang monitor timeout |
| 195 // the new one will only fire if it has a shorter delay than the time | 195 // the new one will only fire if it has a shorter delay than the time |
| 196 // left on the existing timeouts. | 196 // left on the existing timeouts. |
| 197 void StartHangMonitorTimeout(TimeDelta delay); | 197 void StartHangMonitorTimeout(base::TimeDelta delay); |
| 198 | 198 |
| 199 // Called when we receive a notification indicating that the renderer | 199 // Called when we receive a notification indicating that the renderer |
| 200 // process has gone. | 200 // process has gone. |
| 201 void RendererExited(); | 201 void RendererExited(); |
| 202 | 202 |
| 203 // Called when the system theme changes. At this time all existing native | 203 // Called when the system theme changes. At this time all existing native |
| 204 // theme handles are invalid and the renderer must obtain new ones and | 204 // theme handles are invalid and the renderer must obtain new ones and |
| 205 // repaint. | 205 // repaint. |
| 206 void SystemThemeChanged(); | 206 void SystemThemeChanged(); |
| 207 | 207 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 scoped_ptr<WebMouseEvent> next_mouse_move_; | 275 scoped_ptr<WebMouseEvent> next_mouse_move_; |
| 276 | 276 |
| 277 // The View associated with the RenderViewHost. The lifetime of this object | 277 // The View associated with the RenderViewHost. The lifetime of this object |
| 278 // is associated with the lifetime of the Render process. If the Renderer | 278 // is associated with the lifetime of the Render process. If the Renderer |
| 279 // crashes, its View is destroyed and this pointer becomes NULL, even though | 279 // crashes, its View is destroyed and this pointer becomes NULL, even though |
| 280 // render_view_host_ lives on to load another URL (creating a new View while | 280 // render_view_host_ lives on to load another URL (creating a new View while |
| 281 // doing so). | 281 // doing so). |
| 282 RenderWidgetHostView* view_; | 282 RenderWidgetHostView* view_; |
| 283 | 283 |
| 284 // The time when an input event was sent to the RenderWidget. | 284 // The time when an input event was sent to the RenderWidget. |
| 285 TimeTicks input_event_start_time_; | 285 base::TimeTicks input_event_start_time_; |
| 286 | 286 |
| 287 // Indicates whether a page is loading or not. | 287 // Indicates whether a page is loading or not. |
| 288 bool is_loading_; | 288 bool is_loading_; |
| 289 // Indicates whether a page is hidden or not. | 289 // Indicates whether a page is hidden or not. |
| 290 bool is_hidden_; | 290 bool is_hidden_; |
| 291 // If true, then we should not ask our view to repaint when our backingstore | 291 // If true, then we should not ask our view to repaint when our backingstore |
| 292 // is updated. | 292 // is updated. |
| 293 bool suppress_view_updating_; | 293 bool suppress_view_updating_; |
| 294 | 294 |
| 295 // If true, then we should repaint when restoring even if we have a | 295 // If true, then we should repaint when restoring even if we have a |
| 296 // backingstore. This flag is set to true if we receive a paint message | 296 // backingstore. This flag is set to true if we receive a paint message |
| 297 // while is_hidden_ to true. Even though we tell the render widget to hide | 297 // while is_hidden_ to true. Even though we tell the render widget to hide |
| 298 // itself, a paint message could already be in flight at that point. | 298 // itself, a paint message could already be in flight at that point. |
| 299 bool needs_repainting_on_restore_; | 299 bool needs_repainting_on_restore_; |
| 300 | 300 |
| 301 // The following value indicates a time in the future when we would consider | 301 // The following value indicates a time in the future when we would consider |
| 302 // the renderer hung if it does not generate an appropriate response message. | 302 // the renderer hung if it does not generate an appropriate response message. |
| 303 Time time_when_considered_hung_; | 303 base::Time time_when_considered_hung_; |
| 304 | 304 |
| 305 // This timer runs to check if time_when_considered_hung_ has past. | 305 // This timer runs to check if time_when_considered_hung_ has past. |
| 306 base::OneShotTimer<RenderWidgetHost> hung_renderer_timer_; | 306 base::OneShotTimer<RenderWidgetHost> hung_renderer_timer_; |
| 307 | 307 |
| 308 // This is true if the renderer is currently unresponsive. | 308 // This is true if the renderer is currently unresponsive. |
| 309 bool is_unresponsive_; | 309 bool is_unresponsive_; |
| 310 | 310 |
| 311 // Optional observer that listens for notifications of painting. | 311 // Optional observer that listens for notifications of painting. |
| 312 scoped_ptr<PaintObserver> paint_observer_; | 312 scoped_ptr<PaintObserver> paint_observer_; |
| 313 | 313 |
| 314 // Set when we call DidPaintRect/DidScrollRect on the view. | 314 // Set when we call DidPaintRect/DidScrollRect on the view. |
| 315 bool view_being_painted_; | 315 bool view_being_painted_; |
| 316 | 316 |
| 317 // Set if we are waiting for a repaint ack for the view. | 317 // Set if we are waiting for a repaint ack for the view. |
| 318 bool repaint_ack_pending_; | 318 bool repaint_ack_pending_; |
| 319 | 319 |
| 320 // Used for UMA histogram logging to measure the time for a repaint view | 320 // Used for UMA histogram logging to measure the time for a repaint view |
| 321 // operation to finish. | 321 // operation to finish. |
| 322 TimeTicks repaint_start_time_; | 322 base::TimeTicks repaint_start_time_; |
| 323 | 323 |
| 324 DISALLOW_EVIL_CONSTRUCTORS(RenderWidgetHost); | 324 DISALLOW_EVIL_CONSTRUCTORS(RenderWidgetHost); |
| 325 }; | 325 }; |
| 326 | 326 |
| 327 class RenderWidgetHost::BackingStore { | 327 class RenderWidgetHost::BackingStore { |
| 328 public: | 328 public: |
| 329 BackingStore(const gfx::Size& size); | 329 BackingStore(const gfx::Size& size); |
| 330 ~BackingStore(); | 330 ~BackingStore(); |
| 331 | 331 |
| 332 HDC dc() { return hdc_; } | 332 HDC dc() { return hdc_; } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 357 | 357 |
| 358 class RenderWidgetHost::PaintObserver { | 358 class RenderWidgetHost::PaintObserver { |
| 359 public: | 359 public: |
| 360 virtual ~PaintObserver() {} | 360 virtual ~PaintObserver() {} |
| 361 | 361 |
| 362 // Called each time the RenderWidgetHost paints. | 362 // Called each time the RenderWidgetHost paints. |
| 363 virtual void RenderWidgetHostDidPaint(RenderWidgetHost* rwh) = 0; | 363 virtual void RenderWidgetHostDidPaint(RenderWidgetHost* rwh) = 0; |
| 364 }; | 364 }; |
| 365 | 365 |
| 366 #endif // #ifndef CHROME_BROWSER_RENDER_WIDGET_HOST_H_ | 366 #endif // #ifndef CHROME_BROWSER_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |