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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 void AudioNodeInput::connect(AudioNodeOutput& output) { 46 void AudioNodeInput::connect(AudioNodeOutput& output) {
47 ASSERT(deferredTaskHandler().isGraphOwner()); 47 ASSERT(deferredTaskHandler().isGraphOwner());
48 48
49 // Check if we're already connected to this output. 49 // Check if we're already connected to this output.
50 if (m_outputs.contains(&output)) 50 if (m_outputs.contains(&output))
51 return; 51 return;
52 52
53 output.addInput(*this); 53 output.addInput(*this);
54 m_outputs.add(&output); 54 m_outputs.insert(&output);
55 changedOutputs(); 55 changedOutputs();
56 } 56 }
57 57
58 void AudioNodeInput::disconnect(AudioNodeOutput& output) { 58 void AudioNodeInput::disconnect(AudioNodeOutput& output) {
59 ASSERT(deferredTaskHandler().isGraphOwner()); 59 ASSERT(deferredTaskHandler().isGraphOwner());
60 60
61 // First try to disconnect from "active" connections. 61 // First try to disconnect from "active" connections.
62 if (m_outputs.contains(&output)) { 62 if (m_outputs.contains(&output)) {
63 m_outputs.remove(&output); 63 m_outputs.remove(&output);
64 changedOutputs(); 64 changedOutputs();
(...skipping 12 matching lines...) Expand all
77 return; 77 return;
78 } 78 }
79 79
80 ASSERT_NOT_REACHED(); 80 ASSERT_NOT_REACHED();
81 } 81 }
82 82
83 void AudioNodeInput::disable(AudioNodeOutput& output) { 83 void AudioNodeInput::disable(AudioNodeOutput& output) {
84 ASSERT(deferredTaskHandler().isGraphOwner()); 84 ASSERT(deferredTaskHandler().isGraphOwner());
85 DCHECK(m_outputs.contains(&output)); 85 DCHECK(m_outputs.contains(&output));
86 86
87 m_disabledOutputs.add(&output); 87 m_disabledOutputs.insert(&output);
88 m_outputs.remove(&output); 88 m_outputs.remove(&output);
89 changedOutputs(); 89 changedOutputs();
90 90
91 // Propagate disabled state to outputs. 91 // Propagate disabled state to outputs.
92 handler().disableOutputsIfNecessary(); 92 handler().disableOutputsIfNecessary();
93 } 93 }
94 94
95 void AudioNodeInput::enable(AudioNodeOutput& output) { 95 void AudioNodeInput::enable(AudioNodeOutput& output) {
96 ASSERT(deferredTaskHandler().isGraphOwner()); 96 ASSERT(deferredTaskHandler().isGraphOwner());
97 97
98 // Move output from disabled list to active list. 98 // Move output from disabled list to active list.
99 m_outputs.add(&output); 99 m_outputs.insert(&output);
100 if (m_disabledOutputs.size() > 0) { 100 if (m_disabledOutputs.size() > 0) {
101 DCHECK(m_disabledOutputs.contains(&output)); 101 DCHECK(m_disabledOutputs.contains(&output));
102 m_disabledOutputs.remove(&output); 102 m_disabledOutputs.remove(&output);
103 } 103 }
104 changedOutputs(); 104 changedOutputs();
105 105
106 // Propagate enabled state to outputs. 106 // Propagate enabled state to outputs.
107 handler().enableOutputsIfNecessary(); 107 handler().enableOutputsIfNecessary();
108 } 108 }
109 109
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 return internalSummingBus; 216 return internalSummingBus;
217 } 217 }
218 218
219 // Handle multiple connections case. 219 // Handle multiple connections case.
220 sumAllConnections(internalSummingBus, framesToProcess); 220 sumAllConnections(internalSummingBus, framesToProcess);
221 221
222 return internalSummingBus; 222 return internalSummingBus;
223 } 223 }
224 224
225 } // namespace blink 225 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698