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

Side by Side Diff: media/blink/webmediaplayer_params.h

Issue 1409123005: Add methods for telling V8 how much memory audio/video is using. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mock filter. Created 5 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
(...skipping 14 matching lines...) Expand all
25 class AudioRendererSink; 25 class AudioRendererSink;
26 class MediaLog; 26 class MediaLog;
27 class MediaPermission; 27 class MediaPermission;
28 28
29 // Holds parameters for constructing WebMediaPlayerImpl without having 29 // Holds parameters for constructing WebMediaPlayerImpl without having
30 // to plumb arguments through various abstraction layers. 30 // to plumb arguments through various abstraction layers.
31 class MEDIA_EXPORT WebMediaPlayerParams { 31 class MEDIA_EXPORT WebMediaPlayerParams {
32 public: 32 public:
33 typedef base::Callback<void(const base::Closure&)> DeferLoadCB; 33 typedef base::Callback<void(const base::Closure&)> DeferLoadCB;
34 typedef base::Callback<Context3D()> Context3DCB; 34 typedef base::Callback<Context3D()> Context3DCB;
35 typedef base::Callback<int64_t(int64_t)> AdjustAllocatedMemoryCB;
xhwang 2015/10/25 17:01:56 Please add a comment for this callback. It wasn't
DaleCurtis 2015/10/27 23:14:20 Done.
35 36
36 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and 37 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and
37 // |context_3d_cb| may be null. 38 // |context_3d_cb| may be null.
38 WebMediaPlayerParams( 39 WebMediaPlayerParams(
39 const DeferLoadCB& defer_load_cb, 40 const DeferLoadCB& defer_load_cb,
40 const scoped_refptr<AudioRendererSink>& audio_renderer_sink, 41 const scoped_refptr<AudioRendererSink>& audio_renderer_sink,
41 const scoped_refptr<MediaLog>& media_log, 42 const scoped_refptr<MediaLog>& media_log,
42 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, 43 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
43 const scoped_refptr<base::TaskRunner>& worker_task_runner, 44 const scoped_refptr<base::TaskRunner>& worker_task_runner,
44 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, 45 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
45 const Context3DCB& context_3d, 46 const Context3DCB& context_3d,
47 const AdjustAllocatedMemoryCB& adjust_allocated_memory_cb,
46 MediaPermission* media_permission, 48 MediaPermission* media_permission,
47 blink::WebContentDecryptionModule* initial_cdm); 49 blink::WebContentDecryptionModule* initial_cdm);
48 50
49 ~WebMediaPlayerParams(); 51 ~WebMediaPlayerParams();
50 52
51 DeferLoadCB defer_load_cb() const { return defer_load_cb_; } 53 DeferLoadCB defer_load_cb() const { return defer_load_cb_; }
52 54
53 const scoped_refptr<AudioRendererSink>& audio_renderer_sink() const { 55 const scoped_refptr<AudioRendererSink>& audio_renderer_sink() const {
54 return audio_renderer_sink_; 56 return audio_renderer_sink_;
55 } 57 }
(...skipping 16 matching lines...) Expand all
72 } 74 }
73 75
74 Context3DCB context_3d_cb() const { return context_3d_cb_; } 76 Context3DCB context_3d_cb() const { return context_3d_cb_; }
75 77
76 MediaPermission* media_permission() const { return media_permission_; } 78 MediaPermission* media_permission() const { return media_permission_; }
77 79
78 blink::WebContentDecryptionModule* initial_cdm() const { 80 blink::WebContentDecryptionModule* initial_cdm() const {
79 return initial_cdm_; 81 return initial_cdm_;
80 } 82 }
81 83
84 AdjustAllocatedMemoryCB adjust_allocated_memory_cb() const {
85 return adjust_allocated_memory_cb_;
86 }
82 87
83 private: 88 private:
84 DeferLoadCB defer_load_cb_; 89 DeferLoadCB defer_load_cb_;
85 scoped_refptr<AudioRendererSink> audio_renderer_sink_; 90 scoped_refptr<AudioRendererSink> audio_renderer_sink_;
86 scoped_refptr<MediaLog> media_log_; 91 scoped_refptr<MediaLog> media_log_;
87 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; 92 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
88 scoped_refptr<base::TaskRunner> worker_task_runner_; 93 scoped_refptr<base::TaskRunner> worker_task_runner_;
89 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; 94 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
90 Context3DCB context_3d_cb_; 95 Context3DCB context_3d_cb_;
96 AdjustAllocatedMemoryCB adjust_allocated_memory_cb_;
91 97
92 // TODO(xhwang): Remove after prefixed EME API support is removed. 98 // TODO(xhwang): Remove after prefixed EME API support is removed.
93 MediaPermission* media_permission_; 99 MediaPermission* media_permission_;
94 blink::WebContentDecryptionModule* initial_cdm_; 100 blink::WebContentDecryptionModule* initial_cdm_;
95 101
96 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); 102 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams);
97 }; 103 };
98 104
99 } // namespace media 105 } // namespace media
100 106
101 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ 107 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698