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

Side by Side Diff: content/renderer/render_thread_impl.h

Issue 10832264: Fix lifecycle-vs-threads of GpuVDAContext3D. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: piman CR response Created 8 years, 4 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
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_RENDERER_RENDER_THREAD_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/observer_list.h" 12 #include "base/observer_list.h"
13 #include "base/time.h" 13 #include "base/time.h"
14 #include "base/timer.h" 14 #include "base/timer.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "content/common/child_process.h" 16 #include "content/common/child_process.h"
17 #include "content/common/child_thread.h" 17 #include "content/common/child_thread.h"
18 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
19 #include "content/common/css_colors.h" 19 #include "content/common/css_colors.h"
20 #include "content/common/gpu/client/gpu_channel_host.h" 20 #include "content/common/gpu/client/gpu_channel_host.h"
21 #include "content/common/gpu/gpu_process_launch_causes.h" 21 #include "content/common/gpu/gpu_process_launch_causes.h"
22 #include "content/public/renderer/render_thread.h" 22 #include "content/public/renderer/render_thread.h"
23 #include "ipc/ipc_channel_proxy.h" 23 #include "ipc/ipc_channel_proxy.h"
24 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h"
24 #include "ui/gfx/native_widget_types.h" 25 #include "ui/gfx/native_widget_types.h"
25 26
26 class AppCacheDispatcher; 27 class AppCacheDispatcher;
27 class AudioInputMessageFilter; 28 class AudioInputMessageFilter;
28 class AudioMessageFilter; 29 class AudioMessageFilter;
29 class CompositorThread; 30 class CompositorThread;
30 class DBMessageFilter; 31 class DBMessageFilter;
31 class DevToolsAgentFilter; 32 class DevToolsAgentFilter;
32 class DomStorageDispatcher; 33 class DomStorageDispatcher;
33 class GpuChannelHost; 34 class GpuChannelHost;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 scoped_refptr<base::MessageLoopProxy> GetFileThreadMessageLoopProxy(); 212 scoped_refptr<base::MessageLoopProxy> GetFileThreadMessageLoopProxy();
212 213
213 // Causes the idle handler to skip sending idle notifications 214 // Causes the idle handler to skip sending idle notifications
214 // on the two next scheduled calls, so idle notifications are 215 // on the two next scheduled calls, so idle notifications are
215 // not sent for at least one notification delay. 216 // not sent for at least one notification delay.
216 void PostponeIdleNotification(); 217 void PostponeIdleNotification();
217 218
218 // Returns a graphics context shared among all 219 // Returns a graphics context shared among all
219 // RendererGpuVideoDecoderFactories, or NULL on error. Context remains owned 220 // RendererGpuVideoDecoderFactories, or NULL on error. Context remains owned
220 // by this class and must be null-tested before each use to detect context 221 // by this class and must be null-tested before each use to detect context
221 // loss. The returned WeakPtr<> is only valid on the compositor thread when 222 // loss. The returned context is only valid on the compositor thread when
222 // threaded compositing is enabled. 223 // threaded compositing is enabled.
223 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> GetGpuVDAContext3D(); 224 WebGraphicsContext3DCommandBufferImpl* GetGpuVDAContext3D();
225
226 // Handle loss of the shared GpuVDAContext3D context above.
227 static void OnGpuVDAContextLoss();
224 228
225 // AudioRendererMixerManager instance which manages renderer side mixer 229 // AudioRendererMixerManager instance which manages renderer side mixer
226 // instances shared based on configured audio parameters. Lazily created on 230 // instances shared based on configured audio parameters. Lazily created on
227 // first call. 231 // first call.
228 content::AudioRendererMixerManager* GetAudioRendererMixerManager(); 232 content::AudioRendererMixerManager* GetAudioRendererMixerManager();
229 233
230 private: 234 private:
231 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; 235 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
232 236
233 void Init(); 237 void Init();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 296
293 // A lazily initiated thread on which file operations are run. 297 // A lazily initiated thread on which file operations are run.
294 scoped_ptr<base::Thread> file_thread_; 298 scoped_ptr<base::Thread> file_thread_;
295 299
296 bool compositor_initialized_; 300 bool compositor_initialized_;
297 scoped_ptr<CompositorThread> compositor_thread_; 301 scoped_ptr<CompositorThread> compositor_thread_;
298 scoped_ptr<content::old::BrowserPluginRegistry> browser_plugin_registry_; 302 scoped_ptr<content::old::BrowserPluginRegistry> browser_plugin_registry_;
299 303
300 ObserverList<content::RenderProcessObserver> observers_; 304 ObserverList<content::RenderProcessObserver> observers_;
301 305
306 class GpuVDAContextLostCallback
307 : public WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback {
piman 2012/08/13 17:45:06 Note: I'm fine with this, but FYI you can declare
Ami GONE FROM CHROMIUM 2012/08/13 17:55:38 Taking advantage of the scoped_ptr for auto-dtor g
piman 2012/08/13 18:35:57 Nah, you only need it with the destructor of Rende
308 public:
309 GpuVDAContextLostCallback();
310 virtual ~GpuVDAContextLostCallback();
311 virtual void onContextLost();
312 };
313
314 scoped_ptr<GpuVDAContextLostCallback> context_lost_cb_;
302 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> gpu_vda_context3d_; 315 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> gpu_vda_context3d_;
303 316
304 scoped_ptr<content::AudioRendererMixerManager> audio_renderer_mixer_manager_; 317 scoped_ptr<content::AudioRendererMixerManager> audio_renderer_mixer_manager_;
305 318
306 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 319 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
307 }; 320 };
308 321
309 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 322 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/media/renderer_gpu_video_decoder_factories.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698