| 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_PPB_AUDIO_INPUT_PROXY_H_ |   5 #ifndef PPAPI_PROXY_PPB_AUDIO_INPUT_PROXY_H_ | 
|   6 #define PPAPI_PROXY_PPB_AUDIO_INPUT_PROXY_H_ |   6 #define PPAPI_PROXY_PPB_AUDIO_INPUT_PROXY_H_ | 
|   7  |   7  | 
|   8 #include <string> |   8 #include <string> | 
|   9 #include <utility> |   9 #include <utility> | 
|  10 #include <vector> |  10 #include <vector> | 
|  11  |  11  | 
|  12 #include "base/basictypes.h" |  12 #include "base/basictypes.h" | 
|  13 #include "base/shared_memory.h" |  13 #include "base/shared_memory.h" | 
|  14 #include "base/sync_socket.h" |  14 #include "base/sync_socket.h" | 
|  15 #include "ipc/ipc_platform_file.h" |  15 #include "ipc/ipc_platform_file.h" | 
|  16 #include "ppapi/c/dev/ppb_audio_input_dev.h" |  16 #include "ppapi/c/dev/ppb_audio_input_dev.h" | 
|  17 #include "ppapi/c/ppb_audio_config.h" |  17 #include "ppapi/c/ppb_audio_config.h" | 
|  18 #include "ppapi/proxy/interface_proxy.h" |  18 #include "ppapi/proxy/interface_proxy.h" | 
|  19 #include "ppapi/proxy/proxy_completion_callback_factory.h" |  19 #include "ppapi/proxy/proxy_completion_callback_factory.h" | 
 |  20 #include "ppapi/proxy/serialized_structs.h" | 
|  20 #include "ppapi/utility/completion_callback_factory.h" |  21 #include "ppapi/utility/completion_callback_factory.h" | 
|  21  |  22  | 
|  22 namespace ppapi { |  23 namespace ppapi { | 
|  23  |  24  | 
|  24 class HostResource; |  25 class HostResource; | 
|  25 struct DeviceRefData; |  26 struct DeviceRefData; | 
|  26  |  27  | 
|  27 namespace proxy { |  28 namespace proxy { | 
|  28  |  29  | 
|  29 class PPB_AudioInput_Proxy : public InterfaceProxy { |  30 class PPB_AudioInput_Proxy : public InterfaceProxy { | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
|  56   void OnMsgStartOrStop(const ppapi::HostResource& audio_input, bool capture); |  57   void OnMsgStartOrStop(const ppapi::HostResource& audio_input, bool capture); | 
|  57   void OnMsgClose(const ppapi::HostResource& audio_input); |  58   void OnMsgClose(const ppapi::HostResource& audio_input); | 
|  58  |  59  | 
|  59   // Renderer->plugin message handlers. |  60   // Renderer->plugin message handlers. | 
|  60   void OnMsgEnumerateDevicesACK( |  61   void OnMsgEnumerateDevicesACK( | 
|  61       const ppapi::HostResource& audio_input, |  62       const ppapi::HostResource& audio_input, | 
|  62       int32_t result, |  63       int32_t result, | 
|  63       const std::vector<ppapi::DeviceRefData>& devices); |  64       const std::vector<ppapi::DeviceRefData>& devices); | 
|  64   void OnMsgOpenACK(const ppapi::HostResource& audio_input, |  65   void OnMsgOpenACK(const ppapi::HostResource& audio_input, | 
|  65                     int32_t result, |  66                     int32_t result, | 
|  66                     IPC::PlatformFileForTransit socket_handle, |  67                     const ppapi::proxy::SerializedHandle& socket_handle, | 
|  67                     base::SharedMemoryHandle handle, |  68                     const ppapi::proxy::SerializedHandle& handle); | 
|  68                     uint32_t length); |  | 
|  69  |  69  | 
|  70   void EnumerateDevicesACKInHost(int32_t result, |  70   void EnumerateDevicesACKInHost(int32_t result, | 
|  71                                  const ppapi::HostResource& audio_input); |  71                                  const ppapi::HostResource& audio_input); | 
|  72   void OpenACKInHost(int32_t result, const ppapi::HostResource& audio_input); |  72   void OpenACKInHost(int32_t result, const ppapi::HostResource& audio_input); | 
|  73  |  73  | 
|  74   // In the renderer, this is called in response to an OpenACK message. |  74   // In the renderer, this is called in response to an OpenACK message. | 
|  75   // It will retrieve the shared memory and socket handles and place them into |  75   // It will retrieve the shared memory and socket handles and place them into | 
|  76   // the given out params. The return value is a PPAPI error code. |  76   // the given out params. The return value is a PPAPI error code. | 
|  77   // |  77   // | 
|  78   // The input arguments should be initialized to 0 or -1, depending on the |  78   // The input arguments should be initialized to 0 or -1, depending on the | 
|  79   // platform's default invalid handle values. On error, some of these |  79   // platform's default invalid handle values. On error, some of these | 
|  80   // arguments may be written to, and others may be untouched, depending on |  80   // arguments may be written to, and others may be untouched, depending on | 
|  81   // where the error occurred. |  81   // where the error occurred. | 
|  82   int32_t GetAudioInputConnectedHandles( |  82   int32_t GetAudioInputConnectedHandles( | 
|  83       const ppapi::HostResource& resource, |  83       const ppapi::HostResource& resource, | 
|  84       IPC::PlatformFileForTransit* foreign_socket_handle, |  84       IPC::PlatformFileForTransit* foreign_socket_handle, | 
|  85       base::SharedMemoryHandle* foreign_shared_memory_handle, |  85       base::SharedMemoryHandle* foreign_shared_memory_handle, | 
|  86       uint32_t* shared_memory_length); |  86       uint32_t* shared_memory_length); | 
|  87  |  87  | 
|  88   ProxyCompletionCallbackFactory<PPB_AudioInput_Proxy> callback_factory_; |  88   ProxyCompletionCallbackFactory<PPB_AudioInput_Proxy> callback_factory_; | 
|  89  |  89  | 
|  90   DISALLOW_COPY_AND_ASSIGN(PPB_AudioInput_Proxy); |  90   DISALLOW_COPY_AND_ASSIGN(PPB_AudioInput_Proxy); | 
|  91 }; |  91 }; | 
|  92  |  92  | 
|  93 }  // namespace proxy |  93 }  // namespace proxy | 
|  94 }  // namespace ppapi |  94 }  // namespace ppapi | 
|  95  |  95  | 
|  96 #endif  // PPAPI_PROXY_PPB_AUDIO_INPUT_PROXY_H_ |  96 #endif  // PPAPI_PROXY_PPB_AUDIO_INPUT_PROXY_H_ | 
| OLD | NEW |