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 #include "ppapi/proxy/ppb_audio_proxy.h" | 5 #include "ppapi/proxy/ppb_audio_proxy.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/threading/simple_thread.h" | 8 #include "base/threading/simple_thread.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/ppb_audio.h" | 10 #include "ppapi/c/ppb_audio.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 virtual ~Audio(); | 41 virtual ~Audio(); |
42 | 42 |
43 // Resource overrides. | 43 // Resource overrides. |
44 virtual PPB_Audio_API* AsPPB_Audio_API(); | 44 virtual PPB_Audio_API* AsPPB_Audio_API(); |
45 | 45 |
46 // PPB_Audio_API implementation. | 46 // PPB_Audio_API implementation. |
47 virtual PP_Resource GetCurrentConfig() OVERRIDE; | 47 virtual PP_Resource GetCurrentConfig() OVERRIDE; |
48 virtual PP_Bool StartPlayback() OVERRIDE; | 48 virtual PP_Bool StartPlayback() OVERRIDE; |
49 virtual PP_Bool StopPlayback() OVERRIDE; | 49 virtual PP_Bool StopPlayback() OVERRIDE; |
50 virtual int32_t OpenTrusted(PP_Resource config_id, | 50 virtual int32_t OpenTrusted(PP_Resource config_id, |
51 PP_CompletionCallback create_callback) OVERRIDE; | 51 ApiCallbackType create_callback) OVERRIDE; |
52 virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE; | 52 virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE; |
53 virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) OVERRIDE; | 53 virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) OVERRIDE; |
54 | 54 |
55 private: | 55 private: |
56 // Owning reference to the current config object. This isn't actually used, | 56 // Owning reference to the current config object. This isn't actually used, |
57 // we just dish it out as requested by the plugin. | 57 // we just dish it out as requested by the plugin. |
58 PP_Resource config_; | 58 PP_Resource config_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(Audio); | 60 DISALLOW_COPY_AND_ASSIGN(Audio); |
61 }; | 61 }; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (!playing()) | 98 if (!playing()) |
99 return PP_TRUE; | 99 return PP_TRUE; |
100 PluginDispatcher::GetForResource(this)->Send( | 100 PluginDispatcher::GetForResource(this)->Send( |
101 new PpapiHostMsg_PPBAudio_StartOrStop( | 101 new PpapiHostMsg_PPBAudio_StartOrStop( |
102 API_ID_PPB_AUDIO, host_resource(), false)); | 102 API_ID_PPB_AUDIO, host_resource(), false)); |
103 SetStopPlaybackState(); | 103 SetStopPlaybackState(); |
104 return PP_TRUE; | 104 return PP_TRUE; |
105 } | 105 } |
106 | 106 |
107 int32_t Audio::OpenTrusted(PP_Resource config_id, | 107 int32_t Audio::OpenTrusted(PP_Resource config_id, |
108 PP_CompletionCallback create_callback) { | 108 ApiCallbackType create_callback) { |
109 return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface. | 109 return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface. |
110 } | 110 } |
111 | 111 |
112 int32_t Audio::GetSyncSocket(int* sync_socket) { | 112 int32_t Audio::GetSyncSocket(int* sync_socket) { |
113 return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface. | 113 return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface. |
114 } | 114 } |
115 | 115 |
116 int32_t Audio::GetSharedMemory(int* shm_handle, uint32_t* shm_size) { | 116 int32_t Audio::GetSharedMemory(int* shm_handle, uint32_t* shm_size) { |
117 return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface. | 117 return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface. |
118 } | 118 } |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 *foreign_shared_memory_handle = dispatcher()->ShareHandleWithRemote( | 309 *foreign_shared_memory_handle = dispatcher()->ShareHandleWithRemote( |
310 IntToPlatformFile(shared_memory_handle), false); | 310 IntToPlatformFile(shared_memory_handle), false); |
311 if (*foreign_shared_memory_handle == IPC::InvalidPlatformFileForTransit()) | 311 if (*foreign_shared_memory_handle == IPC::InvalidPlatformFileForTransit()) |
312 return PP_ERROR_FAILED; | 312 return PP_ERROR_FAILED; |
313 | 313 |
314 return PP_OK; | 314 return PP_OK; |
315 } | 315 } |
316 | 316 |
317 } // namespace proxy | 317 } // namespace proxy |
318 } // namespace ppapi | 318 } // namespace ppapi |
OLD | NEW |