Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: content/browser/frame_host/cross_process_frame_connector.h

Issue 1094113003: Allow out-of-process iframes to render to compositing surfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Destroy Surface when resetting id Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/common/content_export.h"
9 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
10 11
11 namespace blink { 12 namespace blink {
12 class WebInputEvent; 13 class WebInputEvent;
13 } 14 }
14 15
16 namespace cc {
17 struct SurfaceId;
18 struct SurfaceSequence;
19 }
20
15 namespace IPC { 21 namespace IPC {
16 class Message; 22 class Message;
17 } 23 }
18 24
19 struct FrameHostMsg_CompositorFrameSwappedACK_Params; 25 struct FrameHostMsg_CompositorFrameSwappedACK_Params;
20 struct FrameHostMsg_ReclaimCompositorResources_Params; 26 struct FrameHostMsg_ReclaimCompositorResources_Params;
21 27
22 namespace content { 28 namespace content {
23 class RenderFrameProxyHost; 29 class RenderFrameProxyHost;
24 class RenderWidgetHostImpl; 30 class RenderWidgetHostImpl;
(...skipping 28 matching lines...) Expand all
53 // CrossProcessFrameConnector bridges between B2's 59 // CrossProcessFrameConnector bridges between B2's
54 // RenderWidgetHostViewChildFrame and A2 to allow for this communication. 60 // RenderWidgetHostViewChildFrame and A2 to allow for this communication.
55 // (Note: B1 is only mentioned for completeness. It is not needed in this 61 // (Note: B1 is only mentioned for completeness. It is not needed in this
56 // example.) 62 // example.)
57 // 63 //
58 // CrossProcessFrameConnector objects are owned by the RenderFrameProxyHost 64 // CrossProcessFrameConnector objects are owned by the RenderFrameProxyHost
59 // in the child frame's RenderFrameHostManager corresponding to the parent's 65 // in the child frame's RenderFrameHostManager corresponding to the parent's
60 // SiteInstance, A2 in the picture above. When a child frame navigates in a new 66 // SiteInstance, A2 in the picture above. When a child frame navigates in a new
61 // process, set_view() is called to update to the new view. 67 // process, set_view() is called to update to the new view.
62 // 68 //
63 class CrossProcessFrameConnector { 69 class CONTENT_EXPORT CrossProcessFrameConnector {
64 public: 70 public:
65 // |frame_proxy_in_parent_renderer| corresponds to A2 in the example above. 71 // |frame_proxy_in_parent_renderer| corresponds to A2 in the example above.
66 explicit CrossProcessFrameConnector( 72 explicit CrossProcessFrameConnector(
67 RenderFrameProxyHost* frame_proxy_in_parent_renderer); 73 RenderFrameProxyHost* frame_proxy_in_parent_renderer);
68 virtual ~CrossProcessFrameConnector(); 74 virtual ~CrossProcessFrameConnector();
69 75
70 bool OnMessageReceived(const IPC::Message &msg); 76 bool OnMessageReceived(const IPC::Message &msg);
71 77
72 // |view| corresponds to B2's RenderWidgetHostViewChildFrame in the example 78 // |view| corresponds to B2's RenderWidgetHostViewChildFrame in the example
73 // above. 79 // above.
74 void set_view(RenderWidgetHostViewChildFrame* view); 80 void set_view(RenderWidgetHostViewChildFrame* view);
75 RenderWidgetHostViewChildFrame* get_view_for_testing() { return view_; } 81 RenderWidgetHostViewChildFrame* get_view_for_testing() { return view_; }
76 82
77 void RenderProcessGone(); 83 void RenderProcessGone();
78 84
79 void ChildFrameCompositorFrameSwapped(uint32 output_surface_id, 85 virtual void ChildFrameCompositorFrameSwapped(
80 int host_id, 86 uint32 output_surface_id,
81 int route_id, 87 int host_id,
82 scoped_ptr<cc::CompositorFrame> frame); 88 int route_id,
89 scoped_ptr<cc::CompositorFrame> frame);
90 virtual void SetChildFrameSurface(cc::SurfaceId& surface_id,
dcheng 2015/05/28 22:16:30 No mutable references in arguments in Chrome.
kenrb 2015/05/29 19:29:36 Done.
91 gfx::Size frame_size,
dcheng 2015/05/28 22:16:30 This should probably be const gfx::Size&.
kenrb 2015/05/29 19:29:36 Done.
92 float scale_factor,
93 cc::SurfaceSequence& sequence);
83 94
84 gfx::Rect ChildFrameRect(); 95 gfx::Rect ChildFrameRect();
85 96
86 private: 97 private:
87 // Handlers for messages received from the parent frame. 98 // Handlers for messages received from the parent frame.
88 void OnCompositorFrameSwappedACK( 99 void OnCompositorFrameSwappedACK(
89 const FrameHostMsg_CompositorFrameSwappedACK_Params& params); 100 const FrameHostMsg_CompositorFrameSwappedACK_Params& params);
90 void OnReclaimCompositorResources( 101 void OnReclaimCompositorResources(
91 const FrameHostMsg_ReclaimCompositorResources_Params& params); 102 const FrameHostMsg_ReclaimCompositorResources_Params& params);
92 void OnForwardInputEvent(const blink::WebInputEvent* event); 103 void OnForwardInputEvent(const blink::WebInputEvent* event);
93 void OnInitializeChildFrame(gfx::Rect frame_rect, float scale_factor); 104 void OnInitializeChildFrame(gfx::Rect frame_rect, float scale_factor);
105 void OnSatisfySequence(const cc::SurfaceSequence& sequence);
106 void OnRequireSequence(const cc::SurfaceId& id,
107 const cc::SurfaceSequence& sequence);
94 108
95 void SetDeviceScaleFactor(float scale_factor); 109 void SetDeviceScaleFactor(float scale_factor);
96 void SetSize(gfx::Rect frame_rect); 110 void SetSize(gfx::Rect frame_rect);
97 111
98 // The RenderFrameProxyHost that routes messages to the parent frame's 112 // The RenderFrameProxyHost that routes messages to the parent frame's
99 // renderer process. 113 // renderer process.
100 RenderFrameProxyHost* frame_proxy_in_parent_renderer_; 114 RenderFrameProxyHost* frame_proxy_in_parent_renderer_;
101 115
102 // The RenderWidgetHostView for the frame. Initially NULL. 116 // The RenderWidgetHostView for the frame. Initially NULL.
103 RenderWidgetHostViewChildFrame* view_; 117 RenderWidgetHostViewChildFrame* view_;
104 118
105 gfx::Rect child_frame_rect_; 119 gfx::Rect child_frame_rect_;
106 float device_scale_factor_; 120 float device_scale_factor_;
107 }; 121 };
108 122
109 } // namespace content 123 } // namespace content
110 124
111 #endif // CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ 125 #endif // CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_
112 126
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698