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