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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioBasicInspectorNode.cpp

Issue 2809023002: Replace ASSERT/ASSERT_NOT_REACHED with DCHECK/NOTREACHED in modules/webaudio (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | third_party/WebKit/Source/modules/webaudio/AudioBasicProcessorHandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Intel Corporation. All rights reserved. 2 * Copyright (C) 2012, Intel Corporation. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 BaseAudioContext::AutoLocker locker(context()); 71 BaseAudioContext::AutoLocker locker(context());
72 72
73 AudioNode::disconnect(output_index, exception_state); 73 AudioNode::disconnect(output_index, exception_state);
74 static_cast<AudioBasicInspectorHandler&>(Handler()).UpdatePullStatus(); 74 static_cast<AudioBasicInspectorHandler&>(Handler()).UpdatePullStatus();
75 } 75 }
76 76
77 void AudioBasicInspectorHandler::CheckNumberOfChannelsForInput( 77 void AudioBasicInspectorHandler::CheckNumberOfChannelsForInput(
78 AudioNodeInput* input) { 78 AudioNodeInput* input) {
79 DCHECK(Context()->IsAudioThread()); 79 DCHECK(Context()->IsAudioThread());
80 ASSERT(Context()->IsGraphOwner()); 80 DCHECK(Context()->IsGraphOwner());
81 81
82 DCHECK_EQ(input, &this->Input(0)); 82 DCHECK_EQ(input, &this->Input(0));
83 if (input != &this->Input(0)) 83 if (input != &this->Input(0))
84 return; 84 return;
85 85
86 unsigned number_of_channels = input->NumberOfChannels(); 86 unsigned number_of_channels = input->NumberOfChannels();
87 87
88 if (number_of_channels != Output(0).NumberOfChannels()) { 88 if (number_of_channels != Output(0).NumberOfChannels()) {
89 // This will propagate the channel count to any nodes connected further 89 // This will propagate the channel count to any nodes connected further
90 // downstream in the graph. 90 // downstream in the graph.
91 Output(0).SetNumberOfChannels(number_of_channels); 91 Output(0).SetNumberOfChannels(number_of_channels);
92 } 92 }
93 93
94 AudioHandler::CheckNumberOfChannelsForInput(input); 94 AudioHandler::CheckNumberOfChannelsForInput(input);
95 95
96 UpdatePullStatus(); 96 UpdatePullStatus();
97 } 97 }
98 98
99 void AudioBasicInspectorHandler::UpdatePullStatus() { 99 void AudioBasicInspectorHandler::UpdatePullStatus() {
100 ASSERT(Context()->IsGraphOwner()); 100 DCHECK(Context()->IsGraphOwner());
101 101
102 if (Output(0).IsConnected()) { 102 if (Output(0).IsConnected()) {
103 // When an AudioBasicInspectorNode is connected to a downstream node, it 103 // When an AudioBasicInspectorNode is connected to a downstream node, it
104 // will get pulled by the downstream node, thus remove it from the context's 104 // will get pulled by the downstream node, thus remove it from the context's
105 // automatic pull list. 105 // automatic pull list.
106 if (need_automatic_pull_) { 106 if (need_automatic_pull_) {
107 Context()->GetDeferredTaskHandler().RemoveAutomaticPullNode(this); 107 Context()->GetDeferredTaskHandler().RemoveAutomaticPullNode(this);
108 need_automatic_pull_ = false; 108 need_automatic_pull_ = false;
109 } 109 }
110 } else { 110 } else {
(...skipping 11 matching lines...) Expand all
122 // pull list. AnalyserNode's need to be pulled even with no 122 // pull list. AnalyserNode's need to be pulled even with no
123 // inputs so that the internal state gets updated to hold the 123 // inputs so that the internal state gets updated to hold the
124 // right time and FFT data. 124 // right time and FFT data.
125 Context()->GetDeferredTaskHandler().RemoveAutomaticPullNode(this); 125 Context()->GetDeferredTaskHandler().RemoveAutomaticPullNode(this);
126 need_automatic_pull_ = false; 126 need_automatic_pull_ = false;
127 } 127 }
128 } 128 }
129 } 129 }
130 130
131 } // namespace blink 131 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/AudioBasicProcessorHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698