// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_WIDGET_INPUT_FRAME_WIDGET_INPUT_HANDLER_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_WIDGET_INPUT_FRAME_WIDGET_INPUT_HANDLER_IMPL_H_ #include "third_party/blink/public/mojom/input/input_handler.mojom-blink.h" #include "third_party/blink/public/mojom/input/stylus_writing_gesture.mojom-blink.h" #include "third_party/blink/renderer/platform/platform_export.h" namespace blink { class MainThreadEventQueue; class WidgetBase; // This class provides an implementation of FrameWidgetInputHandler mojo // interface. When a compositor thread is being used in the renderer the mojo // channel is bound on the compositor thread. Method calls, and events received // on the compositor thread are then placed in the MainThreadEventQueue for the // associated WidgetBase. This is done as to ensure that input related // messages and events that are handled on the compositor thread aren't // executed before other input events that need to be processed on the // main thread. ie. Since some messages flow to the compositor thread // all input needs to flow there so the ordering of events is kept in sequence. // // eg. (B = Browser, CT = Compositor Thread, MT = Main Thread) // B sends MouseEvent // B sends Copy message // CT receives MouseEvent (CT might do something with the MouseEvent) // CT places MouseEvent in MainThreadEventQueue // CT receives Copy message (CT has no use for the Copy message) // CT places Copy message in MainThreadEventQueue // MT receives MouseEvent // MT receives Copy message // // When a compositor thread isn't used the mojo channel is just bound // on the main thread and messages are handled right away. class PLATFORM_EXPORT FrameWidgetInputHandlerImpl : public mojom::blink::FrameWidgetInputHandler { … }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_WIDGET_INPUT_FRAME_WIDGET_INPUT_HANDLER_IMPL_H_