Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: content/renderer/pepper/pepper_platform_audio_output.cc

Issue 2852803002: Remove base::SharedMemory::ShareToProcess. (Closed)
Patch Set: Compile error. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/pepper_platform_audio_output.h" 5 #include "content/renderer/pepper/pepper_platform_audio_output.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 media::OutputDeviceStatus device_status, 85 media::OutputDeviceStatus device_status,
86 const media::AudioParameters& output_params, 86 const media::AudioParameters& output_params,
87 const std::string& matched_device_id) { 87 const std::string& matched_device_id) {
88 NOTREACHED(); 88 NOTREACHED();
89 } 89 }
90 90
91 void PepperPlatformAudioOutput::OnStreamCreated( 91 void PepperPlatformAudioOutput::OnStreamCreated(
92 base::SharedMemoryHandle handle, 92 base::SharedMemoryHandle handle,
93 base::SyncSocket::Handle socket_handle, 93 base::SyncSocket::Handle socket_handle,
94 int length) { 94 int length) {
95 DCHECK(handle.IsValid());
95 #if defined(OS_WIN) 96 #if defined(OS_WIN)
96 DCHECK(handle.IsValid());
97 DCHECK(socket_handle); 97 DCHECK(socket_handle);
98 #else 98 #else
99 DCHECK(base::SharedMemory::IsHandleValid(handle));
100 DCHECK_NE(-1, socket_handle); 99 DCHECK_NE(-1, socket_handle);
101 #endif 100 #endif
102 DCHECK(length); 101 DCHECK(length);
103 102
104 if (base::ThreadTaskRunnerHandle::Get().get() == main_task_runner_.get()) { 103 if (base::ThreadTaskRunnerHandle::Get().get() == main_task_runner_.get()) {
105 // Must dereference the client only on the main thread. Shutdown may have 104 // Must dereference the client only on the main thread. Shutdown may have
106 // occurred while the request was in-flight, so we need to NULL check. 105 // occurred while the request was in-flight, so we need to NULL check.
107 if (client_) 106 if (client_)
108 client_->StreamCreated(handle, length, socket_handle); 107 client_->StreamCreated(handle, length, socket_handle);
109 } else { 108 } else {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 return; 184 return;
186 185
187 ipc_->CloseStream(); 186 ipc_->CloseStream();
188 ipc_.reset(); 187 ipc_.reset();
189 188
190 Release(); // Release for the delegate, balances out the reference taken in 189 Release(); // Release for the delegate, balances out the reference taken in
191 // PepperPlatformAudioOutput::Create. 190 // PepperPlatformAudioOutput::Create.
192 } 191 }
193 192
194 } // namespace content 193 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698