Commit 60e79ccb authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Change FrameMsg_ViewChanged to be RenderFrameProxy message

This CL allows us to remove  content/common/frame_message_structs.cc|h
as well as to clean up references to FrameMsg_ViewChanged_Params in
content/common/content_param_traits.cc|h.

BUG=1051135
R=dtapuska@chromium.org, haraken@chromium.org, kinuko@chromium.org

Change-Id: I175b6412452b09ffc15083be305dee31a69584f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062091
Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742603}
parent d43bb632
......@@ -123,10 +123,8 @@ void CrossProcessFrameConnector::SetView(RenderWidgetHostViewChildFrame* view) {
view_->SetFrameConnectorDelegate(this);
if (visibility_ != blink::mojom::FrameVisibility::kRenderedInViewport)
OnVisibilityChanged(visibility_);
FrameMsg_ViewChanged_Params params;
params.frame_sink_id = view_->GetFrameSinkId();
frame_proxy_in_parent_renderer_->Send(new FrameMsg_ViewChanged(
frame_proxy_in_parent_renderer_->GetRoutingID(), params));
frame_proxy_in_parent_renderer_->GetAssociatedRenderFrameProxy()
->SetFrameSinkId(view_->GetFrameSinkId());
}
}
......
......@@ -106,8 +106,6 @@ source_set("common") {
"font_list_mac.mm",
"font_list_win.cc",
"frame_delete_intention.h",
"frame_message_structs.cc",
"frame_message_structs.h",
"frame_messages.h",
"frame_messages_forward.h",
"frame_owner_properties.cc",
......
......@@ -14,7 +14,6 @@
#include "components/viz/common/surfaces/surface_id.h"
#include "components/viz/common/surfaces/surface_info.h"
#include "content/common/content_to_visible_time_reporter.h"
#include "content/common/frame_message_structs.h"
#include "ipc/ipc_mojo_message_helper.h"
#include "ipc/ipc_mojo_param_traits.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
......@@ -144,35 +143,6 @@ bool ParamTraits<ui::AXMode>::Read(const base::Pickle* m,
void ParamTraits<ui::AXMode>::Log(const param_type& p, std::string* l) {}
// static
void ParamTraits<content::FrameMsg_ViewChanged_Params>::Write(
base::Pickle* m,
const param_type& p) {
DCHECK(p.frame_sink_id.is_valid());
WriteParam(m, p.frame_sink_id);
}
bool ParamTraits<content::FrameMsg_ViewChanged_Params>::Read(
const base::Pickle* m,
base::PickleIterator* iter,
param_type* r) {
if (!ReadParam(m, iter, &(r->frame_sink_id)))
return false;
if (!r->frame_sink_id.is_valid()) {
NOTREACHED();
return false;
}
return true;
}
// static
void ParamTraits<content::FrameMsg_ViewChanged_Params>::Log(const param_type& p,
std::string* l) {
l->append("(");
LogParam(p.frame_sink_id, l);
l->append(")");
}
template <>
struct ParamTraits<blink::mojom::SerializedBlobPtr> {
using param_type = blink::mojom::SerializedBlobPtr;
......
......@@ -29,7 +29,6 @@ struct TransferableMessage;
}
namespace content {
struct FrameMsg_ViewChanged_Params;
struct RecordContentToVisibleTimeRequest;
}
......@@ -95,16 +94,6 @@ struct CONTENT_EXPORT ParamTraits<
static void Log(const param_type& p, std::string* l);
};
template <>
struct CONTENT_EXPORT ParamTraits<content::FrameMsg_ViewChanged_Params> {
using param_type = content::FrameMsg_ViewChanged_Params;
static void Write(base::Pickle* m, const param_type& p);
static bool Read(const base::Pickle* m,
base::PickleIterator* iter,
param_type* p);
static void Log(const param_type& p, std::string* l);
};
template <>
struct CONTENT_EXPORT ParamTraits<viz::FrameSinkId> {
typedef viz::FrameSinkId param_type;
......
// Copyright 2018 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.
#include "content/common/frame_message_structs.h"
namespace content {
FrameMsg_ViewChanged_Params::FrameMsg_ViewChanged_Params() = default;
FrameMsg_ViewChanged_Params::~FrameMsg_ViewChanged_Params() = default;
} // namespace content
// Copyright 2018 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.
#ifndef CONTENT_COMMON_FRAME_MESSAGE_STRUCTS_H_
#define CONTENT_COMMON_FRAME_MESSAGE_STRUCTS_H_
#include "components/viz/common/surfaces/frame_sink_id.h"
#include "content/common/content_export.h"
namespace content {
struct CONTENT_EXPORT FrameMsg_ViewChanged_Params {
FrameMsg_ViewChanged_Params();
~FrameMsg_ViewChanged_Params();
viz::FrameSinkId frame_sink_id;
};
} // namespace content
#endif // CONTENT_COMMON_FRAME_MESSAGE_STRUCTS_H_
......@@ -24,7 +24,6 @@
#include "content/common/content_export.h"
#include "content/common/content_param_traits.h"
#include "content/common/frame_delete_intention.h"
#include "content/common/frame_message_structs.h"
#include "content/common/frame_owner_properties.h"
#include "content/common/frame_replication_state.h"
#include "content/common/frame_visual_properties.h"
......@@ -571,11 +570,6 @@ IPC_MESSAGE_ROUTED2(FrameMsg_DidUpdateName,
IPC_MESSAGE_ROUTED1(FrameMsg_EnforceInsecureRequestPolicy,
blink::WebInsecureRequestPolicy)
// Notifies RenderFrameProxy that its associated RenderWidgetHostView has
// changed.
IPC_MESSAGE_ROUTED1(FrameMsg_ViewChanged,
content::FrameMsg_ViewChanged_Params /* params */)
// Send to the RenderFrame to set text tracks state and style settings.
// Sent for top-level frames.
IPC_MESSAGE_ROUTED1(FrameMsg_SetTextTrackSettings,
......
......@@ -6,6 +6,7 @@ module content.mojom;
import "ui/gfx/geometry/mojom/geometry.mojom";
import "content/common/render_frame_metadata.mojom";
import "services/viz/public/mojom/compositing/frame_sink_id.mojom";
// Mojo interface for communicating from RenderFrameProxy to
// RenderFrameProxyHost. Implemented by the browser process, called by renderer
......@@ -32,4 +33,9 @@ interface RenderFrameProxy {
// Informs the completion of an autoresize transaction from the parent
// renderer and updates with the provided viz::LocalSurfaceId.
DidUpdateVisualProperties(RenderFrameMetadata metadata);
// This function notifies the remote frame that its associated
// compositing destination (RenderWidgetHostView) has changed.
SetFrameSinkId(viz.mojom.FrameSinkId frame_sink_id);
};
......@@ -13,7 +13,6 @@
#include "base/lazy_instance.h"
#include "components/viz/common/surfaces/local_surface_id_allocation.h"
#include "content/common/content_switches_internal.h"
#include "content/common/frame_message_structs.h"
#include "content/common/frame_owner_properties.h"
#include "content/common/frame_replication_state.h"
#include "content/common/input_messages.h"
......@@ -375,7 +374,6 @@ bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderFrameProxy, msg)
IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener)
IPC_MESSAGE_HANDLER(FrameMsg_ViewChanged, OnViewChanged)
IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateName, OnDidUpdateName)
IPC_MESSAGE_HANDLER(FrameMsg_EnforceInsecureRequestPolicy,
OnEnforceInsecureRequestPolicy)
......@@ -427,11 +425,6 @@ void RenderFrameProxy::DidStartLoading() {
web_frame_->DidStartLoading();
}
void RenderFrameProxy::OnViewChanged(
const FrameMsg_ViewChanged_Params& params) {
FrameSinkIdChanged(params.frame_sink_id);
}
void RenderFrameProxy::OnDidUpdateName(const std::string& name,
const std::string& unique_name) {
web_frame_->SetReplicatedName(blink::WebString::FromUTF8(name));
......@@ -487,6 +480,10 @@ void RenderFrameProxy::DisableAutoResize() {
SynchronizeVisualProperties();
}
void RenderFrameProxy::SetFrameSinkId(const viz::FrameSinkId& frame_sink_id) {
FrameSinkIdChanged(frame_sink_id);
}
void RenderFrameProxy::SynchronizeVisualProperties() {
DCHECK(ancestor_render_widget_);
......
......@@ -223,7 +223,6 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener,
void OnDeleteProxy();
void OnCompositorFrameSwapped(const IPC::Message& message);
void OnUpdateOpener(int opener_routing_id);
void OnViewChanged(const FrameMsg_ViewChanged_Params& params);
void OnDidUpdateName(const std::string& name, const std::string& unique_name);
void OnEnforceInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy);
void OnSetFrameOwnerProperties(const FrameOwnerProperties& properties);
......@@ -236,6 +235,7 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener,
void DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) override;
void ChildProcessGone() override;
void SetFrameSinkId(const viz::FrameSinkId& frame_sink_id) override;
// ChildFrameCompositor:
cc::Layer* GetLayer() override;
......
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