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 "content/renderer/pepper/audio_helper.h" | 5 #include "content/renderer/pepper/audio_helper.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/common/pepper_file_util.h" | 8 #include "content/common/pepper_file_util.h" |
9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 | 21 |
22 int32_t AudioHelper::GetSyncSocketImpl(int* sync_socket) { | 22 int32_t AudioHelper::GetSyncSocketImpl(int* sync_socket) { |
23 if (socket_for_create_callback_) { | 23 if (socket_for_create_callback_) { |
24 *sync_socket = IntegerFromSyncSocketHandle( | 24 *sync_socket = IntegerFromSyncSocketHandle( |
25 socket_for_create_callback_->handle()); | 25 socket_for_create_callback_->handle()); |
26 return PP_OK; | 26 return PP_OK; |
27 } | 27 } |
28 return PP_ERROR_FAILED; | 28 return PP_ERROR_FAILED; |
29 } | 29 } |
30 | 30 |
31 int32_t AudioHelper::GetSharedMemoryImpl(int* shm_handle, uint32_t* shm_size) { | 31 int32_t AudioHelper::GetSharedMemoryImpl(base::SharedMemory* shm, |
32 uint32_t* shm_size) { | |
32 if (shared_memory_for_create_callback_) { | 33 if (shared_memory_for_create_callback_) { |
33 *shm_handle = reinterpret_cast<int>(PlatformFileFromSharedMemoryHandle( | 34 shm = shared_memory_for_create_callback_.get(); |
piman
2015/06/02 00:00:15
That won't do anything. This only modifies a local
erikchen
2015/06/02 00:01:47
Uhh, not sure what portions of my brain failed to
| |
34 shared_memory_for_create_callback_->handle())); | |
35 *shm_size = shared_memory_size_for_create_callback_; | 35 *shm_size = shared_memory_size_for_create_callback_; |
36 return PP_OK; | 36 return PP_OK; |
37 } | 37 } |
38 return PP_ERROR_FAILED; | 38 return PP_ERROR_FAILED; |
39 } | 39 } |
40 | 40 |
41 void AudioHelper::StreamCreated(base::SharedMemoryHandle shared_memory_handle, | 41 void AudioHelper::StreamCreated(base::SharedMemoryHandle shared_memory_handle, |
42 size_t shared_memory_size, | 42 size_t shared_memory_size, |
43 base::SyncSocket::Handle socket_handle) { | 43 base::SyncSocket::Handle socket_handle) { |
44 if (TrackedCallback::IsPending(create_callback_)) { | 44 if (TrackedCallback::IsPending(create_callback_)) { |
(...skipping 19 matching lines...) Expand all Loading... | |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 void AudioHelper::SetCreateCallback( | 67 void AudioHelper::SetCreateCallback( |
68 scoped_refptr<ppapi::TrackedCallback> create_callback) { | 68 scoped_refptr<ppapi::TrackedCallback> create_callback) { |
69 DCHECK(!TrackedCallback::IsPending(create_callback_)); | 69 DCHECK(!TrackedCallback::IsPending(create_callback_)); |
70 create_callback_ = create_callback; | 70 create_callback_ = create_callback; |
71 } | 71 } |
72 | 72 |
73 } // namespace content | 73 } // namespace content |
OLD | NEW |