Commit ac35203e authored by fsamuel's avatar fsamuel Committed by Commit bot

Cleanup BrowserPluginGuest::SwapCompositorFrame

BUG=330264

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

Cr-Commit-Position: refs/heads/master@{#295891}
parent ba729da9
......@@ -320,12 +320,6 @@ void BrowserPluginGuest::SwapCompositorFrame(
int host_process_id,
int host_routing_id,
scoped_ptr<cc::CompositorFrame> frame) {
if (!attached()) {
// If the guest doesn't have an embedder then there's nothing to give the
// the frame to.
return;
}
cc::RenderPass* root_pass =
frame->delegated_frame_data->render_pass_list.back();
gfx::Size view_size(gfx::ToFlooredSize(gfx::ScaleSize(
......@@ -337,30 +331,11 @@ void BrowserPluginGuest::SwapCompositorFrame(
last_seen_view_size_ = view_size;
}
base::SharedMemoryHandle software_frame_handle =
base::SharedMemory::NULLHandle();
if (frame->software_frame_data) {
cc::SoftwareFrameData* frame_data = frame->software_frame_data.get();
scoped_ptr<cc::SharedBitmap> bitmap =
HostSharedBitmapManager::current()->GetSharedBitmapFromId(
frame_data->size, frame_data->bitmap_id);
if (!bitmap)
return;
RenderWidgetHostView* embedder_rwhv =
GetEmbedderRenderWidgetHostView();
base::ProcessHandle embedder_pid =
embedder_rwhv->GetRenderWidgetHost()->GetProcess()->GetHandle();
bitmap->memory()->ShareToProcess(embedder_pid, &software_frame_handle);
}
FrameMsg_CompositorFrameSwapped_Params guest_params;
frame->AssignTo(&guest_params.frame);
guest_params.output_surface_id = output_surface_id;
guest_params.producing_route_id = host_routing_id;
guest_params.producing_host_id = host_process_id;
guest_params.shared_memory_handle = software_frame_handle;
SendMessageToEmbedder(
new BrowserPluginMsg_CompositorFrameSwapped(
......
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