Commit b6685cf4 authored by Henrique Ferreiro's avatar Henrique Ferreiro Committed by Commit Bot

Migrate input_injector.mojom to the new Mojo types

Convert the implementation and all users of the
content::mojom::InputInjector interface.

Bug: 955171
Change-Id: I2950bd5d4f0770a4714fead2033ba578e5be639b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807498Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Cr-Commit-Position: refs/heads/master@{#697566}
parent ec6520a7
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
#include "base/bind.h" #include "base/bind.h"
#include "content/browser/renderer_host/input/synthetic_gesture.h" #include "content/browser/renderer_host/input/synthetic_gesture.h"
#include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_impl.h"
#include "mojo/public/cpp/bindings/strong_binding.h" #include "content/common/input/input_injector.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
namespace content { namespace content {
...@@ -29,10 +31,11 @@ InputInjectorImpl::InputInjectorImpl( ...@@ -29,10 +31,11 @@ InputInjectorImpl::InputInjectorImpl(
InputInjectorImpl::~InputInjectorImpl() {} InputInjectorImpl::~InputInjectorImpl() {}
void InputInjectorImpl::Create(base::WeakPtr<RenderFrameHostImpl> frame_host, void InputInjectorImpl::Create(
mojom::InputInjectorRequest request) { base::WeakPtr<RenderFrameHostImpl> frame_host,
mojo::MakeStrongBinding(std::make_unique<InputInjectorImpl>(frame_host), mojo::PendingReceiver<mojom::InputInjector> receiver) {
std::move(request)); mojo::MakeSelfOwnedReceiver(std::make_unique<InputInjectorImpl>(frame_host),
std::move(receiver));
} }
void InputInjectorImpl::QueueSyntheticSmoothDrag( void InputInjectorImpl::QueueSyntheticSmoothDrag(
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/input/synthetic_gesture.h" #include "content/browser/renderer_host/input/synthetic_gesture.h"
#include "content/common/input/input_injector.mojom.h" #include "content/common/input/input_injector.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
namespace content { namespace content {
...@@ -20,7 +21,7 @@ class CONTENT_EXPORT InputInjectorImpl : public mojom::InputInjector { ...@@ -20,7 +21,7 @@ class CONTENT_EXPORT InputInjectorImpl : public mojom::InputInjector {
~InputInjectorImpl() override; ~InputInjectorImpl() override;
static void Create(base::WeakPtr<RenderFrameHostImpl> frame_host, static void Create(base::WeakPtr<RenderFrameHostImpl> frame_host,
mojom::InputInjectorRequest request); mojo::PendingReceiver<mojom::InputInjector> receiver);
// mojom::InputInjector overrides. // mojom::InputInjector overrides.
void QueueSyntheticSmoothDrag( void QueueSyntheticSmoothDrag(
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "cc/paint/skia_paint_canvas.h" #include "cc/paint/skia_paint_canvas.h"
#include "cc/trees/layer_tree_host.h" #include "cc/trees/layer_tree_host.h"
#include "content/common/input/actions_parser.h" #include "content/common/input/actions_parser.h"
#include "content/common/input/input_injector.mojom.h"
#include "content/common/input/synthetic_gesture_params.h" #include "content/common/input/synthetic_gesture_params.h"
#include "content/common/input/synthetic_pinch_gesture_params.h" #include "content/common/input/synthetic_pinch_gesture_params.h"
#include "content/common/input/synthetic_pointer_action_list_params.h" #include "content/common/input/synthetic_pointer_action_list_params.h"
...@@ -44,6 +45,7 @@ ...@@ -44,6 +45,7 @@
#include "gin/object_template_builder.h" #include "gin/object_template_builder.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h" #include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "gpu/ipc/common/gpu_messages.h" #include "gpu/ipc/common/gpu_messages.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/service_manager/public/cpp/interface_provider.h" #include "services/service_manager/public/cpp/interface_provider.h"
#include "third_party/blink/public/platform/web_mouse_event.h" #include "third_party/blink/public/platform/web_mouse_event.h"
#include "third_party/blink/public/web/blink.h" #include "third_party/blink/public/web/blink.h"
...@@ -304,7 +306,7 @@ bool ThrowIfPointOutOfBounds(GpuBenchmarkingContext* context, ...@@ -304,7 +306,7 @@ bool ThrowIfPointOutOfBounds(GpuBenchmarkingContext* context,
bool BeginSmoothScroll(GpuBenchmarkingContext* context, bool BeginSmoothScroll(GpuBenchmarkingContext* context,
gin::Arguments* args, gin::Arguments* args,
mojom::InputInjectorPtr& injector, const mojo::Remote<mojom::InputInjector>& injector,
float pixels_to_scroll, float pixels_to_scroll,
v8::Local<v8::Function> callback, v8::Local<v8::Function> callback,
int gesture_source_type, int gesture_source_type,
...@@ -408,7 +410,7 @@ bool BeginSmoothScroll(GpuBenchmarkingContext* context, ...@@ -408,7 +410,7 @@ bool BeginSmoothScroll(GpuBenchmarkingContext* context,
bool BeginSmoothDrag(GpuBenchmarkingContext* context, bool BeginSmoothDrag(GpuBenchmarkingContext* context,
gin::Arguments* args, gin::Arguments* args,
mojom::InputInjectorPtr& injector, const mojo::Remote<mojom::InputInjector>& injector,
float start_x, float start_x,
float start_y, float start_y,
float end_x, float end_x,
...@@ -557,9 +559,9 @@ GpuBenchmarking::~GpuBenchmarking() {} ...@@ -557,9 +559,9 @@ GpuBenchmarking::~GpuBenchmarking() {}
void GpuBenchmarking::EnsureRemoteInterface() { void GpuBenchmarking::EnsureRemoteInterface() {
if (!input_injector_) { if (!input_injector_) {
render_frame_->GetRemoteInterfaces()->GetInterface(mojo::MakeRequest( render_frame_->GetRemoteInterfaces()->GetInterface(
&input_injector_, input_injector_.BindNewPipeAndPassReceiver(
render_frame_->GetTaskRunner(blink::TaskType::kInternalDefault))); render_frame_->GetTaskRunner(blink::TaskType::kInternalDefault)));
} }
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "content/common/input/input_injector.mojom.h" #include "content/common/input/input_injector.mojom.h"
#include "gin/wrappable.h" #include "gin/wrappable.h"
#include "mojo/public/cpp/bindings/remote.h"
namespace gin { namespace gin {
class Arguments; class Arguments;
...@@ -99,7 +100,7 @@ class GpuBenchmarking : public gin::Wrappable<GpuBenchmarking> { ...@@ -99,7 +100,7 @@ class GpuBenchmarking : public gin::Wrappable<GpuBenchmarking> {
bool AddSwapCompletionEventListener(gin::Arguments* args); bool AddSwapCompletionEventListener(gin::Arguments* args);
RenderFrameImpl* render_frame_; RenderFrameImpl* render_frame_;
mojom::InputInjectorPtr input_injector_; mojo::Remote<mojom::InputInjector> input_injector_;
DISALLOW_COPY_AND_ASSIGN(GpuBenchmarking); DISALLOW_COPY_AND_ASSIGN(GpuBenchmarking);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment