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

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.h

Issue 10749019: VideoDecodeAccelerator now SupportsWeakPtr instead of being RefCountedThreadSafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 | « no previous file | content/common/gpu/client/command_buffer_proxy_impl.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_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 5 #ifndef CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
7 7
8 #if defined(ENABLE_GPU) 8 #if defined(ENABLE_GPU)
9 9
10 #include <map> 10 #include <map>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 CommandBufferProxyImpl(GpuChannelHost* channel, int route_id); 44 CommandBufferProxyImpl(GpuChannelHost* channel, int route_id);
45 virtual ~CommandBufferProxyImpl(); 45 virtual ~CommandBufferProxyImpl();
46 46
47 // Sends an IPC message to create a GpuVideoDecodeAccelerator. Creates and 47 // Sends an IPC message to create a GpuVideoDecodeAccelerator. Creates and
48 // returns a pointer to a GpuVideoDecodeAcceleratorHost. 48 // returns a pointer to a GpuVideoDecodeAcceleratorHost.
49 // Returns NULL on failure to create the GpuVideoDecodeAcceleratorHost. 49 // Returns NULL on failure to create the GpuVideoDecodeAcceleratorHost.
50 // Note that the GpuVideoDecodeAccelerator may still fail to be created in 50 // Note that the GpuVideoDecodeAccelerator may still fail to be created in
51 // the GPU process, even if this returns non-NULL. In this case the client is 51 // the GPU process, even if this returns non-NULL. In this case the client is
52 // notified of an error later. 52 // notified of an error later.
53 scoped_refptr<GpuVideoDecodeAcceleratorHost> CreateVideoDecoder( 53 GpuVideoDecodeAcceleratorHost* CreateVideoDecoder(
54 media::VideoCodecProfile profile, 54 media::VideoCodecProfile profile,
55 media::VideoDecodeAccelerator::Client* client); 55 media::VideoDecodeAccelerator::Client* client);
56 56
57 // IPC::Listener implementation: 57 // IPC::Listener implementation:
58 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 58 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
59 virtual void OnChannelError() OVERRIDE; 59 virtual void OnChannelError() OVERRIDE;
60 60
61 // CommandBufferProxy implementation: 61 // CommandBufferProxy implementation:
62 virtual int GetRouteID() const OVERRIDE; 62 virtual int GetRouteID() const OVERRIDE;
63 virtual bool Echo(const base::Closure& callback) OVERRIDE; 63 virtual bool Echo(const base::Closure& callback) OVERRIDE;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // TODO(apatrick): this is a temporary optimization while skia is calling 100 // TODO(apatrick): this is a temporary optimization while skia is calling
101 // ContentGLContext::MakeCurrent prior to every GL call. It saves returning 6 101 // ContentGLContext::MakeCurrent prior to every GL call. It saves returning 6
102 // ints redundantly when only the error is needed for the 102 // ints redundantly when only the error is needed for the
103 // CommandBufferProxyImpl implementation. 103 // CommandBufferProxyImpl implementation.
104 virtual gpu::error::Error GetLastError() OVERRIDE; 104 virtual gpu::error::Error GetLastError() OVERRIDE;
105 105
106 GpuChannelHost* channel() const { return channel_; } 106 GpuChannelHost* channel() const { return channel_; }
107 107
108 private: 108 private:
109 typedef std::map<int32, gpu::Buffer> TransferBufferMap; 109 typedef std::map<int32, gpu::Buffer> TransferBufferMap;
110 typedef std::map<int, scoped_refptr<GpuVideoDecodeAcceleratorHost> > Decoders; 110 typedef std::map<int, GpuVideoDecodeAcceleratorHost*> Decoders;
111 typedef base::hash_map<uint32, base::Closure> SignalTaskMap; 111 typedef base::hash_map<uint32, base::Closure> SignalTaskMap;
112 112
113 // Send an IPC message over the GPU channel. This is private to fully 113 // Send an IPC message over the GPU channel. This is private to fully
114 // encapsulate the channel; all callers of this function must explicitly 114 // encapsulate the channel; all callers of this function must explicitly
115 // verify that the context has not been lost. 115 // verify that the context has not been lost.
116 bool Send(IPC::Message* msg); 116 bool Send(IPC::Message* msg);
117 117
118 // Message handlers: 118 // Message handlers:
119 void OnUpdateState(const gpu::CommandBuffer::State& state); 119 void OnUpdateState(const gpu::CommandBuffer::State& state);
120 void OnNotifyRepaint(); 120 void OnNotifyRepaint();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // Tasks to be invoked in SignalSyncPoint responses. 162 // Tasks to be invoked in SignalSyncPoint responses.
163 uint32 next_signal_id_; 163 uint32 next_signal_id_;
164 SignalTaskMap signal_tasks_; 164 SignalTaskMap signal_tasks_;
165 165
166 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); 166 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl);
167 }; 167 };
168 168
169 #endif // ENABLE_GPU 169 #endif // ENABLE_GPU
170 170
171 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 171 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698