Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / renderer / pepper / pepper_extensions_common_host.h
blobafe0658f8dde5ec45fa01da2bee1d745453066d5
1 // Copyright (c) 2013 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.
5 #ifndef CHROME_RENDERER_PEPPER_PEPPER_EXTENSIONS_COMMON_HOST_H_
6 #define CHROME_RENDERER_PEPPER_PEPPER_EXTENSIONS_COMMON_HOST_H_
8 #include <map>
9 #include <string>
11 #include "base/basictypes.h"
12 #include "base/bind.h"
13 #include "base/compiler_specific.h"
14 #include "base/memory/linked_ptr.h"
15 #include "base/memory/weak_ptr.h"
16 #include "chrome/renderer/extensions/pepper_request_proxy.h"
17 #include "ppapi/host/resource_host.h"
19 namespace base {
20 class ListValue;
23 namespace content {
24 class RendererPpapiHost;
27 namespace ppapi {
28 namespace host {
29 struct ReplyMessageContext;
33 namespace extensions {
34 class Dispatcher;
37 class PepperExtensionsCommonHost : public ppapi::host::ResourceHost {
38 public:
39 virtual ~PepperExtensionsCommonHost();
41 static PepperExtensionsCommonHost* Create(content::RendererPpapiHost* host,
42 PP_Instance instance,
43 PP_Resource resource);
45 // ppapi::host::ResourceMessageHandler overrides.
46 virtual int32_t OnResourceMessageReceived(
47 const IPC::Message& msg,
48 ppapi::host::HostMessageContext* context) OVERRIDE;
50 private:
51 PepperExtensionsCommonHost(
52 content::RendererPpapiHost* host,
53 PP_Instance instance,
54 PP_Resource resource,
55 extensions::PepperRequestProxy* pepper_request_proxy);
57 int32_t OnPost(ppapi::host::HostMessageContext* context,
58 const std::string& request_name,
59 const base::ListValue& args);
61 int32_t OnCall(ppapi::host::HostMessageContext* context,
62 const std::string& request_name,
63 const base::ListValue& args);
65 void OnResponseReceived(ppapi::host::ReplyMessageContext reply_context,
66 bool success,
67 const base::ListValue& response,
68 const std::string& error);
70 // Non-owning pointer.
71 content::RendererPpapiHost* renderer_ppapi_host_;
72 // Non-owning pointer.
73 extensions::PepperRequestProxy* pepper_request_proxy_;
75 base::WeakPtrFactory<PepperExtensionsCommonHost> weak_factory_;
77 DISALLOW_COPY_AND_ASSIGN(PepperExtensionsCommonHost);
80 #endif // CHROME_RENDERER_PEPPER_PEPPER_EXTENSIONS_COMMON_HOST_H_