OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
7 | 7 |
8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 class WebInputEvent; | 12 class WebInputEvent; |
13 } | 13 } |
14 | 14 |
15 namespace IPC { | 15 namespace IPC { |
16 class Message; | 16 class Message; |
17 } | 17 } |
18 | 18 |
19 struct FrameHostMsg_BuffersSwappedACK_Params; | |
20 struct FrameHostMsg_CompositorFrameSwappedACK_Params; | 19 struct FrameHostMsg_CompositorFrameSwappedACK_Params; |
21 struct FrameHostMsg_ReclaimCompositorResources_Params; | 20 struct FrameHostMsg_ReclaimCompositorResources_Params; |
22 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | |
23 | 21 |
24 namespace content { | 22 namespace content { |
25 class RenderFrameProxyHost; | 23 class RenderFrameProxyHost; |
26 class RenderWidgetHostImpl; | 24 class RenderWidgetHostImpl; |
27 class RenderWidgetHostViewChildFrame; | 25 class RenderWidgetHostViewChildFrame; |
28 | 26 |
29 // CrossProcessFrameConnector provides the platform view abstraction for | 27 // CrossProcessFrameConnector provides the platform view abstraction for |
30 // RenderWidgetHostViewChildFrame allowing RWHVChildFrame to remain ignorant | 28 // RenderWidgetHostViewChildFrame allowing RWHVChildFrame to remain ignorant |
31 // of RenderFrameHost. | 29 // of RenderFrameHost. |
32 // | 30 // |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 69 |
72 bool OnMessageReceived(const IPC::Message &msg); | 70 bool OnMessageReceived(const IPC::Message &msg); |
73 | 71 |
74 // |view| corresponds to B2's RenderWidgetHostViewChildFrame in the example | 72 // |view| corresponds to B2's RenderWidgetHostViewChildFrame in the example |
75 // above. | 73 // above. |
76 void set_view(RenderWidgetHostViewChildFrame* view); | 74 void set_view(RenderWidgetHostViewChildFrame* view); |
77 RenderWidgetHostViewChildFrame* get_view_for_testing() { return view_; } | 75 RenderWidgetHostViewChildFrame* get_view_for_testing() { return view_; } |
78 | 76 |
79 void RenderProcessGone(); | 77 void RenderProcessGone(); |
80 | 78 |
81 // 'Platform' functionality exposed to RenderWidgetHostViewChildFrame. | |
82 // These methods can forward messages to the child frame proxy in the parent | |
83 // frame's renderer or attempt to handle them within the browser process. | |
84 void ChildFrameBuffersSwapped( | |
85 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, | |
86 int gpu_host_id); | |
87 | |
88 void ChildFrameCompositorFrameSwapped(uint32 output_surface_id, | 79 void ChildFrameCompositorFrameSwapped(uint32 output_surface_id, |
89 int host_id, | 80 int host_id, |
90 int route_id, | 81 int route_id, |
91 scoped_ptr<cc::CompositorFrame> frame); | 82 scoped_ptr<cc::CompositorFrame> frame); |
92 | 83 |
93 gfx::Rect ChildFrameRect(); | 84 gfx::Rect ChildFrameRect(); |
94 | 85 |
95 private: | 86 private: |
96 // Handlers for messages received from the parent frame. | 87 // Handlers for messages received from the parent frame. |
97 void OnBuffersSwappedACK( | |
98 const FrameHostMsg_BuffersSwappedACK_Params& params); | |
99 void OnCompositorFrameSwappedACK( | 88 void OnCompositorFrameSwappedACK( |
100 const FrameHostMsg_CompositorFrameSwappedACK_Params& params); | 89 const FrameHostMsg_CompositorFrameSwappedACK_Params& params); |
101 void OnReclaimCompositorResources( | 90 void OnReclaimCompositorResources( |
102 const FrameHostMsg_ReclaimCompositorResources_Params& params); | 91 const FrameHostMsg_ReclaimCompositorResources_Params& params); |
103 void OnForwardInputEvent(const blink::WebInputEvent* event); | 92 void OnForwardInputEvent(const blink::WebInputEvent* event); |
104 void OnInitializeChildFrame(gfx::Rect frame_rect, float scale_factor); | 93 void OnInitializeChildFrame(gfx::Rect frame_rect, float scale_factor); |
105 | 94 |
106 void SetDeviceScaleFactor(float scale_factor); | 95 void SetDeviceScaleFactor(float scale_factor); |
107 void SetSize(gfx::Rect frame_rect); | 96 void SetSize(gfx::Rect frame_rect); |
108 | 97 |
109 // The RenderFrameProxyHost that routes messages to the parent frame's | 98 // The RenderFrameProxyHost that routes messages to the parent frame's |
110 // renderer process. | 99 // renderer process. |
111 RenderFrameProxyHost* frame_proxy_in_parent_renderer_; | 100 RenderFrameProxyHost* frame_proxy_in_parent_renderer_; |
112 | 101 |
113 // The RenderWidgetHostView for the frame. Initially NULL. | 102 // The RenderWidgetHostView for the frame. Initially NULL. |
114 RenderWidgetHostViewChildFrame* view_; | 103 RenderWidgetHostViewChildFrame* view_; |
115 | 104 |
116 gfx::Rect child_frame_rect_; | 105 gfx::Rect child_frame_rect_; |
117 float device_scale_factor_; | 106 float device_scale_factor_; |
118 }; | 107 }; |
119 | 108 |
120 } // namespace content | 109 } // namespace content |
121 | 110 |
122 #endif // CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ | 111 #endif // CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
123 | 112 |
OLD | NEW |