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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioNode.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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 "with 0 output channels to any " 637 "with 0 output channels to any "
638 "destination node."); 638 "destination node.");
639 return nullptr; 639 return nullptr;
640 } 640 }
641 641
642 destination->handler() 642 destination->handler()
643 .input(inputIndex) 643 .input(inputIndex)
644 .connect(handler().output(outputIndex)); 644 .connect(handler().output(outputIndex));
645 if (!m_connectedNodes[outputIndex]) 645 if (!m_connectedNodes[outputIndex])
646 m_connectedNodes[outputIndex] = new HeapHashSet<Member<AudioNode>>(); 646 m_connectedNodes[outputIndex] = new HeapHashSet<Member<AudioNode>>();
647 m_connectedNodes[outputIndex]->add(destination); 647 m_connectedNodes[outputIndex]->insert(destination);
648 648
649 // Let context know that a connection has been made. 649 // Let context know that a connection has been made.
650 context()->incrementConnectionCount(); 650 context()->incrementConnectionCount();
651 651
652 return destination; 652 return destination;
653 } 653 }
654 654
655 void AudioNode::connect(AudioParam* param, 655 void AudioNode::connect(AudioParam* param,
656 unsigned outputIndex, 656 unsigned outputIndex,
657 ExceptionState& exceptionState) { 657 ExceptionState& exceptionState) {
(...skipping 22 matching lines...) Expand all
680 if (context() != param->context()) { 680 if (context() != param->context()) {
681 exceptionState.throwDOMException(SyntaxError, 681 exceptionState.throwDOMException(SyntaxError,
682 "cannot connect to an AudioParam " 682 "cannot connect to an AudioParam "
683 "belonging to a different audio context."); 683 "belonging to a different audio context.");
684 return; 684 return;
685 } 685 }
686 686
687 param->handler().connect(handler().output(outputIndex)); 687 param->handler().connect(handler().output(outputIndex));
688 if (!m_connectedParams[outputIndex]) 688 if (!m_connectedParams[outputIndex])
689 m_connectedParams[outputIndex] = new HeapHashSet<Member<AudioParam>>(); 689 m_connectedParams[outputIndex] = new HeapHashSet<Member<AudioParam>>();
690 m_connectedParams[outputIndex]->add(param); 690 m_connectedParams[outputIndex]->insert(param);
691 } 691 }
692 692
693 void AudioNode::disconnectAllFromOutput(unsigned outputIndex) { 693 void AudioNode::disconnectAllFromOutput(unsigned outputIndex) {
694 handler().output(outputIndex).disconnectAll(); 694 handler().output(outputIndex).disconnectAll();
695 m_connectedNodes[outputIndex] = nullptr; 695 m_connectedNodes[outputIndex] = nullptr;
696 m_connectedParams[outputIndex] = nullptr; 696 m_connectedParams[outputIndex] = nullptr;
697 } 697 }
698 698
699 bool AudioNode::disconnectFromOutputIfConnected( 699 bool AudioNode::disconnectFromOutputIfConnected(
700 unsigned outputIndex, 700 unsigned outputIndex,
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 } 947 }
948 948
949 void AudioNode::didAddOutput(unsigned numberOfOutputs) { 949 void AudioNode::didAddOutput(unsigned numberOfOutputs) {
950 m_connectedNodes.push_back(nullptr); 950 m_connectedNodes.push_back(nullptr);
951 DCHECK_EQ(numberOfOutputs, m_connectedNodes.size()); 951 DCHECK_EQ(numberOfOutputs, m_connectedNodes.size());
952 m_connectedParams.push_back(nullptr); 952 m_connectedParams.push_back(nullptr);
953 DCHECK_EQ(numberOfOutputs, m_connectedParams.size()); 953 DCHECK_EQ(numberOfOutputs, m_connectedParams.size());
954 } 954 }
955 955
956 } // namespace blink 956 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698