| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_input_proxy.h" | 5 #include "ppapi/proxy/ppb_audio_input_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/dev/ppb_audio_input_dev.h" | 9 #include "ppapi/c/dev/ppb_audio_input_dev.h" |
| 10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // we just dish it out as requested by the plugin. | 58 // we just dish it out as requested by the plugin. |
| 59 PP_Resource config_; | 59 PP_Resource config_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(AudioInput); | 61 DISALLOW_COPY_AND_ASSIGN(AudioInput); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 AudioInput::AudioInput(const HostResource& audio_input_id, | 64 AudioInput::AudioInput(const HostResource& audio_input_id, |
| 65 PP_Resource config_id, | 65 PP_Resource config_id, |
| 66 PPB_AudioInput_Callback callback, | 66 PPB_AudioInput_Callback callback, |
| 67 void* user_data) | 67 void* user_data) |
| 68 : Resource(audio_input_id), | 68 : Resource(OBJECT_IS_PROXY, audio_input_id), |
| 69 config_(config_id) { | 69 config_(config_id) { |
| 70 SetCallback(callback, user_data); | 70 SetCallback(callback, user_data); |
| 71 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_); | 71 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_); |
| 72 } | 72 } |
| 73 | 73 |
| 74 AudioInput::~AudioInput() { | 74 AudioInput::~AudioInput() { |
| 75 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(config_); | 75 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(config_); |
| 76 } | 76 } |
| 77 | 77 |
| 78 PPB_AudioInput_API* AudioInput::AsPPB_AudioInput_API() { | 78 PPB_AudioInput_API* AudioInput::AsPPB_AudioInput_API() { |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 *foreign_shared_memory_handle = dispatcher()->ShareHandleWithRemote( | 314 *foreign_shared_memory_handle = dispatcher()->ShareHandleWithRemote( |
| 315 IntToPlatformFile(shared_memory_handle), false); | 315 IntToPlatformFile(shared_memory_handle), false); |
| 316 if (*foreign_shared_memory_handle == IPC::InvalidPlatformFileForTransit()) | 316 if (*foreign_shared_memory_handle == IPC::InvalidPlatformFileForTransit()) |
| 317 return PP_ERROR_FAILED; | 317 return PP_ERROR_FAILED; |
| 318 | 318 |
| 319 return PP_OK; | 319 return PP_OK; |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace proxy | 322 } // namespace proxy |
| 323 } // namespace ppapi | 323 } // namespace ppapi |
| OLD | NEW |