Skip to content

Commit

Permalink
Convert FrameHostMsg_DidDeleteInProcessInstance to a mojom message
Browse files Browse the repository at this point in the history
FrameHostMsg_DidDeleteInProcessInstance becomes a message on
the PepperIOHost.

BUG=1157519

Change-Id: I05cd8c0faf86ddb27a9b9ac77a09239ff1e7fae8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625999
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843708}
  • Loading branch information
dtapuska authored and Chromium LUCI CQ committed Jan 14, 2021
1 parent dae0583 commit 73f61b4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ bool PepperRendererConnection::OnMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP(PepperRendererConnection, msg)
IPC_MESSAGE_HANDLER(PpapiHostMsg_CreateResourceHostsFromHost,
OnMsgCreateResourceHostsFromHost)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidDeleteInProcessInstance,
OnMsgDidDeleteInProcessInstance)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()

Expand Down Expand Up @@ -242,8 +240,7 @@ void PepperRendererConnection::DidCreateInProcessInstance(
in_process_host_->AddInstance(instance, instance_data);
}

void PepperRendererConnection::OnMsgDidDeleteInProcessInstance(
PP_Instance instance) {
void PepperRendererConnection::DidDeleteInProcessInstance(int32_t instance) {
// 'instance' is possibly invalid. The host must be careful not to trust it.
in_process_host_->DeleteInstance(instance);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ class PepperRendererConnection
PP_Instance instance,
const std::vector<IPC::Message>& nested_msgs);

void OnMsgDidDeleteInProcessInstance(PP_Instance instance);

// mojom::PepperPluginInstanceIOHost overrides;
void DidCreateInProcessInstance(int32_t instance,
int32_t render_frame_id,
const GURL& document_url,
const GURL& plugin_url) override;
void DidDeleteInProcessInstance(int32_t instance) override;

int render_process_id_;

Expand Down
5 changes: 0 additions & 5 deletions content/common/frame_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,6 @@ IPC_SYNC_MESSAGE_CONTROL3_3(FrameHostMsg_OpenChannelToPepperPlugin,
base::ProcessId /* plugin_pid */,
int /* plugin_child_id */)

// Message from the renderer to the browser indicating the in-process instance
// has been destroyed.
IPC_MESSAGE_CONTROL1(FrameHostMsg_DidDeleteInProcessInstance,
int32_t /* instance */)

// Notification that a plugin has created a new plugin instance. The parameters
// indicate:
// - The plugin process ID that we're creating the instance for.
Expand Down
3 changes: 3 additions & 0 deletions content/common/pepper_plugin.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ interface PepperIOHost {
int32 frame_routing_id,
url.mojom.Url document_url,
url.mojom.Url plugin_url);

// Notification that an in-process instance has been destroyed.
DidDeleteInProcessInstance(int32 instance_id);
};

// This interface is used on the renderer IO thread and is received on the
Expand Down
3 changes: 2 additions & 1 deletion content/renderer/pepper/pepper_browser_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ void PepperBrowserConnection::DidCreateInProcessInstance(
}

void PepperBrowserConnection::DidDeleteInProcessInstance(PP_Instance instance) {
Send(new FrameHostMsg_DidDeleteInProcessInstance(instance));
if (auto* io_host = GetIOHost())
io_host->DidDeleteInProcessInstance(instance);
}

void PepperBrowserConnection::SendBrowserCreate(
Expand Down

0 comments on commit 73f61b4

Please sign in to comment.