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

Unified Diff: content/renderer/render_widget.h

Issue 2813683002: Allow MainThreadEventQueue to call the RenderWidget directly. (Closed)
Patch Set: Fix style nits Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.h
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 78d5b3fa9966c00e617d91f79135240f91379f46..ed16377ea7ec1df0ab0b0924cce62893a9676a40 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -33,6 +33,7 @@
#include "content/public/common/screen_info.h"
#include "content/renderer/devtools/render_widget_screen_metrics_emulator_delegate.h"
#include "content/renderer/gpu/render_widget_compositor_delegate.h"
+#include "content/renderer/input/main_thread_event_queue.h"
#include "content/renderer/input/render_widget_input_handler.h"
#include "content/renderer/input/render_widget_input_handler_delegate.h"
#include "content/renderer/message_delivery_policy.h"
@@ -101,6 +102,7 @@ class CompositorDependencies;
class ExternalPopupMenu;
class FrameSwapMessageQueue;
class ImeEventGuard;
+class MainThreadEventQueue;
class PepperPluginInstanceImpl;
class RenderFrameImpl;
class RenderFrameProxy;
@@ -128,7 +130,8 @@ class CONTENT_EXPORT RenderWidget
public RenderWidgetCompositorDelegate,
public RenderWidgetInputHandlerDelegate,
public RenderWidgetScreenMetricsEmulatorDelegate,
- public base::RefCounted<RenderWidget> {
+ public base::RefCounted<RenderWidget>,
+ public MainThreadEventQueueClient {
public:
// Creates a new RenderWidget for a popup. |opener| is the RenderView that
// this widget lives inside.
@@ -228,9 +231,6 @@ class CONTENT_EXPORT RenderWidget
// IPC::Sender
bool Send(IPC::Message* msg) override;
- // Requests a BeginMainFrame callback from the compositor.
- void SetNeedsMainFrame();
-
// RenderWidgetCompositorDelegate
void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta,
const gfx::Vector2dF& outer_delta,
@@ -264,9 +264,6 @@ class CONTENT_EXPORT RenderWidget
void OnDidHandleKeyEvent() override;
void OnDidOverscroll(const ui::DidOverscrollParams& params) override;
void OnInputEventAck(std::unique_ptr<InputEventAck> input_event_ack) override;
- void NotifyInputEventHandled(blink::WebInputEvent::Type handled_type,
- blink::WebInputEventResult result,
- InputEventAckState ack_result) override;
void SetInputHandler(RenderWidgetInputHandler* input_handler) override;
void ShowVirtualKeyboard() override;
void UpdateTextInputState() override;
@@ -416,6 +413,20 @@ class CONTENT_EXPORT RenderWidget
uint32_t GetContentSourceId();
void IncrementContentSourceId();
+ // MainThreadEventQueueClient overrides.
+
+ // Requests a BeginMainFrame callback from the compositor.
+ void SetNeedsMainFrame() override;
+
+ InputEventAckState HandleInputEvent(
+ const blink::WebCoalescedInputEvent& input_event,
+ const ui::LatencyInfo& latency_info,
+ InputEventDispatchType dispatch_type) override;
+
+ void SendInputEventAck(blink::WebInputEvent::Type type,
+ InputEventAckState ack_result,
+ uint32_t touch_event_id) override;
+
protected:
// Friend RefCounted so that the dtor can be non-public. Using this class
// without ref-counting is an error.
@@ -868,6 +879,8 @@ class CONTENT_EXPORT RenderWidget
// to replace it. See https://crbug.com/695579.
uint32_t current_content_source_id_;
+ scoped_refptr<MainThreadEventQueue> input_event_queue_;
+
base::WeakPtrFactory<RenderWidget> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderWidget);
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698