| 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 "cc/surfaces/surface_reference_factory.h" |
| 20 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 21 #include "ui/gfx/geometry/size.h" | 21 #include "ui/gfx/geometry/size.h" |
| 22 | 22 |
| 23 namespace cc { | 23 namespace cc { |
| 24 struct SurfaceSequence; | 24 struct SurfaceSequence; |
| 25 | 25 |
| 26 class Layer; | 26 class Layer; |
| 27 class SurfaceInfo; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace blink { | 30 namespace blink { |
| 30 class WebLayer; | 31 class WebLayer; |
| 31 class WebPluginContainer; | 32 class WebPluginContainer; |
| 32 class WebRemoteFrame; | 33 class WebRemoteFrame; |
| 33 } | 34 } |
| 34 | 35 |
| 35 namespace gfx { | 36 namespace gfx { |
| 36 class Size; | 37 class Size; |
| 37 } | 38 } |
| 38 | 39 |
| 39 namespace content { | 40 namespace content { |
| 40 | 41 |
| 41 class BrowserPlugin; | 42 class BrowserPlugin; |
| 42 class RenderFrameProxy; | 43 class RenderFrameProxy; |
| 43 | 44 |
| 44 class CONTENT_EXPORT ChildFrameCompositingHelper | 45 class CONTENT_EXPORT ChildFrameCompositingHelper |
| 45 : public base::RefCounted<ChildFrameCompositingHelper> { | 46 : public base::RefCounted<ChildFrameCompositingHelper> { |
| 46 public: | 47 public: |
| 47 static ChildFrameCompositingHelper* CreateForBrowserPlugin( | 48 static ChildFrameCompositingHelper* CreateForBrowserPlugin( |
| 48 const base::WeakPtr<BrowserPlugin>& browser_plugin); | 49 const base::WeakPtr<BrowserPlugin>& browser_plugin); |
| 49 static ChildFrameCompositingHelper* CreateForRenderFrameProxy( | 50 static ChildFrameCompositingHelper* CreateForRenderFrameProxy( |
| 50 RenderFrameProxy* render_frame_proxy); | 51 RenderFrameProxy* render_frame_proxy); |
| 51 | 52 |
| 52 void OnContainerDestroy(); | 53 void OnContainerDestroy(); |
| 53 void OnSetSurface(const cc::SurfaceId& surface_id, | 54 void OnSetSurface(const cc::SurfaceInfo& surface_info, |
| 54 const gfx::Size& frame_size, | |
| 55 float scale_factor, | |
| 56 const cc::SurfaceSequence& sequence); | 55 const cc::SurfaceSequence& sequence); |
| 57 void UpdateVisibility(bool); | 56 void UpdateVisibility(bool); |
| 58 void ChildFrameGone(); | 57 void ChildFrameGone(); |
| 59 | 58 |
| 60 cc::SurfaceId surface_id() const { return surface_id_; } | 59 cc::SurfaceId surface_id() const { return surface_id_; } |
| 61 | 60 |
| 62 protected: | 61 protected: |
| 63 // Friend RefCounted so that the dtor can be non-public. | 62 // Friend RefCounted so that the dtor can be non-public. |
| 64 friend class base::RefCounted<ChildFrameCompositingHelper>; | 63 friend class base::RefCounted<ChildFrameCompositingHelper>; |
| 65 | 64 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 94 blink::WebRemoteFrame* frame_; | 93 blink::WebRemoteFrame* frame_; |
| 95 | 94 |
| 96 scoped_refptr<cc::SurfaceReferenceFactory> surface_reference_factory_; | 95 scoped_refptr<cc::SurfaceReferenceFactory> surface_reference_factory_; |
| 97 | 96 |
| 98 DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper); | 97 DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper); |
| 99 }; | 98 }; |
| 100 | 99 |
| 101 } // namespace content | 100 } // namespace content |
| 102 | 101 |
| 103 #endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ | 102 #endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_ |
| OLD | NEW |