| OLD | NEW |
| 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 #include "content/public/test/layouttest_support.h" | 5 #include "content/public/test/layouttest_support.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "cc/output/copy_output_request.h" | 16 #include "cc/output/copy_output_request.h" |
| 17 #include "cc/test/pixel_test_output_surface.h" | 17 #include "cc/test/pixel_test_output_surface.h" |
| 18 #include "cc/test/test_compositor_frame_sink.h" | 18 #include "cc/test/test_compositor_frame_sink.h" |
| 19 #include "components/test_runner/test_common.h" | 19 #include "components/test_runner/test_common.h" |
| 20 #include "components/test_runner/web_frame_test_proxy.h" | 20 #include "components/test_runner/web_frame_test_proxy.h" |
| 21 #include "components/test_runner/web_view_test_proxy.h" | 21 #include "components/test_runner/web_view_test_proxy.h" |
| 22 #include "components/test_runner/web_widget_test_proxy.h" | 22 #include "components/test_runner/web_widget_test_proxy.h" |
| 23 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" | 23 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" |
| 24 #include "content/browser/renderer_host/render_process_host_impl.h" | 24 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 25 #include "content/browser/renderer_host/render_widget_host_impl.h" | 25 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 26 #include "content/common/renderer.mojom.h" | 26 #include "content/common/renderer.mojom.h" |
| 27 #include "content/common/site_isolation_policy.h" | 27 #include "content/common/site_isolation_policy.h" |
| 28 #include "content/public/common/page_state.h" | 28 #include "content/public/common/page_state.h" |
| 29 #include "content/public/common/screen_info.h" |
| 29 #include "content/public/renderer/renderer_gamepad_provider.h" | 30 #include "content/public/renderer/renderer_gamepad_provider.h" |
| 30 #include "content/renderer/fetchers/manifest_fetcher.h" | 31 #include "content/renderer/fetchers/manifest_fetcher.h" |
| 31 #include "content/renderer/gpu/render_widget_compositor.h" | 32 #include "content/renderer/gpu/render_widget_compositor.h" |
| 32 #include "content/renderer/history_entry.h" | 33 #include "content/renderer/history_entry.h" |
| 33 #include "content/renderer/history_serialization.h" | 34 #include "content/renderer/history_serialization.h" |
| 34 #include "content/renderer/input/render_widget_input_handler_delegate.h" | 35 #include "content/renderer/input/render_widget_input_handler_delegate.h" |
| 35 #include "content/renderer/layout_test_dependencies.h" | 36 #include "content/renderer/layout_test_dependencies.h" |
| 36 #include "content/renderer/render_frame_impl.h" | 37 #include "content/renderer/render_frame_impl.h" |
| 37 #include "content/renderer/render_thread_impl.h" | 38 #include "content/renderer/render_thread_impl.h" |
| 38 #include "content/renderer/render_view_impl.h" | 39 #include "content/renderer/render_view_impl.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 // This could override the GpuChannel for a CompositorFrameSink that was | 341 // This could override the GpuChannel for a CompositorFrameSink that was |
| 341 // previously being created but in that case the old GpuChannel would be | 342 // previously being created but in that case the old GpuChannel would be |
| 342 // lost as would the CompositorFrameSink. | 343 // lost as would the CompositorFrameSink. |
| 343 gpu_channel_ = gpu_channel; | 344 gpu_channel_ = gpu_channel; |
| 344 | 345 |
| 345 auto* task_runner = deps->GetCompositorImplThreadTaskRunner().get(); | 346 auto* task_runner = deps->GetCompositorImplThreadTaskRunner().get(); |
| 346 bool synchronous_composite = !task_runner; | 347 bool synchronous_composite = !task_runner; |
| 347 if (!task_runner) | 348 if (!task_runner) |
| 348 task_runner = base::ThreadTaskRunnerHandle::Get().get(); | 349 task_runner = base::ThreadTaskRunnerHandle::Get().get(); |
| 349 | 350 |
| 351 ScreenInfo dummy_screen_info; |
| 350 cc::LayerTreeSettings settings = | 352 cc::LayerTreeSettings settings = |
| 351 RenderWidgetCompositor::GenerateLayerTreeSettings( | 353 RenderWidgetCompositor::GenerateLayerTreeSettings( |
| 352 *base::CommandLine::ForCurrentProcess(), deps, 1.f); | 354 *base::CommandLine::ForCurrentProcess(), deps, 1.f, |
| 355 dummy_screen_info); |
| 353 | 356 |
| 354 auto compositor_frame_sink = base::MakeUnique<cc::TestCompositorFrameSink>( | 357 auto compositor_frame_sink = base::MakeUnique<cc::TestCompositorFrameSink>( |
| 355 std::move(compositor_context_provider), | 358 std::move(compositor_context_provider), |
| 356 std::move(worker_context_provider), nullptr /* shared_bitmap_manager */, | 359 std::move(worker_context_provider), nullptr /* shared_bitmap_manager */, |
| 357 gpu_memory_buffer_manager, settings.renderer_settings, task_runner, | 360 gpu_memory_buffer_manager, settings.renderer_settings, task_runner, |
| 358 synchronous_composite, false /* force_disable_reclaim_resources */); | 361 synchronous_composite, false /* force_disable_reclaim_resources */); |
| 359 compositor_frame_sink->SetClient(this); | 362 compositor_frame_sink->SetClient(this); |
| 360 compositor_frame_sinks_[routing_id] = compositor_frame_sink.get(); | 363 compositor_frame_sinks_[routing_id] = compositor_frame_sink.get(); |
| 361 return std::move(compositor_frame_sink); | 364 return std::move(compositor_frame_sink); |
| 362 } | 365 } |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 | 602 |
| 600 void ForceTextInputStateUpdateForRenderFrame(RenderFrame* frame) { | 603 void ForceTextInputStateUpdateForRenderFrame(RenderFrame* frame) { |
| 601 if (auto* render_widget = | 604 if (auto* render_widget = |
| 602 static_cast<RenderFrameImpl*>(frame)->GetRenderWidget()) { | 605 static_cast<RenderFrameImpl*>(frame)->GetRenderWidget()) { |
| 603 render_widget->UpdateTextInputState(ShowIme::IF_NEEDED, | 606 render_widget->UpdateTextInputState(ShowIme::IF_NEEDED, |
| 604 ChangeSource::FROM_NON_IME); | 607 ChangeSource::FROM_NON_IME); |
| 605 } | 608 } |
| 606 } | 609 } |
| 607 | 610 |
| 608 } // namespace content | 611 } // namespace content |
| OLD | NEW |