Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <queue> | |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/time.h" | 16 #include "base/time.h" |
| 16 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 17 #include "content/renderer/paint_aggregator.h" | 18 #include "content/renderer/paint_aggregator.h" |
| 18 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 namespace webkit { | 57 namespace webkit { |
| 57 namespace npapi { | 58 namespace npapi { |
| 58 struct WebPluginGeometry; | 59 struct WebPluginGeometry; |
| 59 } // namespace npapi | 60 } // namespace npapi |
| 60 | 61 |
| 61 namespace ppapi { | 62 namespace ppapi { |
| 62 class PluginInstance; | 63 class PluginInstance; |
| 63 } // namespace ppapi | 64 } // namespace ppapi |
| 64 } // namespace webkit | 65 } // namespace webkit |
| 65 | 66 |
| 67 struct ViewHostMsg_UpdateRect_Params; | |
|
jam
2011/11/11 03:03:45
nit: i thought the convention was to put this befo
piman
2011/11/16 01:00:55
Done.
| |
| 68 class ViewHostMsg_UpdateRect; | |
| 69 | |
| 66 // RenderWidget provides a communication bridge between a WebWidget and | 70 // RenderWidget provides a communication bridge between a WebWidget and |
| 67 // a RenderWidgetHost, the latter of which lives in a different process. | 71 // a RenderWidgetHost, the latter of which lives in a different process. |
| 68 class CONTENT_EXPORT RenderWidget | 72 class CONTENT_EXPORT RenderWidget |
| 69 : public IPC::Channel::Listener, | 73 : public IPC::Channel::Listener, |
| 70 public IPC::Message::Sender, | 74 public IPC::Message::Sender, |
| 71 NON_EXPORTED_BASE(virtual public WebKit::WebWidgetClient), | 75 NON_EXPORTED_BASE(virtual public WebKit::WebWidgetClient), |
| 72 public base::RefCounted<RenderWidget> { | 76 public base::RefCounted<RenderWidget> { |
| 73 public: | 77 public: |
| 74 // Creates a new RenderWidget. The opener_id is the routing ID of the | 78 // Creates a new RenderWidget. The opener_id is the routing ID of the |
| 75 // RenderView that this widget lives inside. | 79 // RenderView that this widget lives inside. |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 266 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should | 270 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should |
| 267 // use this method so that we can properly inform the RenderThread of our | 271 // use this method so that we can properly inform the RenderThread of our |
| 268 // state. | 272 // state. |
| 269 void SetHidden(bool hidden); | 273 void SetHidden(bool hidden); |
| 270 | 274 |
| 271 bool is_hidden() const { return is_hidden_; } | 275 bool is_hidden() const { return is_hidden_; } |
| 272 | 276 |
| 273 void WillToggleFullscreen(); | 277 void WillToggleFullscreen(); |
| 274 void DidToggleFullscreen(); | 278 void DidToggleFullscreen(); |
| 275 | 279 |
| 276 // True if an UpdateRect_ACK message is pending. | |
| 277 bool update_reply_pending() const { | |
| 278 return update_reply_pending_; | |
| 279 } | |
| 280 | |
| 281 bool next_paint_is_resize_ack() const; | 280 bool next_paint_is_resize_ack() const; |
| 282 bool next_paint_is_restore_ack() const; | 281 bool next_paint_is_restore_ack() const; |
| 283 void set_next_paint_is_resize_ack(); | 282 void set_next_paint_is_resize_ack(); |
| 284 void set_next_paint_is_restore_ack(); | 283 void set_next_paint_is_restore_ack(); |
| 285 void set_next_paint_is_repaint_ack(); | 284 void set_next_paint_is_repaint_ack(); |
| 286 | 285 |
| 287 // Checks if the text input state and compose inline mode have been changed. | 286 // Checks if the text input state and compose inline mode have been changed. |
| 288 // If they are changed, the new value will be sent to the browser process. | 287 // If they are changed, the new value will be sent to the browser process. |
| 289 void UpdateTextInputState(); | 288 void UpdateTextInputState(); |
| 290 | 289 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 466 bool is_accelerated_compositing_active_; | 465 bool is_accelerated_compositing_active_; |
| 467 | 466 |
| 468 base::Time animation_floor_time_; | 467 base::Time animation_floor_time_; |
| 469 bool animation_update_pending_; | 468 bool animation_update_pending_; |
| 470 bool animation_task_posted_; | 469 bool animation_task_posted_; |
| 471 bool invalidation_task_posted_; | 470 bool invalidation_task_posted_; |
| 472 | 471 |
| 473 bool has_disable_gpu_vsync_switch_; | 472 bool has_disable_gpu_vsync_switch_; |
| 474 base::TimeTicks last_do_deferred_update_time_; | 473 base::TimeTicks last_do_deferred_update_time_; |
| 475 | 474 |
| 475 // UpdateRect parameters for the current compositing pass. This is used to | |
| 476 // pass state between DoDeferredUpdate and OnSwapBuffersPosted. | |
| 477 scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; | |
| 478 | |
| 479 // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to | |
| 480 // delay sending of UpdateRect until the corresponding SwapBuffers has been | |
| 481 // executed. Since we can have several in flight, we need to keep them in a | |
| 482 // queue. Note: some SwapBuffers may not correspond to an update, in which | |
| 483 // case NULL is added to the queue. | |
| 484 std::queue<ViewHostMsg_UpdateRect*> updates_pending_swap_; | |
| 485 | |
| 476 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 486 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 477 }; | 487 }; |
| 478 | 488 |
| 479 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 489 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |