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

Side by Side Diff: content/renderer/media/audio_message_filter.cc

Issue 969553002: Fix crash caused by DCHECK global pointer for --single-process model Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/media/audio_message_filter.h" 5 #include "content/renderer/media/audio_message_filter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "content/common/media/audio_messages.h" 10 #include "content/common/media/audio_messages.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 int stream_id_; 42 int stream_id_;
43 }; 43 };
44 44
45 AudioMessageFilter* AudioMessageFilter::g_filter = NULL; 45 AudioMessageFilter* AudioMessageFilter::g_filter = NULL;
46 46
47 AudioMessageFilter::AudioMessageFilter( 47 AudioMessageFilter::AudioMessageFilter(
48 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) 48 const scoped_refptr<base::MessageLoopProxy>& io_message_loop)
49 : sender_(NULL), 49 : sender_(NULL),
50 audio_hardware_config_(NULL), 50 audio_hardware_config_(NULL),
51 io_message_loop_(io_message_loop) { 51 io_message_loop_(io_message_loop) {
52 DCHECK(!g_filter);
53 g_filter = this; 52 g_filter = this;
54 } 53 }
55 54
56 AudioMessageFilter::~AudioMessageFilter() { 55 AudioMessageFilter::~AudioMessageFilter() {
57 DCHECK_EQ(g_filter, this); 56 DCHECK_EQ(g_filter, this);
58 g_filter = NULL; 57 g_filter = NULL;
59 } 58 }
60 59
61 // static 60 // static
62 AudioMessageFilter* AudioMessageFilter::Get() { 61 AudioMessageFilter* AudioMessageFilter::Get() {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 audio_hardware_config_->UpdateOutputConfig(output_params); 235 audio_hardware_config_->UpdateOutputConfig(output_params);
237 } 236 }
238 237
239 void AudioMessageFilter::SetAudioHardwareConfig( 238 void AudioMessageFilter::SetAudioHardwareConfig(
240 media::AudioHardwareConfig* config) { 239 media::AudioHardwareConfig* config) {
241 base::AutoLock auto_lock(lock_); 240 base::AutoLock auto_lock(lock_);
242 audio_hardware_config_ = config; 241 audio_hardware_config_ = config;
243 } 242 }
244 243
245 } // namespace content 244 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698