| // Copyright 2019 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #if defined(__clang__) |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wunused-private-field" |
| #elif defined(_MSC_VER) |
| #pragma warning(push) |
| #pragma warning(disable:4056) |
| #pragma warning(disable:4065) |
| #pragma warning(disable:4756) |
| #endif |
| |
| |
| #include "content/common/renderer.mojom-test-utils.h" |
| |
| #include <utility> |
| |
| #include "base/bind.h" |
| #include "base/run_loop.h" |
| #include "content/common/document_scoped_interface_bundle.mojom.h" |
| #include "content/common/native_types.mojom.h" |
| #include "ipc/constants.mojom.h" |
| #include "mojo/public/mojom/base/time.mojom.h" |
| #include "mojo/public/mojom/base/unguessable_token.mojom.h" |
| #include "services/network/public/mojom/network_types.mojom.h" |
| #include "services/service_manager/public/mojom/service.mojom.h" |
| #include "third_party/blink/public/mojom/renderer_preferences.mojom.h" |
| #include "third_party/blink/public/mojom/service_worker/embedded_worker.mojom.h" |
| #include "third_party/blink/public/mojom/user_agent/user_agent_metadata.mojom.h" |
| #include "ui/gfx/geometry/mojo/geometry.mojom.h" |
| |
| |
| #ifndef CONTENT_COMMON_RENDERER_MOJOM_JUMBO_H_ |
| #define CONTENT_COMMON_RENDERER_MOJOM_JUMBO_H_ |
| #include "content/common/frame_messages.h" |
| #include "content/common/input/input_event_struct_traits.h" |
| #include "content/common/input/touch_action_optional_struct_traits.h" |
| #include "content/common/input_messages.h" |
| #include "content/common/view_messages.h" |
| #include "content/common/widget_messages.h" |
| #include "content/public/common/common_param_traits.h" |
| #include "content/public/common/common_param_traits_macros.h" |
| #include "mojo/public/cpp/base/string16_mojom_traits.h" |
| #include "mojo/public/cpp/base/time_mojom_traits.h" |
| #include "mojo/public/cpp/base/unguessable_token_mojom_traits.h" |
| #include "services/network/public/cpp/network_ipc_param_traits.h" |
| #include "services/network/public/cpp/p2p_param_traits.h" |
| #include "third_party/blink/public/common/user_agent/user_agent_mojom_traits.h" |
| #include "ui/gfx/mojo/font_render_params_struct_traits.h" |
| #endif |
| |
| |
| namespace content { |
| namespace mojom { |
| |
| |
| void RendererInterceptorForTesting::CreateEmbedderRendererService(::service_manager::mojom::ServiceRequest service_request) { |
| GetForwardingInterface()->CreateEmbedderRendererService(std::move(service_request)); |
| } |
| void RendererInterceptorForTesting::CreateView(CreateViewParamsPtr params) { |
| GetForwardingInterface()->CreateView(std::move(params)); |
| } |
| void RendererInterceptorForTesting::CreateFrame(CreateFrameParamsPtr params) { |
| GetForwardingInterface()->CreateFrame(std::move(params)); |
| } |
| void RendererInterceptorForTesting::CreateFrameProxy(int32_t routing_id, int32_t render_view_routing_id, int32_t opener_routing_id, int32_t parent_routing_id, const content::FrameReplicationState& replication_state, const base::UnguessableToken& devtools_frame_token) { |
| GetForwardingInterface()->CreateFrameProxy(std::move(routing_id), std::move(render_view_routing_id), std::move(opener_routing_id), std::move(parent_routing_id), std::move(replication_state), std::move(devtools_frame_token)); |
| } |
| void RendererInterceptorForTesting::SetUpEmbeddedWorkerChannelForServiceWorker(::blink::mojom::EmbeddedWorkerInstanceClientRequest client_request) { |
| GetForwardingInterface()->SetUpEmbeddedWorkerChannelForServiceWorker(std::move(client_request)); |
| } |
| void RendererInterceptorForTesting::OnNetworkConnectionChanged(net::NetworkChangeNotifier::ConnectionType connection_type, double max_bandwidth_mbps) { |
| GetForwardingInterface()->OnNetworkConnectionChanged(std::move(connection_type), std::move(max_bandwidth_mbps)); |
| } |
| void RendererInterceptorForTesting::OnNetworkQualityChanged(net::EffectiveConnectionType effective_connection_type, base::TimeDelta http_rtt, base::TimeDelta transport_rtt, double bandwidth_kbps) { |
| GetForwardingInterface()->OnNetworkQualityChanged(std::move(effective_connection_type), std::move(http_rtt), std::move(transport_rtt), std::move(bandwidth_kbps)); |
| } |
| void RendererInterceptorForTesting::SetWebKitSharedTimersSuspended(bool suspend) { |
| GetForwardingInterface()->SetWebKitSharedTimersSuspended(std::move(suspend)); |
| } |
| void RendererInterceptorForTesting::SetUserAgent(const std::string& user_agent) { |
| GetForwardingInterface()->SetUserAgent(std::move(user_agent)); |
| } |
| void RendererInterceptorForTesting::SetUserAgentMetadata(const blink::UserAgentMetadata& metadata) { |
| GetForwardingInterface()->SetUserAgentMetadata(std::move(metadata)); |
| } |
| void RendererInterceptorForTesting::UpdateScrollbarTheme(UpdateScrollbarThemeParamsPtr params) { |
| GetForwardingInterface()->UpdateScrollbarTheme(std::move(params)); |
| } |
| void RendererInterceptorForTesting::OnSystemColorsChanged(int32_t aqua_color_variant, const std::string& highlight_text_color, const std::string& highlight_color) { |
| GetForwardingInterface()->OnSystemColorsChanged(std::move(aqua_color_variant), std::move(highlight_text_color), std::move(highlight_color)); |
| } |
| void RendererInterceptorForTesting::PurgePluginListCache(bool reload_pages) { |
| GetForwardingInterface()->PurgePluginListCache(std::move(reload_pages)); |
| } |
| void RendererInterceptorForTesting::SetProcessState(RenderProcessState process_state) { |
| GetForwardingInterface()->SetProcessState(std::move(process_state)); |
| } |
| void RendererInterceptorForTesting::SetSchedulerKeepActive(bool keep_active) { |
| GetForwardingInterface()->SetSchedulerKeepActive(std::move(keep_active)); |
| } |
| void RendererInterceptorForTesting::SetIsLockedToSite() { |
| GetForwardingInterface()->SetIsLockedToSite(); |
| } |
| void RendererInterceptorForTesting::EnableV8LowMemoryMode() { |
| GetForwardingInterface()->EnableV8LowMemoryMode(); |
| } |
| RendererAsyncWaiter::RendererAsyncWaiter( |
| Renderer* proxy) : proxy_(proxy) {} |
| |
| RendererAsyncWaiter::~RendererAsyncWaiter() = default; |
| |
| |
| |
| |
| |
| |
| } // namespace mojom |
| } // namespace content |
| |
| #if defined(__clang__) |
| #pragma clang diagnostic pop |
| #elif defined(_MSC_VER) |
| #pragma warning(pop) |
| #endif |