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

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

Issue 19534002: Make RendererGpuVideoDecoderFactories live on arbitrary threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 7 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
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/memory/memory_pressure_listener.h" 12 #include "base/memory/memory_pressure_listener.h"
13 #include "base/observer_list.h" 13 #include "base/observer_list.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "base/timer/timer.h" 15 #include "base/timer/timer.h"
16 #include "build/build_config.h" 16 #include "build/build_config.h"
17 #include "content/child/child_thread.h" 17 #include "content/child/child_thread.h"
18 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
19 #include "content/common/gpu/client/gpu_channel_host.h" 19 #include "content/common/gpu/client/gpu_channel_host.h"
20 #include "content/common/gpu/gpu_process_launch_causes.h" 20 #include "content/common/gpu/gpu_process_launch_causes.h"
21 #include "content/public/renderer/render_thread.h" 21 #include "content/public/renderer/render_thread.h"
22 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h"
22 #include "ipc/ipc_channel_proxy.h" 23 #include "ipc/ipc_channel_proxy.h"
23 #include "media/filters/gpu_video_decoder.h"
24 #include "ui/gfx/native_widget_types.h" 24 #include "ui/gfx/native_widget_types.h"
25 25
26 class GrContext; 26 class GrContext;
27 class SkBitmap; 27 class SkBitmap;
28 struct ViewMsg_New_Params; 28 struct ViewMsg_New_Params;
29 29
30 namespace WebKit { 30 namespace WebKit {
31 class WebGraphicsContext3D; 31 class WebGraphicsContext3D;
32 class WebMediaStreamCenter; 32 class WebMediaStreamCenter;
33 class WebMediaStreamCenterClient; 33 class WebMediaStreamCenterClient;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // on the renderer's main thread. 249 // on the renderer's main thread.
250 scoped_refptr<base::MessageLoopProxy> GetMediaThreadMessageLoopProxy(); 250 scoped_refptr<base::MessageLoopProxy> GetMediaThreadMessageLoopProxy();
251 251
252 // Causes the idle handler to skip sending idle notifications 252 // Causes the idle handler to skip sending idle notifications
253 // on the two next scheduled calls, so idle notifications are 253 // on the two next scheduled calls, so idle notifications are
254 // not sent for at least one notification delay. 254 // not sent for at least one notification delay.
255 void PostponeIdleNotification(); 255 void PostponeIdleNotification();
256 256
257 // Gets gpu factories. Returns NULL if VDA is disabled or a graphics context 257 // Gets gpu factories. Returns NULL if VDA is disabled or a graphics context
258 // cannot be obtained. 258 // cannot be obtained.
259 scoped_refptr<media::GpuVideoDecoder::Factories> GetGpuFactories(); 259 scoped_refptr<content::RendererGpuVideoDecoderFactories> GetGpuFactories(
scherkus (not reviewing) 2013/07/19 18:13:58 don't need content:: but... why are we returning
wuchengli 2013/07/20 06:04:14 Yes. We can. I wasn't sure if it's good to put Clo
260 scoped_refptr<base::MessageLoopProxy> factories_loop);
scherkus (not reviewing) 2013/07/19 18:13:58 update docs about |factories_loop| even though wi
scherkus (not reviewing) 2013/07/19 18:13:58 this can be const-ref
wuchengli 2013/07/20 06:04:14 Done.
wuchengli 2013/07/20 06:04:14 Done.
260 261
261 // Returns a graphics context shared among all 262 // Returns a graphics context shared among all
262 // RendererGpuVideoDecoderFactories, or NULL on error. Context remains owned 263 // RendererGpuVideoDecoderFactories, or NULL on error. Context remains owned
263 // by this class and must be null-tested before each use to detect context 264 // by this class and must be null-tested before each use to detect context
264 // loss. The returned context is only valid on the compositor thread when 265 // loss. The returned context is only valid on the compositor thread when
265 // threaded compositing is enabled. 266 // threaded compositing is enabled.
266 WebGraphicsContext3DCommandBufferImpl* GetGpuVDAContext3D(); 267 WebGraphicsContext3DCommandBufferImpl* GetGpuVDAContext3D();
267 268
268 // Handle loss of the shared GpuVDAContext3D context above. 269 // Handle loss of the shared GpuVDAContext3D context above.
269 static void OnGpuVDAContextLoss(); 270 static void OnGpuVDAContextLoss();
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 HistogramCustomizer histogram_customizer_; 477 HistogramCustomizer histogram_customizer_;
477 478
478 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; 479 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_;
479 480
480 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 481 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
481 }; 482 };
482 483
483 } // namespace content 484 } // namespace content
484 485
485 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 486 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698