| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ |
| 6 #define CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
| 17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "base/threading/non_thread_safe.h" | |
| 19 #include "content/common/gpu/gpu_info.h" | 18 #include "content/common/gpu/gpu_info.h" |
| 20 #include "content/common/message_router.h" | 19 #include "content/common/message_router.h" |
| 21 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" | 20 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" |
| 22 #include "ipc/ipc_channel_handle.h" | 21 #include "ipc/ipc_channel_handle.h" |
| 23 #include "ipc/ipc_channel_proxy.h" | 22 #include "ipc/ipc_channel_proxy.h" |
| 24 #include "ipc/ipc_sync_channel.h" | 23 #include "ipc/ipc_sync_channel.h" |
| 25 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" |
| 26 #include "ui/gfx/size.h" | 25 #include "ui/gfx/size.h" |
| 27 | 26 |
| 28 class CommandBufferProxy; | 27 class CommandBufferProxy; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 124 |
| 126 scoped_refptr<base::MessageLoopProxy> loop() { return loop_; } | 125 scoped_refptr<base::MessageLoopProxy> loop() { return loop_; } |
| 127 | 126 |
| 128 private: | 127 private: |
| 129 base::WeakPtr<IPC::Channel::Listener> listener_; | 128 base::WeakPtr<IPC::Channel::Listener> listener_; |
| 130 scoped_refptr<base::MessageLoopProxy> loop_; | 129 scoped_refptr<base::MessageLoopProxy> loop_; |
| 131 }; | 130 }; |
| 132 | 131 |
| 133 // A filter used internally to route incoming messages from the IO thread | 132 // A filter used internally to route incoming messages from the IO thread |
| 134 // to the correct message loop. | 133 // to the correct message loop. |
| 135 class MessageFilter : public IPC::ChannelProxy::MessageFilter, | 134 class MessageFilter : public IPC::ChannelProxy::MessageFilter { |
| 136 public base::NonThreadSafe { | |
| 137 public: | 135 public: |
| 138 MessageFilter(GpuChannelHost* parent); | 136 MessageFilter(GpuChannelHost* parent); |
| 139 virtual ~MessageFilter(); | 137 virtual ~MessageFilter(); |
| 140 | 138 |
| 141 void AddRoute(int route_id, | 139 void AddRoute(int route_id, |
| 142 base::WeakPtr<IPC::Channel::Listener> listener, | 140 base::WeakPtr<IPC::Channel::Listener> listener, |
| 143 scoped_refptr<base::MessageLoopProxy> loop); | 141 scoped_refptr<base::MessageLoopProxy> loop); |
| 144 void RemoveRoute(int route_id); | 142 void RemoveRoute(int route_id); |
| 145 | 143 |
| 146 // IPC::ChannelProxy::MessageFilter implementation: | 144 // IPC::ChannelProxy::MessageFilter implementation: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 174 // textures. These messages are routed to TransportTextureHost. | 172 // textures. These messages are routed to TransportTextureHost. |
| 175 scoped_refptr<TransportTextureService> transport_texture_service_; | 173 scoped_refptr<TransportTextureService> transport_texture_service_; |
| 176 | 174 |
| 177 // A filter for sending messages from thread other than the main thread. | 175 // A filter for sending messages from thread other than the main thread. |
| 178 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; | 176 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; |
| 179 | 177 |
| 180 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 178 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
| 181 }; | 179 }; |
| 182 | 180 |
| 183 #endif // CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ | 181 #endif // CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ |
| OLD | NEW |