summaryrefslogtreecommitdiffstats
path: root/ppapi/host/message_filter_host.h
blob: cfc52451539bd2c07e7c42ae186f1b5f00dbde08 (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
// Copyright (c) 2012 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 PPAPI_HOST_MESSAGE_FILTER_HOST_H_
#define PPAPI_HOST_MESSAGE_FILTER_HOST_H_

#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "ppapi/host/ppapi_host_export.h"
#include "ppapi/host/resource_host.h"

namespace ppapi {
namespace host {

class PpapiHost;
class ResourceMessageFilter;

// This class is a generic ResourceHost that is composed of a single
// ResourceMessageFilter. There are cases where ResourceHosts only serve the
// purpose of passing messages onto a message filter to be handled on another
// thread. This class can be used as the host in those cases.
class PPAPI_HOST_EXPORT MessageFilterHost : public ResourceHost {
 public:
  MessageFilterHost(PpapiHost* host,
                    PP_Instance instance,
                    PP_Resource resource,
                    const scoped_refptr<ResourceMessageFilter>& message_filter);
  virtual ~MessageFilterHost();

 private:
  DISALLOW_COPY_AND_ASSIGN(MessageFilterHost);
};

}  // namespace host
}  // namespace ppapi

#endif  // PPAPI_HOST_MESSAGE_FILTER_HOST_H_