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

Side by Side Diff: content/renderer/media/webrtc/peer_connection_dependency_factory.cc

Issue 654403002: Convert ARRAYSIZE_UNSAFE -> arraysize in content/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 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/webrtc/peer_connection_dependency_factory.h" 5 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 }; 68 };
69 69
70 // If any platform effects are available, check them against the constraints. 70 // If any platform effects are available, check them against the constraints.
71 // Disable effects to match false constraints, but if a constraint is true, set 71 // Disable effects to match false constraints, but if a constraint is true, set
72 // the constraint to false to later disable the software effect. 72 // the constraint to false to later disable the software effect.
73 // 73 //
74 // This function may modify both |constraints| and |effects|. 74 // This function may modify both |constraints| and |effects|.
75 void HarmonizeConstraintsAndEffects(RTCMediaConstraints* constraints, 75 void HarmonizeConstraintsAndEffects(RTCMediaConstraints* constraints,
76 int* effects) { 76 int* effects) {
77 if (*effects != media::AudioParameters::NO_EFFECTS) { 77 if (*effects != media::AudioParameters::NO_EFFECTS) {
78 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kConstraintEffectMap); ++i) { 78 for (size_t i = 0; i < arraysize(kConstraintEffectMap); ++i) {
79 bool value; 79 bool value;
80 size_t is_mandatory = 0; 80 size_t is_mandatory = 0;
81 if (!webrtc::FindConstraint(constraints, 81 if (!webrtc::FindConstraint(constraints,
82 kConstraintEffectMap[i].constraint, 82 kConstraintEffectMap[i].constraint,
83 &value, 83 &value,
84 &is_mandatory) || !value) { 84 &is_mandatory) || !value) {
85 // If the constraint is false, or does not exist, disable the platform 85 // If the constraint is false, or does not exist, disable the platform
86 // effect. 86 // effect.
87 *effects &= ~kConstraintEffectMap[i].effect; 87 *effects &= ~kConstraintEffectMap[i].effect;
88 DVLOG(1) << "Disabling platform effect: " 88 DVLOG(1) << "Disabling platform effect: "
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 } 649 }
650 650
651 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { 651 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() {
652 if (audio_device_.get()) 652 if (audio_device_.get())
653 return; 653 return;
654 654
655 audio_device_ = new WebRtcAudioDeviceImpl(); 655 audio_device_ = new WebRtcAudioDeviceImpl();
656 } 656 }
657 657
658 } // namespace content 658 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698