| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ | 5 #ifndef CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ |
| 6 #define CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ | 6 #define CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "gpu/ipc/common/android/surface_texture_peer.h" | |
| 13 #include "ipc/ipc_listener.h" | 12 #include "ipc/ipc_listener.h" |
| 14 #include "ipc/ipc_message.h" | 13 #include "ipc/ipc_message.h" |
| 15 | 14 |
| 16 namespace base { | 15 namespace base { |
| 17 class UnguessableToken; | 16 class UnguessableToken; |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace gfx { | 19 namespace gfx { |
| 21 class Size; | 20 class Size; |
| 22 } | 21 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 42 virtual void OnFrameAvailable() = 0; | 41 virtual void OnFrameAvailable() = 0; |
| 43 virtual ~Listener() {} | 42 virtual ~Listener() {} |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 bool BindToCurrentThread(Listener* listener); | 45 bool BindToCurrentThread(Listener* listener); |
| 47 | 46 |
| 48 // IPC::Channel::Listener implementation: | 47 // IPC::Channel::Listener implementation: |
| 49 bool OnMessageReceived(const IPC::Message& message) override; | 48 bool OnMessageReceived(const IPC::Message& message) override; |
| 50 void OnChannelError() override; | 49 void OnChannelError() override; |
| 51 | 50 |
| 52 void EstablishPeer(int player_id, int frame_id); | |
| 53 void SetStreamTextureSize(const gfx::Size& size); | 51 void SetStreamTextureSize(const gfx::Size& size); |
| 54 void ForwardStreamTextureForSurfaceRequest( | 52 void ForwardStreamTextureForSurfaceRequest( |
| 55 const base::UnguessableToken& request_token); | 53 const base::UnguessableToken& request_token); |
| 56 | 54 |
| 57 private: | 55 private: |
| 58 // Message handlers: | 56 // Message handlers: |
| 59 void OnFrameAvailable(); | 57 void OnFrameAvailable(); |
| 60 | 58 |
| 61 int32_t route_id_; | 59 int32_t route_id_; |
| 62 Listener* listener_; | 60 Listener* listener_; |
| 63 scoped_refptr<gpu::GpuChannelHost> channel_; | 61 scoped_refptr<gpu::GpuChannelHost> channel_; |
| 64 base::WeakPtrFactory<StreamTextureHost> weak_ptr_factory_; | 62 base::WeakPtrFactory<StreamTextureHost> weak_ptr_factory_; |
| 65 | 63 |
| 66 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureHost); | 64 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureHost); |
| 67 }; | 65 }; |
| 68 | 66 |
| 69 } // namespace content | 67 } // namespace content |
| 70 | 68 |
| 71 #endif // CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ | 69 #endif // CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_ |
| OLD | NEW |