From 1612da9cfa90f8130e80a72bff381d8bfd68b7ef Mon Sep 17 00:00:00 2001 From: "piman@chromium.org" Date: Fri, 14 Feb 2014 00:36:32 +0000 Subject: Use gpu::Mailbox instead of std:string in IPCs - easier to read - safer since gpu::Mailbox is constant size and checked in the ParamTraits BUG=None Review URL: https://codereview.chromium.org/148003006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251207 0039d316-1c4b-4281-b951-d872f2087c98 --- content/renderer/browser_plugin/browser_plugin.cc | 2 +- content/renderer/child_frame_compositing_helper.cc | 8 +++----- content/renderer/child_frame_compositing_helper.h | 2 +- content/renderer/render_frame_impl.cc | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) (limited to 'content/renderer') diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc index 974c3b0..3d20a6e 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc @@ -437,7 +437,7 @@ void BrowserPlugin::OnBuffersSwapped( EnableCompositing(true); compositing_helper_->OnBuffersSwapped(params.size, - params.mailbox_name, + params.mailbox, params.gpu_route_id, params.gpu_host_id, GetDeviceScaleFactor()); diff --git a/content/renderer/child_frame_compositing_helper.cc b/content/renderer/child_frame_compositing_helper.cc index 15cf383..cc3bc50 100644 --- a/content/renderer/child_frame_compositing_helper.cc +++ b/content/renderer/child_frame_compositing_helper.cc @@ -246,12 +246,10 @@ void ChildFrameCompositingHelper::MailboxReleased(SwapBuffersInfo mailbox, ack_pending_ = false; switch (mailbox.type) { case TEXTURE_IMAGE_TRANSPORT: { - std::string mailbox_name(reinterpret_cast(mailbox.name.name), - sizeof(mailbox.name.name)); FrameHostMsg_BuffersSwappedACK_Params params; params.gpu_host_id = mailbox.host_id; params.gpu_route_id = mailbox.route_id; - params.mailbox_name = mailbox_name; + params.mailbox = mailbox.name; params.sync_point = sync_point; SendBuffersSwappedACKToBrowser(params); break; @@ -378,12 +376,12 @@ void ChildFrameCompositingHelper::OnBuffersSwappedPrivate( void ChildFrameCompositingHelper::OnBuffersSwapped( const gfx::Size& size, - const std::string& mailbox_name, + const gpu::Mailbox& mailbox, int gpu_route_id, int gpu_host_id, float device_scale_factor) { SwapBuffersInfo swap_info; - swap_info.name.SetName(reinterpret_cast(mailbox_name.data())); + swap_info.name = mailbox; swap_info.type = TEXTURE_IMAGE_TRANSPORT; swap_info.size = size; swap_info.route_id = gpu_route_id; diff --git a/content/renderer/child_frame_compositing_helper.h b/content/renderer/child_frame_compositing_helper.h index 686d9a2..1ec0585 100644 --- a/content/renderer/child_frame_compositing_helper.h +++ b/content/renderer/child_frame_compositing_helper.h @@ -69,7 +69,7 @@ class CONTENT_EXPORT ChildFrameCompositingHelper void EnableCompositing(bool); void OnContainerDestroy(); void OnBuffersSwapped(const gfx::Size& size, - const std::string& mailbox_name, + const gpu::Mailbox& mailbox, int gpu_route_id, int gpu_host_id, float device_scale_factor); diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 1b13f68..af5e0d5 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -487,7 +487,7 @@ void RenderFrameImpl::OnBuffersSwapped( } compositing_helper_->OnBuffersSwapped( params.size, - params.mailbox_name, + params.mailbox, params.gpu_route_id, params.gpu_host_id, render_view_->GetWebView()->deviceScaleFactor()); -- cgit v1.1