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_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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/shared_memory.h" | 16 #include "base/memory/shared_memory.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "cc/surfaces/surface_id.h" | 18 #include "cc/surfaces/surface_id.h" |
| 19 #include "cc/surfaces/surface_reference_factory.h" |
19 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
20 #include "ui/gfx/geometry/size.h" | 21 #include "ui/gfx/geometry/size.h" |
21 | 22 |
22 namespace cc { | 23 namespace cc { |
23 struct SurfaceSequence; | 24 struct SurfaceSequence; |
24 | 25 |
25 class Layer; | 26 class Layer; |
26 } | 27 } |
27 | 28 |
28 namespace blink { | 29 namespace blink { |
29 class WebLayer; | 30 class WebLayer; |
30 class WebPluginContainer; | 31 class WebPluginContainer; |
31 class WebRemoteFrame; | 32 class WebRemoteFrame; |
32 } | 33 } |
33 | 34 |
34 namespace gfx { | 35 namespace gfx { |
35 class Size; | 36 class Size; |
36 } | 37 } |
37 | 38 |
38 namespace content { | 39 namespace content { |
39 | 40 |
40 class BrowserPlugin; | 41 class BrowserPlugin; |
41 class RenderFrameProxy; | 42 class RenderFrameProxy; |
42 class ThreadSafeSender; | |
43 | 43 |
44 class CONTENT_EXPORT ChildFrameCompositingHelper | 44 class CONTENT_EXPORT ChildFrameCompositingHelper |
45 : public base::RefCounted<ChildFrameCompositingHelper> { | 45 : public base::RefCounted<ChildFrameCompositingHelper> { |
46 public: | 46 public: |
47 static ChildFrameCompositingHelper* CreateForBrowserPlugin( | 47 static ChildFrameCompositingHelper* CreateForBrowserPlugin( |
48 const base::WeakPtr<BrowserPlugin>& browser_plugin); | 48 const base::WeakPtr<BrowserPlugin>& browser_plugin); |
49 static ChildFrameCompositingHelper* CreateForRenderFrameProxy( | 49 static ChildFrameCompositingHelper* CreateForRenderFrameProxy( |
50 RenderFrameProxy* render_frame_proxy); | 50 RenderFrameProxy* render_frame_proxy); |
51 | 51 |
52 void OnContainerDestroy(); | 52 void OnContainerDestroy(); |
(...skipping 17 matching lines...) Expand all Loading... |
70 RenderFrameProxy* render_frame_proxy, | 70 RenderFrameProxy* render_frame_proxy, |
71 int host_routing_id); | 71 int host_routing_id); |
72 | 72 |
73 virtual ~ChildFrameCompositingHelper(); | 73 virtual ~ChildFrameCompositingHelper(); |
74 | 74 |
75 blink::WebPluginContainer* GetContainer(); | 75 blink::WebPluginContainer* GetContainer(); |
76 | 76 |
77 void CheckSizeAndAdjustLayerProperties(const gfx::Size& new_size, | 77 void CheckSizeAndAdjustLayerProperties(const gfx::Size& new_size, |
78 float device_scale_factor, | 78 float device_scale_factor, |
79 cc::Layer* layer); | 79 cc::Layer* layer); |
80 static void SatisfyCallback(scoped_refptr<ThreadSafeSender> sender, | |
81 int host_routing_id, | |
82 const cc::SurfaceSequence& sequence); | |
83 static void SatisfyCallbackBrowserPlugin( | |
84 scoped_refptr<ThreadSafeSender> sender, | |
85 int host_routing_id, | |
86 int browser_plugin_instance_id, | |
87 const cc::SurfaceSequence& sequence); | |
88 static void RequireCallback(scoped_refptr<ThreadSafeSender> sender, | |
89 int host_routing_id, | |
90 const cc::SurfaceId& id, | |
91 const cc::SurfaceSequence& sequence); | |
92 static void RequireCallbackBrowserPlugin( | |
93 scoped_refptr<ThreadSafeSender> sender, | |
94 int host_routing_id, | |
95 int browser_plugin_instance_id, | |
96 const cc::SurfaceId& id, | |
97 const cc::SurfaceSequence& sequence); | |
98 void UpdateWebLayer(std::unique_ptr<blink::WebLayer> layer); | 80 void UpdateWebLayer(std::unique_ptr<blink::WebLayer> layer); |
99 | 81 |
100 int host_routing_id_; | 82 const int host_routing_id_; |
101 | 83 |
102 gfx::Size buffer_size_; | 84 gfx::Size buffer_size_; |
103 | 85 |
104 // The lifetime of this weak pointer should be greater than the lifetime of | 86 // The lifetime of this weak pointer should be greater than the lifetime of |
105 // other member objects, as they may access this pointer during their | 87 // other member objects, as they may access this pointer during their |
106 // destruction. | 88 // destruction. |
107 base::WeakPtr<BrowserPlugin> browser_plugin_; | 89 const base::WeakPtr<BrowserPlugin> browser_plugin_; |
108 RenderFrameProxy* render_frame_proxy_; | 90 RenderFrameProxy* const render_frame_proxy_; |
109 | 91 |
110 std::unique_ptr<blink::WebLayer> web_layer_; | 92 std::unique_ptr<blink::WebLayer> web_layer_; |
111 cc::SurfaceId surface_id_; | 93 cc::SurfaceId surface_id_; |
112 blink::WebRemoteFrame* frame_; | 94 blink::WebRemoteFrame* frame_; |
113 | 95 |
| 96 scoped_refptr<cc::SurfaceReferenceFactory> surface_reference_factory_; |
| 97 |
114 DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper); | 98 DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper); |
115 }; | 99 }; |
116 | 100 |
117 } // namespace content | 101 } // namespace content |
118 | 102 |
119 #endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ | 103 #endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ |
OLD | NEW |