Chromium Code Reviews| Index: content/browser/frame_host/cross_process_frame_connector.h |
| diff --git a/content/browser/frame_host/cross_process_frame_connector.h b/content/browser/frame_host/cross_process_frame_connector.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f2c324d875ba8c859c89dcae736e7009304a4cb0 |
| --- /dev/null |
| +++ b/content/browser/frame_host/cross_process_frame_connector.h |
| @@ -0,0 +1,81 @@ |
| +// Copyright (c) 2013 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_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
| +#define CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
| + |
| +#include "cc/output/compositor_frame.h" |
| +#include "ui/gfx/rect.h" |
| + |
| +namespace IPC { |
| +class Message; |
| +} |
| + |
| +struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
| + |
| +namespace content { |
| +class RenderFrameHostImpl; |
| +class RenderWidgetHostImpl; |
| +class RenderWidgetHostViewChildFrame; |
| + |
| +// ----------------------------------------------------------------------------- |
| +// CrossProcessFrameConnector contains cached state information between a parent |
| +// frame and an embedded child frame that are rendered in separate processes. |
| +// It passes messages between them if it cannot handle the message within the |
| +// browser process. It is owned by the child frame's RenderFrameHostManager. |
| +// ----------------------------------------------------------------------------- |
| +class CrossProcessFrameConnector { |
|
Charlie Reis
2013/12/16 21:35:32
Ok, Albert tried to explain this class to me, and
awong
2013/12/17 00:44:14
I rewrote the comment. Left a TODO for ken to veri
|
| + public: |
| + virtual ~CrossProcessFrameConnector(); |
| + |
| + static CrossProcessFrameConnector* CreateCrossProcessFrameConnector( |
|
awong
2013/12/14 02:25:14
Why bother with the creation method?
awong
2013/12/17 00:44:14
Done.
|
| + RenderFrameHostImpl* frame_proxy_to_parent_renderer); |
| + |
| + void Destroy(); |
| + |
| + bool OnMessageReceived(const IPC::Message &msg); |
| + |
| + void SetView(RenderWidgetHostViewChildFrame* view); |
| + |
| + // 'Platform' functionality exposed to RenderWidgetHostViewChildFrame. |
| + // These methods can forward messages to the child frame proxy in the parent |
| + // frame renderer or attempt to handle them within the browser process. |
| + void ChildFrameBuffersSwapped( |
| + const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
| + int gpu_host_id); |
| + |
| + void ChildFrameCompositorFrameSwapped( |
| + uint32 output_surface_id, |
| + scoped_ptr<cc::CompositorFrame> frame); |
| + |
| + gfx::Rect ChildFrameRect(); |
| + |
| + private: |
| + CrossProcessFrameConnector( |
| + RenderFrameHostImpl* frame_proxy_to_parent_renderer); |
|
awong
2013/12/14 02:25:14
explicit
awong
2013/12/17 00:44:14
Done.
|
| + |
| + // Handlers for messages received from the parent frame. |
| + void OnBuffersSwappedACK(std::string mailbox_name, |
| + int route_id, |
| + int gpu_host_id, |
| + uint32 sync_point); |
| + |
| + // The RenderFrameHostProxy that routes messages to the parent frame's |
|
nasko
2013/12/16 23:16:32
nit: RenderFrameHostProxy doesn't exist yet. Did y
awong
2013/12/17 00:44:14
Done.
|
| + // renderer process. Initially NULL. |
| + // TODO(kenrb): The type becomes RenderFrameProxyHost when that class comes |
| + // to exist. |
| + RenderFrameHostImpl* frame_proxy_to_parent_renderer_; |
| + |
| + // The RenderWidgetHost for the child_frame. There is at most one |
| + // RenderWidgetHost per frame because RenderFrameProxyHosts do |
| + // not require widgets. |
| + RenderWidgetHostImpl* child_frame_widget_; |
| + |
| + gfx::Rect child_frame_rect_; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
| + |