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

Side by Side Diff: content/renderer/child_frame_compositing_helper.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: Missed one 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
« no previous file with comments | « content/common/frame_messages.h ('k') | content/renderer/child_frame_compositing_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ 5 #ifndef CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_
6 #define CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ 6 #define CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/shared_memory.h" 13 #include "base/memory/shared_memory.h"
14 #include "cc/layers/delegated_frame_resource_collection.h" 14 #include "cc/layers/delegated_frame_resource_collection.h"
15 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
16 #include "ui/gfx/geometry/size.h" 16 #include "ui/gfx/geometry/size.h"
17 17
18 namespace base { 18 namespace base {
19 class SharedMemory; 19 class SharedMemory;
20 } 20 }
21 21
22 namespace cc { 22 namespace cc {
23 struct SurfaceId;
24 struct SurfaceSequence;
25
23 class CompositorFrame; 26 class CompositorFrame;
24 class Layer; 27 class Layer;
25 class SolidColorLayer; 28 class SolidColorLayer;
29 class SurfaceLayer;
26 class DelegatedFrameProvider; 30 class DelegatedFrameProvider;
27 class DelegatedFrameResourceCollection; 31 class DelegatedFrameResourceCollection;
28 class DelegatedRendererLayer; 32 class DelegatedRendererLayer;
29 } 33 }
30 34
31 namespace blink { 35 namespace blink {
32 class WebFrame; 36 class WebFrame;
33 class WebPluginContainer; 37 class WebPluginContainer;
34 class WebLayer; 38 class WebLayer;
35 } 39 }
(...skipping 23 matching lines...) Expand all
59 RenderFrameProxy* render_frame_proxy); 63 RenderFrameProxy* render_frame_proxy);
60 64
61 void DidCommitCompositorFrame(); 65 void DidCommitCompositorFrame();
62 void EnableCompositing(bool); 66 void EnableCompositing(bool);
63 void OnContainerDestroy(); 67 void OnContainerDestroy();
64 void OnCompositorFrameSwapped(scoped_ptr<cc::CompositorFrame> frame, 68 void OnCompositorFrameSwapped(scoped_ptr<cc::CompositorFrame> frame,
65 int route_id, 69 int route_id,
66 uint32 output_surface_id, 70 uint32 output_surface_id,
67 int host_id, 71 int host_id,
68 base::SharedMemoryHandle handle); 72 base::SharedMemoryHandle handle);
73 void OnSetSurface(const cc::SurfaceId& surface_id,
74 const gfx::Size& frame_size,
75 float scale_factor,
76 const cc::SurfaceSequence& sequence);
69 void UpdateVisibility(bool); 77 void UpdateVisibility(bool);
70 void ChildFrameGone(); 78 void ChildFrameGone();
71 79
72 // cc::DelegatedFrameProviderClient implementation. 80 // cc::DelegatedFrameProviderClient implementation.
73 void UnusedResourcesAreAvailable() override; 81 void UnusedResourcesAreAvailable() override;
74 void SetContentsOpaque(bool); 82 void SetContentsOpaque(bool);
75 83
76 protected: 84 protected:
77 // Friend RefCounted so that the dtor can be non-public. 85 // Friend RefCounted so that the dtor can be non-public.
78 friend class base::RefCounted<ChildFrameCompositingHelper>; 86 friend class base::RefCounted<ChildFrameCompositingHelper>;
(...skipping 12 matching lines...) Expand all
91 int GetInstanceID(); 99 int GetInstanceID();
92 100
93 void SendCompositorFrameSwappedACKToBrowser( 101 void SendCompositorFrameSwappedACKToBrowser(
94 FrameHostMsg_CompositorFrameSwappedACK_Params& params); 102 FrameHostMsg_CompositorFrameSwappedACK_Params& params);
95 void SendReclaimCompositorResourcesToBrowser( 103 void SendReclaimCompositorResourcesToBrowser(
96 FrameHostMsg_ReclaimCompositorResources_Params& params); 104 FrameHostMsg_ReclaimCompositorResources_Params& params);
97 void CheckSizeAndAdjustLayerProperties(const gfx::Size& new_size, 105 void CheckSizeAndAdjustLayerProperties(const gfx::Size& new_size,
98 float device_scale_factor, 106 float device_scale_factor,
99 cc::Layer* layer); 107 cc::Layer* layer);
100 void SendReturnedDelegatedResources(); 108 void SendReturnedDelegatedResources();
109 static void SatisfyCallback(base::WeakPtr<ChildFrameCompositingHelper> helper,
110 cc::SurfaceSequence sequence);
111 static void RequireCallback(base::WeakPtr<ChildFrameCompositingHelper> helper,
112 cc::SurfaceId id,
113 cc::SurfaceSequence sequence);
114
115 base::WeakPtr<ChildFrameCompositingHelper> GetWeakPtr() {
116 return weak_factory_.GetWeakPtr();
117 }
101 118
102 int host_routing_id_; 119 int host_routing_id_;
103 int last_route_id_; 120 int last_route_id_;
104 uint32 last_output_surface_id_; 121 uint32 last_output_surface_id_;
105 int last_host_id_; 122 int last_host_id_;
106 bool ack_pending_; 123 bool ack_pending_;
107 bool opaque_; 124 bool opaque_;
108 125
109 gfx::Size buffer_size_; 126 gfx::Size buffer_size_;
110 127
111 // The lifetime of this weak pointer should be greater than the lifetime of 128 // The lifetime of this weak pointer should be greater than the lifetime of
112 // other member objects, as they may access this pointer during their 129 // other member objects, as they may access this pointer during their
113 // destruction. 130 // destruction.
114 base::WeakPtr<BrowserPlugin> browser_plugin_; 131 base::WeakPtr<BrowserPlugin> browser_plugin_;
115 RenderFrameProxy* render_frame_proxy_; 132 RenderFrameProxy* render_frame_proxy_;
116 133
117 scoped_refptr<cc::DelegatedFrameResourceCollection> resource_collection_; 134 scoped_refptr<cc::DelegatedFrameResourceCollection> resource_collection_;
118 scoped_refptr<cc::DelegatedFrameProvider> frame_provider_; 135 scoped_refptr<cc::DelegatedFrameProvider> frame_provider_;
119 136
137 // For cc::Surface support.
138 scoped_refptr<cc::SurfaceLayer> surface_layer_;
139
120 scoped_refptr<cc::SolidColorLayer> background_layer_; 140 scoped_refptr<cc::SolidColorLayer> background_layer_;
121 scoped_refptr<cc::DelegatedRendererLayer> delegated_layer_; 141 scoped_refptr<cc::DelegatedRendererLayer> delegated_layer_;
122 scoped_ptr<blink::WebLayer> web_layer_; 142 scoped_ptr<blink::WebLayer> web_layer_;
123 blink::WebFrame* frame_; 143 blink::WebFrame* frame_;
124 144
145 base::WeakPtrFactory<ChildFrameCompositingHelper> weak_factory_;
146
125 DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper); 147 DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper);
126 }; 148 };
127 149
128 } // namespace content 150 } // namespace content
129 151
130 #endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ 152 #endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_
OLDNEW
« no previous file with comments | « content/common/frame_messages.h ('k') | content/renderer/child_frame_compositing_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698