Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1158)

Side by Side Diff: content/common/gpu/gpu_channel_manager.h

Issue 10662005: Use IPC::Sender and IPC::Listener in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/hash_tables.h" 9 #include "base/hash_tables.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/message_loop_proxy.h" 12 #include "base/message_loop_proxy.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "content/common/gpu/gpu_memory_manager.h" 14 #include "content/common/gpu/gpu_memory_manager.h"
15 #include "ipc/ipc_channel.h" 15 #include "ipc/ipc_listener.h"
16 #include "ipc/ipc_message.h" 16 #include "ipc/ipc_sender.h"
17 #include "ui/gfx/native_widget_types.h" 17 #include "ui/gfx/native_widget_types.h"
18 18
19 namespace base { 19 namespace base {
20 class WaitableEvent; 20 class WaitableEvent;
21 } 21 }
22 22
23 namespace gfx { 23 namespace gfx {
24 class GLShareGroup; 24 class GLShareGroup;
25 } 25 }
26 26
(...skipping 13 matching lines...) Expand all
40 struct GPUCreateCommandBufferConfig; 40 struct GPUCreateCommandBufferConfig;
41 class SyncPointManager; 41 class SyncPointManager;
42 42
43 // A GpuChannelManager is a thread responsible for issuing rendering commands 43 // A GpuChannelManager is a thread responsible for issuing rendering commands
44 // managing the lifetimes of GPU channels and forwarding IPC requests from the 44 // managing the lifetimes of GPU channels and forwarding IPC requests from the
45 // browser process to them based on the corresponding renderer ID. 45 // browser process to them based on the corresponding renderer ID.
46 // 46 //
47 // A GpuChannelManager can also be hosted in the browser process in single 47 // A GpuChannelManager can also be hosted in the browser process in single
48 // process or in-process GPU modes. In this case there is no corresponding 48 // process or in-process GPU modes. In this case there is no corresponding
49 // GpuChildThread and this is the reason the GpuChildThread is referenced via 49 // GpuChildThread and this is the reason the GpuChildThread is referenced via
50 // a pointer to IPC::Message::Sender, which can be implemented by other hosts 50 // a pointer to IPC::Sender, which can be implemented by other hosts to send
51 // to send IPC messages to the browser process IO thread on the 51 // IPC messages to the browser process IO thread on the GpuChannelManager's
52 // GpuChannelManager's behalf. 52 // behalf.
53 class GpuChannelManager : public IPC::Channel::Listener, 53 class GpuChannelManager : public IPC::Listener,
54 public IPC::Message::Sender, 54 public IPC::Sender,
55 public GpuMemoryManagerClient { 55 public GpuMemoryManagerClient {
56 public: 56 public:
57 GpuChannelManager(ChildThread* gpu_child_thread, 57 GpuChannelManager(ChildThread* gpu_child_thread,
58 GpuWatchdog* watchdog, 58 GpuWatchdog* watchdog,
59 base::MessageLoopProxy* io_message_loop, 59 base::MessageLoopProxy* io_message_loop,
60 base::WaitableEvent* shutdown_event); 60 base::WaitableEvent* shutdown_event);
61 virtual ~GpuChannelManager(); 61 virtual ~GpuChannelManager();
62 62
63 // Remove the channel for a particular renderer. 63 // Remove the channel for a particular renderer.
64 void RemoveChannel(int client_id); 64 void RemoveChannel(int client_id);
65 65
66 // Listener overrides. 66 // Listener overrides.
67 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 67 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
68 68
69 // Sender overrides. 69 // Sender overrides.
70 virtual bool Send(IPC::Message* msg) OVERRIDE; 70 virtual bool Send(IPC::Message* msg) OVERRIDE;
71 71
72 // GpuMemoryManagerClient overrides. 72 // GpuMemoryManagerClient overrides.
73 virtual void AppendAllCommandBufferStubs( 73 virtual void AppendAllCommandBufferStubs(
74 std::vector<GpuCommandBufferStubBase*>& stubs) OVERRIDE; 74 std::vector<GpuCommandBufferStubBase*>& stubs) OVERRIDE;
75 75
76 void LoseAllContexts(); 76 void LoseAllContexts();
77 77
78 base::WeakPtrFactory<GpuChannelManager> weak_factory_; 78 base::WeakPtrFactory<GpuChannelManager> weak_factory_;
79 79
80 int GenerateRouteID(); 80 int GenerateRouteID();
81 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); 81 void AddRoute(int32 routing_id, IPC::Listener* listener);
82 void RemoveRoute(int32 routing_id); 82 void RemoveRoute(int32 routing_id);
83 83
84 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } 84 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; }
85 85
86 GpuChannel* LookupChannel(int32 client_id); 86 GpuChannel* LookupChannel(int32 client_id);
87 87
88 SyncPointManager* sync_point_manager() { return sync_point_manager_; } 88 SyncPointManager* sync_point_manager() { return sync_point_manager_; }
89 89
90 private: 90 private:
91 // Message handlers. 91 // Message handlers.
(...skipping 23 matching lines...) Expand all
115 scoped_refptr<gfx::GLShareGroup> share_group_; 115 scoped_refptr<gfx::GLShareGroup> share_group_;
116 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; 116 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_;
117 GpuMemoryManager gpu_memory_manager_; 117 GpuMemoryManager gpu_memory_manager_;
118 GpuWatchdog* watchdog_; 118 GpuWatchdog* watchdog_;
119 scoped_refptr<SyncPointManager> sync_point_manager_; 119 scoped_refptr<SyncPointManager> sync_point_manager_;
120 120
121 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); 121 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager);
122 }; 122 };
123 123
124 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 124 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698