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

Unified Diff: ppapi/proxy/ppb_audio_proxy.cc

Issue 10412014: Get PPB_Audio interface building as untrusted code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/ppapi_proxy_untrusted.gypi ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_audio_proxy.cc
===================================================================
--- ppapi/proxy/ppb_audio_proxy.cc (revision 137754)
+++ ppapi/proxy/ppb_audio_proxy.cc (working copy)
@@ -157,9 +157,12 @@
bool PPB_Audio_Proxy::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PPB_Audio_Proxy, msg)
+// Don't build host side into NaCl IRT.
+#if !defined(OS_NACL)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudio_Create, OnMsgCreate)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudio_StartOrStop,
OnMsgStartOrStop)
+#endif
IPC_MESSAGE_HANDLER(PpapiMsg_PPBAudio_NotifyAudioStreamCreated,
OnMsgNotifyAudioStreamCreated)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -167,6 +170,7 @@
return handled;
}
+#if !defined(OS_NACL)
void PPB_Audio_Proxy::OnMsgCreate(PP_Instance instance_id,
int32_t sample_rate,
uint32_t sample_frame_count,
@@ -228,28 +232,6 @@
enter.object()->StopPlayback();
}
-// Processed in the plugin (message from host).
-void PPB_Audio_Proxy::OnMsgNotifyAudioStreamCreated(
- const HostResource& audio_id,
- int32_t result_code,
- IPC::PlatformFileForTransit socket_handle,
- base::SharedMemoryHandle handle,
- uint32_t length) {
- EnterPluginFromHostResource<PPB_Audio_API> enter(audio_id);
- if (enter.failed() || result_code != PP_OK) {
- // The caller may still have given us these handles in the failure case.
- // The easiest way to clean these up is to just put them in the objects
- // and then close them. This failure case is not performance critical.
- base::SyncSocket temp_socket(
- IPC::PlatformFileForTransitToPlatformFile(socket_handle));
- base::SharedMemory temp_mem(handle, false);
- } else {
- static_cast<Audio*>(enter.object())->SetStreamInfo(
- enter.resource()->pp_instance(), handle, length,
- IPC::PlatformFileForTransitToPlatformFile(socket_handle));
- }
-}
-
void PPB_Audio_Proxy::AudioChannelConnected(
int32_t result,
const HostResource& resource) {
@@ -312,6 +294,29 @@
return PP_OK;
}
+#endif // !defined(OS_NACL)
+// Processed in the plugin (message from host).
+void PPB_Audio_Proxy::OnMsgNotifyAudioStreamCreated(
+ const HostResource& audio_id,
+ int32_t result_code,
+ IPC::PlatformFileForTransit socket_handle,
+ base::SharedMemoryHandle handle,
+ uint32_t length) {
+ EnterPluginFromHostResource<PPB_Audio_API> enter(audio_id);
+ if (enter.failed() || result_code != PP_OK) {
+ // The caller may still have given us these handles in the failure case.
+ // The easiest way to clean these up is to just put them in the objects
+ // and then close them. This failure case is not performance critical.
+ base::SyncSocket temp_socket(
+ IPC::PlatformFileForTransitToPlatformFile(socket_handle));
+ base::SharedMemory temp_mem(handle, false);
+ } else {
+ static_cast<Audio*>(enter.object())->SetStreamInfo(
+ enter.resource()->pp_instance(), handle, length,
+ IPC::PlatformFileForTransitToPlatformFile(socket_handle));
+ }
+}
+
} // namespace proxy
} // namespace ppapi
« no previous file with comments | « ppapi/ppapi_proxy_untrusted.gypi ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698