aw: Provide main thread input filtering and enable the Blink scheduler

Currently, WebView does not use the existing InputEventFilter as it
performs synchronous input handling on the compositor thread. As the
InputEventFilter provides event delegation to the compositor task
runner, this also means input events on WebView are not properly routed
to the Blink scheduler.

As an intermediate workaround, provide a fallback
MainThreadInputEventFilter used whenever the (compositor)
InputEventFilter is not installed. Note that this handles the WebView
case as well as the case where threaded compositing is completely
disabled.

BUG=431598

Review URL: https://codereview.chromium.org/716783002

Cr-Commit-Position: refs/heads/master@{#306448}
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h
index ef93741..8dd52978 100644
--- a/content/renderer/render_thread_impl.h
+++ b/content/renderer/render_thread_impl.h
@@ -9,6 +9,7 @@
 #include <string>
 #include <vector>
 
+#include "base/cancelable_callback.h"
 #include "base/memory/memory_pressure_listener.h"
 #include "base/metrics/user_metrics_action.h"
 #include "base/observer_list.h"
@@ -86,7 +87,6 @@
 class EmbeddedWorkerDispatcher;
 class GpuChannelHost;
 class IndexedDBDispatcher;
-class InputEventFilter;
 class InputHandlerManager;
 class MediaStreamCenter;
 class MemoryObserver;
@@ -547,8 +547,8 @@
   // regardless of whether |compositor_thread_| is overriden.
   scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy_;
 
-  // May be null if unused by the |input_handler_manager_|.
-  scoped_refptr<InputEventFilter> input_event_filter_;
+  base::CancelableCallback<void(const IPC::Message&)> main_input_callback_;
+  scoped_refptr<IPC::MessageFilter> input_event_filter_;
   scoped_ptr<InputHandlerManager> input_handler_manager_;
   scoped_refptr<CompositorForwardingMessageFilter> compositor_message_filter_;