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

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: Created 6 years, 7 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/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback.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/observer_list.h" 16 #include "base/observer_list.h"
16 #include "base/time/time.h" 17 #include "base/time/time.h"
17 #include "base/timer/timer.h" 18 #include "base/timer/timer.h"
18 #include "cc/debug/rendering_stats_instrumentation.h" 19 #include "cc/debug/rendering_stats_instrumentation.h"
19 #include "content/common/content_export.h" 20 #include "content/common/content_export.h"
20 #include "content/common/cursors/webcursor.h" 21 #include "content/common/cursors/webcursor.h"
21 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 22 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
22 #include "content/common/input/synthetic_gesture_params.h" 23 #include "content/common/input/synthetic_gesture_params.h"
24 #include "content/renderer/message_delivery_policy.h"
25 #include "content/renderer/message_delivery_policy_lookup.h"
23 #include "ipc/ipc_listener.h" 26 #include "ipc/ipc_listener.h"
24 #include "ipc/ipc_sender.h" 27 #include "ipc/ipc_sender.h"
25 #include "third_party/WebKit/public/platform/WebRect.h" 28 #include "third_party/WebKit/public/platform/WebRect.h"
26 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" 29 #include "third_party/WebKit/public/web/WebCompositionUnderline.h"
27 #include "third_party/WebKit/public/web/WebPopupType.h" 30 #include "third_party/WebKit/public/web/WebPopupType.h"
28 #include "third_party/WebKit/public/web/WebTextDirection.h" 31 #include "third_party/WebKit/public/web/WebTextDirection.h"
29 #include "third_party/WebKit/public/web/WebTextInputInfo.h" 32 #include "third_party/WebKit/public/web/WebTextInputInfo.h"
30 #include "third_party/WebKit/public/web/WebTouchAction.h" 33 #include "third_party/WebKit/public/web/WebTouchAction.h"
31 #include "third_party/WebKit/public/web/WebWidget.h" 34 #include "third_party/WebKit/public/web/WebWidget.h"
32 #include "third_party/WebKit/public/web/WebWidgetClient.h" 35 #include "third_party/WebKit/public/web/WebWidgetClient.h"
(...skipping 26 matching lines...) Expand all
59 } 62 }
60 63
61 namespace cc { class OutputSurface; } 64 namespace cc { class OutputSurface; }
62 65
63 namespace gfx { 66 namespace gfx {
64 class Range; 67 class Range;
65 } 68 }
66 69
67 namespace content { 70 namespace content {
68 class ExternalPopupMenu; 71 class ExternalPopupMenu;
72 class FrameSwapMessageQueue;
69 class PepperPluginInstanceImpl; 73 class PepperPluginInstanceImpl;
70 class RenderFrameImpl; 74 class RenderFrameImpl;
71 class RenderWidgetCompositor; 75 class RenderWidgetCompositor;
72 class RenderWidgetTest; 76 class RenderWidgetTest;
73 class ResizingModeSelector; 77 class ResizingModeSelector;
74 struct ContextMenuParams; 78 struct ContextMenuParams;
75 struct WebPluginGeometry; 79 struct WebPluginGeometry;
76 80
77 // RenderWidget provides a communication bridge between a WebWidget and 81 // RenderWidget provides a communication bridge between a WebWidget and
78 // a RenderWidgetHost, the latter of which lives in a different process. 82 // a RenderWidgetHost, the latter of which lives in a different process.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 void QueueSyntheticGesture( 173 void QueueSyntheticGesture(
170 scoped_ptr<SyntheticGestureParams> gesture_params, 174 scoped_ptr<SyntheticGestureParams> gesture_params,
171 const SyntheticGestureCompletionCallback& callback); 175 const SyntheticGestureCompletionCallback& callback);
172 176
173 // Close the underlying WebWidget. 177 // Close the underlying WebWidget.
174 virtual void Close(); 178 virtual void Close();
175 179
176 // Notifies about a compositor frame commit operation having finished. 180 // Notifies about a compositor frame commit operation having finished.
177 virtual void DidCommitCompositorFrame(); 181 virtual void DidCommitCompositorFrame();
178 182
183 // If the RenderWidget doesn't need a commit this is equivalent to Send,
184 // otherwise this will make sure |msg| is delivered with a frame swap
185 // coresponding to the commit that is about to occur.
186 //
187 // |msg| message to send, ownership of |msg| is transferred.
188 void QueueMessage(IPC::Message* msg, MessageDeliveryPolicy policy);
189
190 template <typename T>
191 void QueueMessage(T* msg) {
192 QueueMessage(msg, MessageDeliveryPolicyLookup<T>::policy);
193 }
194
179 // Handle common setup/teardown for handling IME events. 195 // Handle common setup/teardown for handling IME events.
180 void StartHandlingImeEvent(); 196 void StartHandlingImeEvent();
181 void FinishHandlingImeEvent(); 197 void FinishHandlingImeEvent();
182 198
183 // Returns whether we currently should handle an IME event. 199 // Returns whether we currently should handle an IME event.
184 bool ShouldHandleImeEvent(); 200 bool ShouldHandleImeEvent();
185 201
186 virtual void InstrumentWillBeginFrame(int frame_id) {} 202 virtual void InstrumentWillBeginFrame(int frame_id) {}
187 virtual void InstrumentDidBeginFrame() {} 203 virtual void InstrumentDidBeginFrame() {}
188 virtual void InstrumentDidCancelFrame() {} 204 virtual void InstrumentDidCancelFrame() {}
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 #endif // defined(OS_MACOSX) 696 #endif // defined(OS_MACOSX)
681 697
682 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_; 698 scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_;
683 699
684 // Popups may be displaced when screen metrics emulation is enabled. 700 // Popups may be displaced when screen metrics emulation is enabled.
685 // These values are used to properly adjust popup position. 701 // These values are used to properly adjust popup position.
686 gfx::Point popup_view_origin_for_emulation_; 702 gfx::Point popup_view_origin_for_emulation_;
687 gfx::Point popup_screen_origin_for_emulation_; 703 gfx::Point popup_screen_origin_for_emulation_;
688 float popup_origin_scale_for_emulation_; 704 float popup_origin_scale_for_emulation_;
689 705
706 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
690 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; 707 scoped_ptr<ResizingModeSelector> resizing_mode_selector_;
691 708
692 // A list of swapped out RenderFrames that need to be notified 709 // A list of swapped out RenderFrames that need to be notified
693 // of compositing-related events (e.g. DidCommitCompositorFrame). 710 // of compositing-related events (e.g. DidCommitCompositorFrame).
694 ObserverList<RenderFrameImpl> swapped_out_frames_; 711 ObserverList<RenderFrameImpl> swapped_out_frames_;
695 712
696 ui::MenuSourceType context_menu_source_type_; 713 ui::MenuSourceType context_menu_source_type_;
697 gfx::Point touch_editing_context_menu_location_; 714 gfx::Point touch_editing_context_menu_location_;
698 715
699 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 716 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
700 }; 717 };
701 718
702 } // namespace content 719 } // namespace content
703 720
704 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 721 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698