| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ | 5 #ifndef CONTENT_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ |
| 6 #define CONTENT_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ | 6 #define CONTENT_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 #include "cc/output/compositor_frame_sink.h" | 10 #include "cc/output/compositor_frame_sink.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/renderer/input/render_widget_input_handler_delegate.h" | 12 #include "content/renderer/input/render_widget_input_handler_delegate.h" |
| 13 #include "content/renderer/mus/compositor_mus_connection.h" | 13 #include "content/renderer/mus/compositor_mus_connection.h" |
| 14 | 14 |
| 15 namespace gpu { | 15 namespace gpu { |
| 16 class GpuChannelHost; | 16 class GpuChannelHost; |
| 17 class GpuMemoryBufferManager; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 | 21 |
| 21 class InputHandlerManager; | 22 class InputHandlerManager; |
| 22 | 23 |
| 23 // Use on main thread. | 24 // Use on main thread. |
| 24 class CONTENT_EXPORT RenderWidgetMusConnection | 25 class CONTENT_EXPORT RenderWidgetMusConnection |
| 25 : public RenderWidgetInputHandlerDelegate { | 26 : public RenderWidgetInputHandlerDelegate { |
| 26 public: | 27 public: |
| 27 // Bind to a WindowTreeClient request. | 28 // Bind to a WindowTreeClient request. |
| 28 void Bind(mojo::InterfaceRequest<ui::mojom::WindowTreeClient> request); | 29 void Bind(mojo::InterfaceRequest<ui::mojom::WindowTreeClient> request); |
| 29 | 30 |
| 30 // Create a cc output surface. | 31 // Create a cc output surface. |
| 31 std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink( | 32 std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink( |
| 32 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host); | 33 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, |
| 34 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); |
| 33 | 35 |
| 34 static RenderWidgetMusConnection* Get(int routing_id); | 36 static RenderWidgetMusConnection* Get(int routing_id); |
| 35 | 37 |
| 36 // Get the connection from a routing_id, if the connection doesn't exist, | 38 // Get the connection from a routing_id, if the connection doesn't exist, |
| 37 // a new connection will be created. | 39 // a new connection will be created. |
| 38 static RenderWidgetMusConnection* GetOrCreate(int routing_id); | 40 static RenderWidgetMusConnection* GetOrCreate(int routing_id); |
| 39 | 41 |
| 40 private: | 42 private: |
| 41 friend class CompositorMusConnection; | 43 friend class CompositorMusConnection; |
| 42 friend class CompositorMusConnectionTest; | 44 friend class CompositorMusConnectionTest; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 78 |
| 77 // Used to verify single threaded access. | 79 // Used to verify single threaded access. |
| 78 base::ThreadChecker thread_checker_; | 80 base::ThreadChecker thread_checker_; |
| 79 | 81 |
| 80 DISALLOW_COPY_AND_ASSIGN(RenderWidgetMusConnection); | 82 DISALLOW_COPY_AND_ASSIGN(RenderWidgetMusConnection); |
| 81 }; | 83 }; |
| 82 | 84 |
| 83 } // namespace content | 85 } // namespace content |
| 84 | 86 |
| 85 #endif // CONTENT_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ | 87 #endif // CONTENT_RENDERER_MUS_RENDER_WIDGET_MUS_CONNECTION_H_ |
| OLD | NEW |