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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_child_frame.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_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/resources/returned_resource.h"
10 #include "cc/surfaces/surface_factory_client.h"
11 #include "cc/surfaces/surface_id_allocator.h"
12 #include "content/browser/compositor/image_transport_factory.h"
9 #include "content/browser/renderer_host/render_widget_host_view_base.h" 13 #include "content/browser/renderer_host/render_widget_host_view_base.h"
10 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
11 #include "content/public/browser/readback_types.h" 15 #include "content/public/browser/readback_types.h"
16 #include "ui/compositor/compositor.h"
12 #include "ui/gfx/geometry/rect.h" 17 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/native_widget_types.h" 18 #include "ui/gfx/native_widget_types.h"
14 19
20 namespace cc {
21 class SurfaceFactory;
22 enum class SurfaceDrawStatus;
23 }
24
15 namespace content { 25 namespace content {
16 class CrossProcessFrameConnector; 26 class CrossProcessFrameConnector;
17 class RenderWidgetHost; 27 class RenderWidgetHost;
18 class RenderWidgetHostImpl; 28 class RenderWidgetHostImpl;
29 class RenderWidgetHostViewChildFrameTest;
19 30
20 // RenderWidgetHostViewChildFrame implements the view for a RenderWidgetHost 31 // RenderWidgetHostViewChildFrame implements the view for a RenderWidgetHost
21 // associated with content being rendered in a separate process from 32 // associated with content being rendered in a separate process from
22 // content that is embedding it. This is not a platform-specific class; rather, 33 // content that is embedding it. This is not a platform-specific class; rather,
23 // the embedding renderer process implements the platform containing the 34 // the embedding renderer process implements the platform containing the
24 // widget, and the top-level frame's RenderWidgetHostView will ultimately 35 // widget, and the top-level frame's RenderWidgetHostView will ultimately
25 // manage all native widget interaction. 36 // manage all native widget interaction.
26 // 37 //
27 // See comments in render_widget_host_view.h about this class and its members. 38 // See comments in render_widget_host_view.h about this class and its members.
28 class CONTENT_EXPORT RenderWidgetHostViewChildFrame 39 class CONTENT_EXPORT RenderWidgetHostViewChildFrame
29 : public RenderWidgetHostViewBase { 40 : public RenderWidgetHostViewBase,
41 public cc::SurfaceFactoryClient,
42 public base::SupportsWeakPtr<RenderWidgetHostViewChildFrame> {
dcheng 2015/05/28 22:24:55 Prefer to embed a WeakPtrFactory rather than inher
kenrb 2015/05/29 19:29:36 Done.
30 public: 43 public:
31 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); 44 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget);
32 ~RenderWidgetHostViewChildFrame() override; 45 ~RenderWidgetHostViewChildFrame() override;
33 46
34 void set_cross_process_frame_connector( 47 void set_cross_process_frame_connector(
35 CrossProcessFrameConnector* frame_connector) { 48 CrossProcessFrameConnector* frame_connector) {
36 frame_connector_ = frame_connector; 49 frame_connector_ = frame_connector;
37 } 50 }
38 51
39 // RenderWidgetHostView implementation. 52 // RenderWidgetHostView implementation.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 #endif // defined(OS_ANDROID) 139 #endif // defined(OS_ANDROID)
127 140
128 #if defined(OS_WIN) 141 #if defined(OS_WIN)
129 void SetParentNativeViewAccessible( 142 void SetParentNativeViewAccessible(
130 gfx::NativeViewAccessible accessible_parent) override; 143 gfx::NativeViewAccessible accessible_parent) override;
131 gfx::NativeViewId GetParentForWindowlessPlugin() const override; 144 gfx::NativeViewId GetParentForWindowlessPlugin() const override;
132 #endif 145 #endif
133 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( 146 BrowserAccessibilityManager* CreateBrowserAccessibilityManager(
134 BrowserAccessibilityDelegate* delegate) override; 147 BrowserAccessibilityDelegate* delegate) override;
135 148
149 // cc::SurfaceFactoryClient implementation.
150 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
151
136 protected: 152 protected:
137 friend class RenderWidgetHostView; 153 friend class RenderWidgetHostView;
154 friend class RenderWidgetHostViewChildFrameTest;
155
156 void SurfaceDrawn(uint32 output_surface_id, cc::SurfaceDrawStatus drawn);
138 157
139 // The last scroll offset of the view. 158 // The last scroll offset of the view.
140 gfx::Vector2dF last_scroll_offset_; 159 gfx::Vector2dF last_scroll_offset_;
141 160
142 // Members will become private when RenderWidgetHostViewGuest is removed. 161 // Members will become private when RenderWidgetHostViewGuest is removed.
143 // The model object. 162 // The model object.
144 RenderWidgetHostImpl* host_; 163 RenderWidgetHostImpl* host_;
145 164
165 // Flag determining whether we render into a compositing surface.
nasko 2015/05/28 20:42:36 nit: Is it Surface? You used capitalized version r
kenrb 2015/05/29 19:29:36 Done.
166 bool use_surfaces_;
167
168 // Surface-related state.
169 scoped_ptr<cc::SurfaceIdAllocator> id_allocator_;
170 scoped_ptr<cc::SurfaceFactory> surface_factory_;
171 cc::SurfaceId surface_id_;
172 uint32 next_surface_sequence_;
173 uint32 last_output_surface_id_;
174 gfx::Size current_surface_size_;
175 float current_surface_scale_factor_;
176 uint32 ack_pending_count_;
nasko 2015/05/28 20:42:36 nit: All other variables have some sort of "surfac
kenrb 2015/05/29 19:29:36 It is tracking expected CompositorFrameAcks. It is
177 cc::ReturnedResourceArray surface_returned_resources_;
178
146 // frame_connector_ provides a platform abstraction. Messages 179 // frame_connector_ provides a platform abstraction. Messages
147 // sent through it are routed to the embedding renderer process. 180 // sent through it are routed to the embedding renderer process.
148 CrossProcessFrameConnector* frame_connector_; 181 CrossProcessFrameConnector* frame_connector_;
149 182
150 private: 183 private:
151 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); 184 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame);
152 }; 185 };
153 186
154 } // namespace content 187 } // namespace content
155 188
156 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ 189 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698