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_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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 }; |
62 | 62 |
63 Audio::Audio(const HostResource& audio_id, | 63 Audio::Audio(const HostResource& audio_id, |
64 PP_Resource config_id, | 64 PP_Resource config_id, |
65 PPB_Audio_Callback callback, | 65 PPB_Audio_Callback callback, |
66 void* user_data) | 66 void* user_data) |
67 : Resource(audio_id), | 67 : Resource(OBJECT_IS_PROXY, audio_id), |
68 config_(config_id) { | 68 config_(config_id) { |
69 SetCallback(callback, user_data); | 69 SetCallback(callback, user_data); |
70 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_); | 70 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_); |
71 } | 71 } |
72 | 72 |
73 Audio::~Audio() { | 73 Audio::~Audio() { |
74 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(config_); | 74 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(config_); |
75 } | 75 } |
76 | 76 |
77 PPB_Audio_API* Audio::AsPPB_Audio_API() { | 77 PPB_Audio_API* Audio::AsPPB_Audio_API() { |
(...skipping 231 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 |