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

Side by Side Diff: content/renderer/render_widget.h

Issue 240163005: Deliver IPC messages together with SwapCompositorFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unique policy, clean tests up a bit Created 6 years, 5 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
OLDNEW
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 #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 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 10
11 #include "base/auto_reset.h" 11 #include "base/auto_reset.h"
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/callback.h"
13 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
14 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
16 #include "base/observer_list.h" 17 #include "base/observer_list.h"
17 #include "base/time/time.h" 18 #include "base/time/time.h"
18 #include "base/timer/timer.h" 19 #include "base/timer/timer.h"
19 #include "cc/debug/rendering_stats_instrumentation.h" 20 #include "cc/debug/rendering_stats_instrumentation.h"
20 #include "content/common/content_export.h" 21 #include "content/common/content_export.h"
21 #include "content/common/cursors/webcursor.h" 22 #include "content/common/cursors/webcursor.h"
22 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 23 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
23 #include "content/common/input/synthetic_gesture_params.h" 24 #include "content/common/input/synthetic_gesture_params.h"
25 #include "content/renderer/message_delivery_policy.h"
24 #include "ipc/ipc_listener.h" 26 #include "ipc/ipc_listener.h"
25 #include "ipc/ipc_sender.h" 27 #include "ipc/ipc_sender.h"
26 #include "third_party/WebKit/public/platform/WebRect.h" 28 #include "third_party/WebKit/public/platform/WebRect.h"
27 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" 29 #include "third_party/WebKit/public/web/WebCompositionUnderline.h"
28 #include "third_party/WebKit/public/web/WebInputEvent.h" 30 #include "third_party/WebKit/public/web/WebInputEvent.h"
29 #include "third_party/WebKit/public/web/WebPopupType.h" 31 #include "third_party/WebKit/public/web/WebPopupType.h"
30 #include "third_party/WebKit/public/web/WebTextDirection.h" 32 #include "third_party/WebKit/public/web/WebTextDirection.h"
31 #include "third_party/WebKit/public/web/WebTextInputInfo.h" 33 #include "third_party/WebKit/public/web/WebTextInputInfo.h"
32 #include "third_party/WebKit/public/web/WebTouchAction.h" 34 #include "third_party/WebKit/public/web/WebTouchAction.h"
33 #include "third_party/WebKit/public/web/WebWidget.h" 35 #include "third_party/WebKit/public/web/WebWidget.h"
34 #include "third_party/WebKit/public/web/WebWidgetClient.h" 36 #include "third_party/WebKit/public/web/WebWidgetClient.h"
35 #include "third_party/skia/include/core/SkBitmap.h" 37 #include "third_party/skia/include/core/SkBitmap.h"
36 #include "ui/base/ime/text_input_mode.h" 38 #include "ui/base/ime/text_input_mode.h"
37 #include "ui/base/ime/text_input_type.h" 39 #include "ui/base/ime/text_input_type.h"
38 #include "ui/base/ui_base_types.h" 40 #include "ui/base/ui_base_types.h"
39 #include "ui/gfx/native_widget_types.h" 41 #include "ui/gfx/native_widget_types.h"
40 #include "ui/gfx/range/range.h" 42 #include "ui/gfx/range/range.h"
41 #include "ui/gfx/rect.h" 43 #include "ui/gfx/rect.h"
42 #include "ui/gfx/vector2d.h" 44 #include "ui/gfx/vector2d.h"
43 #include "ui/gfx/vector2d_f.h" 45 #include "ui/gfx/vector2d_f.h"
44 #include "ui/surface/transport_dib.h" 46 #include "ui/surface/transport_dib.h"
45 47
46 struct ViewHostMsg_UpdateRect_Params; 48 struct ViewHostMsg_UpdateRect_Params;
47 struct ViewMsg_Resize_Params; 49 struct ViewMsg_Resize_Params;
48 class ViewHostMsg_UpdateRect; 50 class ViewHostMsg_UpdateRect;
49 51
50 namespace IPC { 52 namespace IPC {
51 class SyncMessage; 53 class SyncMessage;
54 class SyncMessageFilter;
52 } 55 }
53 56
54 namespace blink { 57 namespace blink {
55 struct WebDeviceEmulationParams; 58 struct WebDeviceEmulationParams;
56 class WebGestureEvent; 59 class WebGestureEvent;
57 class WebKeyboardEvent; 60 class WebKeyboardEvent;
58 class WebMouseEvent; 61 class WebMouseEvent;
59 class WebTouchEvent; 62 class WebTouchEvent;
60 } 63 }
61 64
62 namespace cc { class OutputSurface; } 65 namespace cc {
66 class OutputSurface;
67 class SwapPromise;
68 }
63 69
64 namespace gfx { 70 namespace gfx {
65 class Range; 71 class Range;
66 } 72 }
67 73
68 namespace content { 74 namespace content {
69 class ExternalPopupMenu; 75 class ExternalPopupMenu;
76 class FrameSwapMessageQueue;
70 class PepperPluginInstanceImpl; 77 class PepperPluginInstanceImpl;
71 class RenderFrameImpl; 78 class RenderFrameImpl;
72 class RenderFrameProxy; 79 class RenderFrameProxy;
73 class RenderWidgetCompositor; 80 class RenderWidgetCompositor;
74 class RenderWidgetTest; 81 class RenderWidgetTest;
75 class ResizingModeSelector; 82 class ResizingModeSelector;
76 struct ContextMenuParams; 83 struct ContextMenuParams;
77 struct WebPluginGeometry; 84 struct WebPluginGeometry;
78 85
79 // RenderWidget provides a communication bridge between a WebWidget and 86 // RenderWidget provides a communication bridge between a WebWidget and
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 void QueueSyntheticGesture( 192 void QueueSyntheticGesture(
186 scoped_ptr<SyntheticGestureParams> gesture_params, 193 scoped_ptr<SyntheticGestureParams> gesture_params,
187 const SyntheticGestureCompletionCallback& callback); 194 const SyntheticGestureCompletionCallback& callback);
188 195
189 // Close the underlying WebWidget. 196 // Close the underlying WebWidget.
190 virtual void Close(); 197 virtual void Close();
191 198
192 // Notifies about a compositor frame commit operation having finished. 199 // Notifies about a compositor frame commit operation having finished.
193 virtual void DidCommitCompositorFrame(); 200 virtual void DidCommitCompositorFrame();
194 201
202 // Deliveres |message| together with compositor state change updates. The
203 // exact behavior depends on |policy|.
204 // FIFO ordering is preserved between messages enqueued with the same
205 // |policy|, the ordering between messages enqueued for different policies is
206 // undefined.
207 //
208 // |msg| message to send, ownership of |msg| is transferred.
209 // |policy| see the comment on MessageDeliveryPolicy.
210 void QueueMessage(IPC::Message* msg, MessageDeliveryPolicy policy);
211
195 // Handle common setup/teardown for handling IME events. 212 // Handle common setup/teardown for handling IME events.
196 void StartHandlingImeEvent(); 213 void StartHandlingImeEvent();
197 void FinishHandlingImeEvent(); 214 void FinishHandlingImeEvent();
198 215
199 // Returns whether we currently should handle an IME event. 216 // Returns whether we currently should handle an IME event.
200 bool ShouldHandleImeEvent(); 217 bool ShouldHandleImeEvent();
201 218
202 virtual void InstrumentWillBeginFrame(int frame_id) {} 219 virtual void InstrumentWillBeginFrame(int frame_id) {}
203 virtual void InstrumentDidBeginFrame() {} 220 virtual void InstrumentDidBeginFrame() {}
204 virtual void InstrumentDidCancelFrame() {} 221 virtual void InstrumentDidCancelFrame() {}
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 // state. 429 // state.
413 void SetHidden(bool hidden); 430 void SetHidden(bool hidden);
414 431
415 void WillToggleFullscreen(); 432 void WillToggleFullscreen();
416 void DidToggleFullscreen(); 433 void DidToggleFullscreen();
417 434
418 bool next_paint_is_resize_ack() const; 435 bool next_paint_is_resize_ack() const;
419 void set_next_paint_is_resize_ack(); 436 void set_next_paint_is_resize_ack();
420 void set_next_paint_is_repaint_ack(); 437 void set_next_paint_is_repaint_ack();
421 438
439 // QueueMessage implementation extracted into a static method for easy
440 // testing.
441 static scoped_ptr<cc::SwapPromise> QueueMessageImpl(
442 IPC::Message* msg,
443 MessageDeliveryPolicy policy,
444 FrameSwapMessageQueue* frame_swap_message_queue,
445 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter,
446 bool commit_requested,
447 int source_frame_number);
448
422 // Override point to obtain that the current input method state and caret 449 // Override point to obtain that the current input method state and caret
423 // position. 450 // position.
424 virtual ui::TextInputType GetTextInputType(); 451 virtual ui::TextInputType GetTextInputType();
425 virtual ui::TextInputType WebKitToUiTextInputType( 452 virtual ui::TextInputType WebKitToUiTextInputType(
426 blink::WebTextInputType type); 453 blink::WebTextInputType type);
427 454
428 #if defined(OS_MACOSX) || defined(USE_AURA) 455 #if defined(OS_MACOSX) || defined(USE_AURA)
429 // Override point to obtain that the current composition character bounds. 456 // Override point to obtain that the current composition character bounds.
430 // In the case of surrogate pairs, the character is treated as two characters: 457 // In the case of surrogate pairs, the character is treated as two characters:
431 // the bounds for first character is actual one, and the bounds for second 458 // the bounds for first character is actual one, and the bounds for second
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 #endif 711 #endif
685 712
686 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_; 713 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_;
687 714
688 // Popups may be displaced when screen metrics emulation is enabled. 715 // Popups may be displaced when screen metrics emulation is enabled.
689 // These values are used to properly adjust popup position. 716 // These values are used to properly adjust popup position.
690 gfx::Point popup_view_origin_for_emulation_; 717 gfx::Point popup_view_origin_for_emulation_;
691 gfx::Point popup_screen_origin_for_emulation_; 718 gfx::Point popup_screen_origin_for_emulation_;
692 float popup_origin_scale_for_emulation_; 719 float popup_origin_scale_for_emulation_;
693 720
721 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
694 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; 722 scoped_ptr<ResizingModeSelector> resizing_mode_selector_;
695 723
696 // Lists of RenderFrameProxy objects that need to be notified of 724 // Lists of RenderFrameProxy objects that need to be notified of
697 // compositing-related events (e.g. DidCommitCompositorFrame). 725 // compositing-related events (e.g. DidCommitCompositorFrame).
698 ObserverList<RenderFrameProxy> render_frame_proxies_; 726 ObserverList<RenderFrameProxy> render_frame_proxies_;
699 #if defined(VIDEO_HOLE) 727 #if defined(VIDEO_HOLE)
700 ObserverList<RenderFrameImpl> video_hole_frames_; 728 ObserverList<RenderFrameImpl> video_hole_frames_;
701 #endif // defined(VIDEO_HOLE) 729 #endif // defined(VIDEO_HOLE)
702 730
703 // A list of RenderFrames associated with this RenderWidget. Notifications 731 // A list of RenderFrames associated with this RenderWidget. Notifications
704 // are sent to each frame in the list for events such as changing 732 // are sent to each frame in the list for events such as changing
705 // visibility state for example. 733 // visibility state for example.
706 ObserverList<RenderFrameImpl> render_frames_; 734 ObserverList<RenderFrameImpl> render_frames_;
707 735
708 ui::MenuSourceType context_menu_source_type_; 736 ui::MenuSourceType context_menu_source_type_;
709 gfx::Point touch_editing_context_menu_location_; 737 gfx::Point touch_editing_context_menu_location_;
710 738
711 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 739 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
712 }; 740 };
713 741
714 } // namespace content 742 } // namespace content
715 743
716 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 744 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698