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

Side by Side Diff: content/renderer/media/aec_dump_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
« no previous file with comments | « AUTHORS ('k') | content/renderer/media/audio_input_message_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/aec_dump_message_filter.h" 5 #include "content/renderer/media/aec_dump_message_filter.h"
6 6
7 #include "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "content/common/media/aec_dump_messages.h" 8 #include "content/common/media/aec_dump_messages.h"
9 #include "content/renderer/media/webrtc_logging.h" 9 #include "content/renderer/media/webrtc_logging.h"
10 #include "ipc/ipc_logging.h" 10 #include "ipc/ipc_logging.h"
11 #include "ipc/ipc_sender.h" 11 #include "ipc/ipc_sender.h"
12 12
13 namespace { 13 namespace {
14 const int kInvalidDelegateId = -1; 14 const int kInvalidDelegateId = -1;
15 } 15 }
16 16
17 namespace content { 17 namespace content {
18 18
19 AecDumpMessageFilter* AecDumpMessageFilter::g_filter = NULL; 19 AecDumpMessageFilter* AecDumpMessageFilter::g_filter = NULL;
20 20
21 AecDumpMessageFilter::AecDumpMessageFilter( 21 AecDumpMessageFilter::AecDumpMessageFilter(
22 const scoped_refptr<base::MessageLoopProxy>& io_message_loop, 22 const scoped_refptr<base::MessageLoopProxy>& io_message_loop,
23 const scoped_refptr<base::MessageLoopProxy>& main_message_loop) 23 const scoped_refptr<base::MessageLoopProxy>& main_message_loop)
24 : sender_(NULL), 24 : sender_(NULL),
25 delegate_id_counter_(0), 25 delegate_id_counter_(0),
26 io_message_loop_(io_message_loop), 26 io_message_loop_(io_message_loop),
27 main_message_loop_(main_message_loop) { 27 main_message_loop_(main_message_loop) {
28 DCHECK(!g_filter);
29 g_filter = this; 28 g_filter = this;
30 } 29 }
31 30
32 AecDumpMessageFilter::~AecDumpMessageFilter() { 31 AecDumpMessageFilter::~AecDumpMessageFilter() {
33 DCHECK_EQ(g_filter, this); 32 DCHECK_EQ(g_filter, this);
jrummell 2015/03/02 23:54:14 If the DCHECK in the constructor needs to be remov
34 g_filter = NULL; 33 g_filter = NULL;
35 } 34 }
36 35
37 // static 36 // static
38 scoped_refptr<AecDumpMessageFilter> AecDumpMessageFilter::Get() { 37 scoped_refptr<AecDumpMessageFilter> AecDumpMessageFilter::Get() {
39 return g_filter; 38 return g_filter;
40 } 39 }
41 40
42 void AecDumpMessageFilter::AddDelegate( 41 void AecDumpMessageFilter::AddDelegate(
43 AecDumpMessageFilter::AecDumpDelegate* delegate) { 42 AecDumpMessageFilter::AecDumpDelegate* delegate) {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 DCHECK(main_message_loop_->BelongsToCurrentThread()); 181 DCHECK(main_message_loop_->BelongsToCurrentThread());
183 for (DelegateMap::iterator it = delegates_.begin(); 182 for (DelegateMap::iterator it = delegates_.begin();
184 it != delegates_.end(); ++it) { 183 it != delegates_.end(); ++it) {
185 if (it->second == delegate) 184 if (it->second == delegate)
186 return it->first; 185 return it->first;
187 } 186 }
188 return kInvalidDelegateId; 187 return kInvalidDelegateId;
189 } 188 }
190 189
191 } // namespace content 190 } // namespace content
OLDNEW
« no previous file with comments | « AUTHORS ('k') | content/renderer/media/audio_input_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698