summaryrefslogtreecommitdiffstats
path: root/chromecast/renderer/cast_render_process_observer.h
blob: 479026c5717a284a1f2d0175ba2ecce7b56a63bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMECAST_RENDERER_CAST_RENDER_PROCESS_OBSERVER_H_
#define CHROMECAST_RENDERER_CAST_RENDER_PROCESS_OBSERVER_H_

#include <vector>

#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "content/public/renderer/render_process_observer.h"

namespace IPC {
class MessageFilter;
}

namespace chromecast {
class CapabilitiesMessageFilter;
namespace media {
class CmaMessageFilterProxy;
}

namespace shell {

class CastRenderProcessObserver : public content::RenderProcessObserver {
 public:
  CastRenderProcessObserver(
      const std::vector<scoped_refptr<IPC::MessageFilter>>&
          platform_message_filters);
  ~CastRenderProcessObserver() override;

 private:
  // content::RenderProcessObserver implementation:
  void OnRenderProcessShutdown() override;

  void CreateCustomFilters();

#if !defined(OS_ANDROID)
  scoped_refptr<media::CmaMessageFilterProxy> cma_message_filter_proxy_;
#endif  // !defined(OS_ANDROID)
  scoped_refptr<CapabilitiesMessageFilter> capabilities_message_filter_;
  std::vector<scoped_refptr<IPC::MessageFilter>> platform_message_filters_;

  DISALLOW_COPY_AND_ASSIGN(CastRenderProcessObserver);
};

}  // namespace shell
}  // namespace chromecast

#endif  // CHROMECAST_RENDERER_CAST_RENDER_PROCESS_OBSERVER_H_