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

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

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 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
« no previous file with comments | « ppapi/proxy/ppb_audio_proxy.h ('k') | ppapi/proxy/ppb_buffer_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/ppb_audio_proxy.h" 5 #include "ppapi/proxy/ppb_audio_proxy.h"
6 6
7 #include "base/simple_thread.h" 7 #include "base/simple_thread.h"
8 #include "ppapi/c/dev/ppb_audio_dev.h" 8 #include "ppapi/c/dev/ppb_audio_dev.h"
9 #include "ppapi/c/dev/ppb_audio_trusted_dev.h" 9 #include "ppapi/c/dev/ppb_audio_trusted_dev.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 const void* PPB_Audio_Proxy::GetSourceInterface() const { 127 const void* PPB_Audio_Proxy::GetSourceInterface() const {
128 return &audio_interface; 128 return &audio_interface;
129 } 129 }
130 130
131 InterfaceID PPB_Audio_Proxy::GetInterfaceId() const { 131 InterfaceID PPB_Audio_Proxy::GetInterfaceId() const {
132 return INTERFACE_ID_PPB_AUDIO; 132 return INTERFACE_ID_PPB_AUDIO;
133 } 133 }
134 134
135 void PPB_Audio_Proxy::OnMessageReceived(const IPC::Message& msg) { 135 bool PPB_Audio_Proxy::OnMessageReceived(const IPC::Message& msg) {
136 bool handled = true;
136 IPC_BEGIN_MESSAGE_MAP(PPB_Audio_Proxy, msg) 137 IPC_BEGIN_MESSAGE_MAP(PPB_Audio_Proxy, msg)
137 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudio_Create, OnMsgCreate) 138 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudio_Create, OnMsgCreate)
138 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudio_StartOrStop, 139 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudio_StartOrStop,
139 OnMsgStartOrStop) 140 OnMsgStartOrStop)
140
141 IPC_MESSAGE_HANDLER(PpapiMsg_PPBAudio_NotifyAudioStreamCreated, 141 IPC_MESSAGE_HANDLER(PpapiMsg_PPBAudio_NotifyAudioStreamCreated,
142 OnMsgNotifyAudioStreamCreated) 142 OnMsgNotifyAudioStreamCreated)
143 IPC_MESSAGE_UNHANDLED(handled = false)
143 IPC_END_MESSAGE_MAP() 144 IPC_END_MESSAGE_MAP()
145 return handled;
144 } 146 }
145 147
146 void PPB_Audio_Proxy::OnMsgCreate(PP_Instance instance_id, 148 void PPB_Audio_Proxy::OnMsgCreate(PP_Instance instance_id,
147 PP_Resource config_id, 149 PP_Resource config_id,
148 PP_Resource* result) { 150 PP_Resource* result) {
149 const PPB_AudioTrusted_Dev* audio_trusted = 151 const PPB_AudioTrusted_Dev* audio_trusted =
150 reinterpret_cast<const PPB_AudioTrusted_Dev*>( 152 reinterpret_cast<const PPB_AudioTrusted_Dev*>(
151 dispatcher()->GetLocalInterface(PPB_AUDIO_TRUSTED_DEV_INTERFACE)); 153 dispatcher()->GetLocalInterface(PPB_AUDIO_TRUSTED_DEV_INTERFACE));
152 if (!audio_trusted) { 154 if (!audio_trusted) {
153 *result = 0; 155 *result = 0;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // close the source handle. 278 // close the source handle.
277 if (!shared_memory.GiveToProcess(dispatcher()->remote_process_handle(), 279 if (!shared_memory.GiveToProcess(dispatcher()->remote_process_handle(),
278 foreign_shared_memory_handle)) 280 foreign_shared_memory_handle))
279 return PP_ERROR_FAILED; 281 return PP_ERROR_FAILED;
280 282
281 return PP_OK; 283 return PP_OK;
282 } 284 }
283 285
284 } // namespace proxy 286 } // namespace proxy
285 } // namespace pp 287 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_audio_proxy.h ('k') | ppapi/proxy/ppb_buffer_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698