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_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 "content/common/content_export.h" |
18 #include "content/common/gpu/gpu_process_launch_causes.h" | 19 #include "content/common/gpu/gpu_process_launch_causes.h" |
19 #include "content/common/message_router.h" | 20 #include "content/common/message_router.h" |
20 #include "content/public/common/gpu_info.h" | 21 #include "content/public/common/gpu_info.h" |
21 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" | 22 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" |
22 #include "ipc/ipc_channel_handle.h" | 23 #include "ipc/ipc_channel_handle.h" |
23 #include "ipc/ipc_channel_proxy.h" | 24 #include "ipc/ipc_channel_proxy.h" |
24 #include "ipc/ipc_sync_channel.h" | 25 #include "ipc/ipc_sync_channel.h" |
25 #include "ui/gfx/gl/gpu_preference.h" | 26 #include "ui/gfx/gl/gpu_preference.h" |
26 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
27 #include "ui/gfx/size.h" | 28 #include "ui/gfx/size.h" |
(...skipping 13 matching lines...) Expand all Loading... |
41 } | 42 } |
42 | 43 |
43 struct GpuListenerInfo { | 44 struct GpuListenerInfo { |
44 GpuListenerInfo(); | 45 GpuListenerInfo(); |
45 ~GpuListenerInfo(); | 46 ~GpuListenerInfo(); |
46 | 47 |
47 base::WeakPtr<IPC::Channel::Listener> listener; | 48 base::WeakPtr<IPC::Channel::Listener> listener; |
48 scoped_refptr<base::MessageLoopProxy> loop; | 49 scoped_refptr<base::MessageLoopProxy> loop; |
49 }; | 50 }; |
50 | 51 |
51 class GpuChannelHostFactory { | 52 class CONTENT_EXPORT GpuChannelHostFactory { |
52 public: | 53 public: |
53 virtual ~GpuChannelHostFactory(); | 54 virtual ~GpuChannelHostFactory(); |
54 static GpuChannelHostFactory* instance() { return instance_; } | 55 static GpuChannelHostFactory* instance() { return instance_; } |
55 | 56 |
56 virtual bool IsMainThread() = 0; | 57 virtual bool IsMainThread() = 0; |
57 virtual bool IsIOThread() = 0; | 58 virtual bool IsIOThread() = 0; |
58 virtual MessageLoop* GetMainLoop() = 0; | 59 virtual MessageLoop* GetMainLoop() = 0; |
59 virtual base::MessageLoopProxy* GetIOLoopProxy() = 0; | 60 virtual base::MessageLoopProxy* GetIOLoopProxy() = 0; |
60 virtual base::WaitableEvent* GetShutDownEvent() = 0; | 61 virtual base::WaitableEvent* GetShutDownEvent() = 0; |
61 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(uint32 size) = 0; | 62 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(uint32 size) = 0; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // for calls from contexts that may live on the compositor or main thread. | 200 // for calls from contexts that may live on the compositor or main thread. |
200 mutable base::Lock context_lock_; | 201 mutable base::Lock context_lock_; |
201 | 202 |
202 // A filter for sending messages from thread other than the main thread. | 203 // A filter for sending messages from thread other than the main thread. |
203 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; | 204 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; |
204 | 205 |
205 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 206 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
206 }; | 207 }; |
207 | 208 |
208 #endif // CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ | 209 #endif // CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ |
OLD | NEW |