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> |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 namespace gfx { | 35 namespace gfx { |
36 class Size; | 36 class Size; |
37 } | 37 } |
38 | 38 |
39 namespace content { | 39 namespace content { |
40 | 40 |
41 class BrowserPlugin; | 41 class BrowserPlugin; |
42 class RenderFrameProxy; | 42 class RenderFrameProxy; |
43 class ThreadSafeSender; | |
44 | 43 |
45 class CONTENT_EXPORT ChildFrameCompositingHelper | 44 class CONTENT_EXPORT ChildFrameCompositingHelper |
46 : public base::RefCounted<ChildFrameCompositingHelper> { | 45 : public base::RefCounted<ChildFrameCompositingHelper> { |
47 public: | 46 public: |
48 static ChildFrameCompositingHelper* CreateForBrowserPlugin( | 47 static ChildFrameCompositingHelper* CreateForBrowserPlugin( |
49 const base::WeakPtr<BrowserPlugin>& browser_plugin); | 48 const base::WeakPtr<BrowserPlugin>& browser_plugin); |
50 static ChildFrameCompositingHelper* CreateForRenderFrameProxy( | 49 static ChildFrameCompositingHelper* CreateForRenderFrameProxy( |
51 RenderFrameProxy* render_frame_proxy); | 50 RenderFrameProxy* render_frame_proxy); |
52 | 51 |
53 void OnContainerDestroy(); | 52 void OnContainerDestroy(); |
(...skipping 17 matching lines...) Expand all Loading... |
71 RenderFrameProxy* render_frame_proxy, | 70 RenderFrameProxy* render_frame_proxy, |
72 int host_routing_id); | 71 int host_routing_id); |
73 | 72 |
74 virtual ~ChildFrameCompositingHelper(); | 73 virtual ~ChildFrameCompositingHelper(); |
75 | 74 |
76 blink::WebPluginContainer* GetContainer(); | 75 blink::WebPluginContainer* GetContainer(); |
77 | 76 |
78 void CheckSizeAndAdjustLayerProperties(const gfx::Size& new_size, | 77 void CheckSizeAndAdjustLayerProperties(const gfx::Size& new_size, |
79 float device_scale_factor, | 78 float device_scale_factor, |
80 cc::Layer* layer); | 79 cc::Layer* layer); |
81 static void SatisfyCallback(scoped_refptr<ThreadSafeSender> sender, | |
82 int host_routing_id, | |
83 const cc::SurfaceSequence& sequence); | |
84 static void SatisfyCallbackBrowserPlugin( | |
85 scoped_refptr<ThreadSafeSender> sender, | |
86 int host_routing_id, | |
87 int browser_plugin_instance_id, | |
88 const cc::SurfaceSequence& sequence); | |
89 static void RequireCallback(scoped_refptr<ThreadSafeSender> sender, | |
90 int host_routing_id, | |
91 const cc::SurfaceId& id, | |
92 const cc::SurfaceSequence& sequence); | |
93 static void RequireCallbackBrowserPlugin( | |
94 scoped_refptr<ThreadSafeSender> sender, | |
95 int host_routing_id, | |
96 int browser_plugin_instance_id, | |
97 const cc::SurfaceId& id, | |
98 const cc::SurfaceSequence& sequence); | |
99 void UpdateWebLayer(std::unique_ptr<blink::WebLayer> layer); | 80 void UpdateWebLayer(std::unique_ptr<blink::WebLayer> layer); |
100 | 81 |
101 int host_routing_id_; | 82 int host_routing_id_; |
102 | 83 |
103 gfx::Size buffer_size_; | 84 gfx::Size buffer_size_; |
104 | 85 |
105 // 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 |
106 // other member objects, as they may access this pointer during their | 87 // other member objects, as they may access this pointer during their |
107 // destruction. | 88 // destruction. |
108 base::WeakPtr<BrowserPlugin> browser_plugin_; | 89 base::WeakPtr<BrowserPlugin> browser_plugin_; |
109 RenderFrameProxy* render_frame_proxy_; | 90 RenderFrameProxy* render_frame_proxy_; |
110 | 91 |
111 std::unique_ptr<blink::WebLayer> web_layer_; | 92 std::unique_ptr<blink::WebLayer> web_layer_; |
112 cc::SurfaceId surface_id_; | 93 cc::SurfaceId surface_id_; |
113 blink::WebRemoteFrame* frame_; | 94 blink::WebRemoteFrame* frame_; |
114 | 95 |
115 DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper); | 96 DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper); |
116 }; | 97 }; |
117 | 98 |
118 } // namespace content | 99 } // namespace content |
119 | 100 |
120 #endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ | 101 #endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ |
OLD | NEW |