- add sources.
[platform/framework/web/crosswalk.git] / src / content / renderer / media / render_media_log.h
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_MEDIA_RENDER_MEDIA_LOG_H_
6 #define CONTENT_RENDERER_MEDIA_RENDER_MEDIA_LOG_H_
7
8 #include <vector>
9 #include "base/time/time.h"
10 #include "media/base/media_log.h"
11
12 namespace base {
13 class MessageLoopProxy;
14 }
15
16 namespace content {
17
18 // RenderMediaLog is an implementation of MediaLog that passes all events to the
19 // browser process, throttling as necessary.
20 class RenderMediaLog : public media::MediaLog {
21  public:
22   RenderMediaLog();
23
24   // MediaLog implementation.
25   virtual void AddEvent(scoped_ptr<media::MediaLogEvent> event) OVERRIDE;
26
27  private:
28   virtual ~RenderMediaLog();
29
30   scoped_refptr<base::MessageLoopProxy> render_loop_;
31   base::Time last_ipc_send_time_;
32   std::vector<media::MediaLogEvent> queued_media_events_;
33
34   DISALLOW_COPY_AND_ASSIGN(RenderMediaLog);
35 };
36
37 }  // namespace content
38
39 #endif  // CONTENT_RENDERER_MEDIA_RENDER_MEDIA_LOG_H_