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 PPAPI_PROXY_EXTENSIONS_COMMON_RESOURCE_H_
6 #define PPAPI_PROXY_EXTENSIONS_COMMON_RESOURCE_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ppapi/proxy/connection.h"
11 #include "ppapi/proxy/plugin_resource.h"
12 #include "ppapi/thunk/extensions_common_api.h"
21 class ResourceMessageReplyParams
;
23 class ExtensionsCommonResource
: public PluginResource
,
24 public thunk::ExtensionsCommon_API
{
26 ExtensionsCommonResource(Connection connection
, PP_Instance instance
);
27 virtual ~ExtensionsCommonResource();
29 // Resource overrides.
30 virtual thunk::ExtensionsCommon_API
* AsExtensionsCommon_API() OVERRIDE
;
32 // ExtensionsCommon_API implementation.
33 virtual int32_t CallRenderer(
34 const std::string
& request_name
,
35 const std::vector
<PP_Var
>& input_args
,
36 const std::vector
<PP_Var
*>& output_args
,
37 scoped_refptr
<TrackedCallback
> callback
) OVERRIDE
;
38 virtual void PostRenderer(const std::string
& request_name
,
39 const std::vector
<PP_Var
>& args
) OVERRIDE
;
40 virtual int32_t CallBrowser(const std::string
& request_name
,
41 const std::vector
<PP_Var
>& input_args
,
42 const std::vector
<PP_Var
*>& output_args
,
43 scoped_refptr
<TrackedCallback
> callback
) OVERRIDE
;
44 virtual void PostBrowser(const std::string
& request_name
,
45 const std::vector
<PP_Var
>& args
) OVERRIDE
;
48 int32_t CommonCall(Destination dest
,
49 const std::string
& request_name
,
50 const std::vector
<PP_Var
>& input_args
,
51 const std::vector
<PP_Var
*>& output_args
,
52 scoped_refptr
<TrackedCallback
> callback
);
53 void CommonPost(Destination dest
,
54 const std::string
& request_name
,
55 const std::vector
<PP_Var
>& args
);
57 void OnPluginMsgCallReply(const std::vector
<PP_Var
*>& output_args
,
58 scoped_refptr
<TrackedCallback
> callback
,
59 const ResourceMessageReplyParams
& params
,
60 const base::ListValue
& output
);
62 DISALLOW_COPY_AND_ASSIGN(ExtensionsCommonResource
);
68 #endif // PPAPI_PROXY_EXTENSIONS_COMMON_RESOURCE_H_