Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: ppapi/proxy/talk_resource.cc

Issue 281803003: Add PPAPI_BEGIN_MESSAGE_MAP and PPAPI_END_MESSAGE_MAP to be used when dispatching IPCs using PPAPI_… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "ppapi/proxy/talk_resource.h" 5 #include "ppapi/proxy/talk_resource.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "ppapi/proxy/ppapi_messages.h" 8 #include "ppapi/proxy/ppapi_messages.h"
9 9
10 namespace ppapi { 10 namespace ppapi {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 Call<PpapiPluginMsg_Talk_StopRemotingReply>( 71 Call<PpapiPluginMsg_Talk_StopRemotingReply>(
72 BROWSER, 72 BROWSER,
73 PpapiHostMsg_Talk_StopRemoting(), 73 PpapiHostMsg_Talk_StopRemoting(),
74 base::Bind(&TalkResource::OnStopRemotingReply, 74 base::Bind(&TalkResource::OnStopRemotingReply,
75 base::Unretained(this))); 75 base::Unretained(this)));
76 return PP_OK_COMPLETIONPENDING; 76 return PP_OK_COMPLETIONPENDING;
77 } 77 }
78 78
79 void TalkResource::OnReplyReceived(const ResourceMessageReplyParams& params, 79 void TalkResource::OnReplyReceived(const ResourceMessageReplyParams& params,
80 const IPC::Message& msg) { 80 const IPC::Message& msg) {
81 IPC_BEGIN_MESSAGE_MAP(TalkResource, msg) 81 PPAPI_BEGIN_MESSAGE_MAP(TalkResource, msg)
82 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( 82 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL(
83 PpapiPluginMsg_Talk_NotifyEvent, 83 PpapiPluginMsg_Talk_NotifyEvent,
84 OnNotifyEvent) 84 OnNotifyEvent)
85 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED( 85 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED(
86 PluginResource::OnReplyReceived(params, msg)) 86 PluginResource::OnReplyReceived(params, msg))
87 IPC_END_MESSAGE_MAP() 87 PPAPI_END_MESSAGE_MAP()
88 } 88 }
89 89
90 void TalkResource::OnNotifyEvent(const ResourceMessageReplyParams& params, 90 void TalkResource::OnNotifyEvent(const ResourceMessageReplyParams& params,
91 PP_TalkEvent event) { 91 PP_TalkEvent event) {
92 if (event_callback_ != NULL) 92 if (event_callback_ != NULL)
93 event_callback_(event_callback_user_data_, event); 93 event_callback_(event_callback_user_data_, event);
94 } 94 }
95 95
96 void TalkResource::OnRequestPermissionReply( 96 void TalkResource::OnRequestPermissionReply(
97 const ResourceMessageReplyParams& params) { 97 const ResourceMessageReplyParams& params) {
98 permission_callback_->Run(params.result()); 98 permission_callback_->Run(params.result());
99 } 99 }
100 100
101 void TalkResource::OnStartRemotingReply( 101 void TalkResource::OnStartRemotingReply(
102 const ResourceMessageReplyParams& params) { 102 const ResourceMessageReplyParams& params) {
103 start_callback_->Run(params.result()); 103 start_callback_->Run(params.result());
104 } 104 }
105 105
106 void TalkResource::OnStopRemotingReply( 106 void TalkResource::OnStopRemotingReply(
107 const ResourceMessageReplyParams& params) { 107 const ResourceMessageReplyParams& params) {
108 event_callback_ = NULL; 108 event_callback_ = NULL;
109 event_callback_user_data_ = NULL; 109 event_callback_user_data_ = NULL;
110 stop_callback_->Run(params.result()); 110 stop_callback_->Run(params.result());
111 } 111 }
112 112
113 } // namespace proxy 113 } // namespace proxy
114 } // namespace ppapi 114 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698