OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_PROXY_TALK_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_TALK_RESOURCE_H_ |
6 #define PPAPI_PROXY_TALK_RESOURCE_H_ | 6 #define PPAPI_PROXY_TALK_RESOURCE_H_ |
7 | 7 |
8 #include "ppapi/proxy/plugin_resource.h" | 8 #include "ppapi/proxy/plugin_resource.h" |
9 #include "ppapi/proxy/ppapi_proxy_export.h" | 9 #include "ppapi/proxy/ppapi_proxy_export.h" |
10 #include "ppapi/shared_impl/tracked_callback.h" | 10 #include "ppapi/shared_impl/tracked_callback.h" |
11 #include "ppapi/thunk/ppb_talk_private_api.h" | 11 #include "ppapi/thunk/ppb_talk_private_api.h" |
12 | 12 |
13 namespace ppapi { | 13 namespace ppapi { |
14 namespace proxy { | 14 namespace proxy { |
15 | 15 |
16 class PPAPI_PROXY_EXPORT TalkResource | 16 class PPAPI_PROXY_EXPORT TalkResource |
17 : public PluginResource, | 17 : public PluginResource, |
18 public NON_EXPORTED_BASE(thunk::PPB_Talk_Private_API) { | 18 public NON_EXPORTED_BASE(thunk::PPB_Talk_Private_API) { |
19 public: | 19 public: |
20 TalkResource(Connection connection, PP_Instance instance); | 20 TalkResource(Connection connection, PP_Instance instance); |
21 virtual ~TalkResource(); | 21 virtual ~TalkResource(); |
22 | 22 |
23 // Resource overrides. | 23 // Resource overrides. |
24 thunk::PPB_Talk_Private_API* AsPPB_Talk_Private_API(); | 24 thunk::PPB_Talk_Private_API* AsPPB_Talk_Private_API(); |
25 | 25 |
26 private: | 26 private: |
27 // PPB_Talk_API implementation. | 27 // PPB_Talk_API implementation. |
28 virtual int32_t RequestPermission( | 28 virtual int32_t RequestPermission( |
29 PP_TalkPermission permission, | 29 PP_TalkPermission permission, |
30 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 30 scoped_refptr<TrackedCallback> callback) override; |
31 virtual int32_t StartRemoting( | 31 virtual int32_t StartRemoting( |
32 PP_TalkEventCallback event_callback, | 32 PP_TalkEventCallback event_callback, |
33 void* user_data, | 33 void* user_data, |
34 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 34 scoped_refptr<TrackedCallback> callback) override; |
35 virtual int32_t StopRemoting( | 35 virtual int32_t StopRemoting( |
36 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 36 scoped_refptr<TrackedCallback> callback) override; |
37 | 37 |
38 // PluginResource override. | 38 // PluginResource override. |
39 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, | 39 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, |
40 const IPC::Message& msg) OVERRIDE; | 40 const IPC::Message& msg) override; |
41 | 41 |
42 void OnNotifyEvent(const ResourceMessageReplyParams& params, | 42 void OnNotifyEvent(const ResourceMessageReplyParams& params, |
43 PP_TalkEvent event); | 43 PP_TalkEvent event); |
44 void OnRequestPermissionReply(const ResourceMessageReplyParams& params); | 44 void OnRequestPermissionReply(const ResourceMessageReplyParams& params); |
45 void OnStartRemotingReply(const ResourceMessageReplyParams& params); | 45 void OnStartRemotingReply(const ResourceMessageReplyParams& params); |
46 void OnStopRemotingReply(const ResourceMessageReplyParams& params); | 46 void OnStopRemotingReply(const ResourceMessageReplyParams& params); |
47 | 47 |
48 scoped_refptr<TrackedCallback> permission_callback_; | 48 scoped_refptr<TrackedCallback> permission_callback_; |
49 scoped_refptr<TrackedCallback> start_callback_; | 49 scoped_refptr<TrackedCallback> start_callback_; |
50 scoped_refptr<TrackedCallback> stop_callback_; | 50 scoped_refptr<TrackedCallback> stop_callback_; |
51 PP_TalkEventCallback event_callback_; | 51 PP_TalkEventCallback event_callback_; |
52 void* event_callback_user_data_; | 52 void* event_callback_user_data_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(TalkResource); | 54 DISALLOW_COPY_AND_ASSIGN(TalkResource); |
55 }; | 55 }; |
56 | 56 |
57 } // namespace proxy | 57 } // namespace proxy |
58 } // namespace ppapi | 58 } // namespace ppapi |
59 | 59 |
60 #endif // PPAPI_PROXY_TALK_RESOURCE_H_ | 60 #endif // PPAPI_PROXY_TALK_RESOURCE_H_ |
OLD | NEW |