forked from JumpingYang001/webrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable clang::find_bad_constructs for sdk/android (part 1/2).
This CL removes //build/config/clang:find_bad_constructs from the suppressed_configs list, which means that clang:find_bad_constructs is now enabled on these translation units. Bug: webrtc:9251, webrtc:163, webrtc:9544 Change-Id: I7c211c4ac6b2e095e4c6594fce09fdb487bb1d9e Reviewed-on: https://webrtc-review.googlesource.com/89600 Reviewed-by: Steve Anton <[email protected]> Reviewed-by: Sami Kalliomäki <[email protected]> Commit-Queue: Mirko Bonadei <[email protected]> Cr-Commit-Position: refs/heads/master@{#24056}
- Loading branch information
1 parent
97ddbd7
commit 2ffed6d
Showing
23 changed files
with
176 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright 2018 The WebRTC project authors. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by a BSD-style license | ||
* that can be found in the LICENSE file in the root of the source | ||
* tree. An additional intellectual property rights grant can be found | ||
* in the file PATENTS. All contributing project authors may | ||
* be found in the AUTHORS file in the root of the source tree. | ||
*/ | ||
|
||
#include "api/jsepicecandidate.h" | ||
|
||
namespace webrtc { | ||
|
||
std::string JsepIceCandidate::sdp_mid() const { | ||
return sdp_mid_; | ||
} | ||
|
||
int JsepIceCandidate::sdp_mline_index() const { | ||
return sdp_mline_index_; | ||
} | ||
|
||
const cricket::Candidate& JsepIceCandidate::candidate() const { | ||
return candidate_; | ||
} | ||
|
||
std::string JsepIceCandidate::server_url() const { | ||
return candidate_.url(); | ||
} | ||
|
||
JsepCandidateCollection::JsepCandidateCollection() = default; | ||
|
||
JsepCandidateCollection::JsepCandidateCollection(JsepCandidateCollection&& o) | ||
: candidates_(std::move(o.candidates_)) {} | ||
|
||
size_t JsepCandidateCollection::count() const { | ||
return candidates_.size(); | ||
} | ||
|
||
void JsepCandidateCollection::add(JsepIceCandidate* candidate) { | ||
candidates_.push_back(candidate); | ||
} | ||
|
||
const IceCandidateInterface* JsepCandidateCollection::at(size_t index) const { | ||
return candidates_[index]; | ||
} | ||
|
||
JsepCandidateCollection::~JsepCandidateCollection() { | ||
for (std::vector<JsepIceCandidate*>::iterator it = candidates_.begin(); | ||
it != candidates_.end(); ++it) { | ||
delete *it; | ||
} | ||
} | ||
|
||
bool JsepCandidateCollection::HasCandidate( | ||
const IceCandidateInterface* candidate) const { | ||
bool ret = false; | ||
for (std::vector<JsepIceCandidate*>::const_iterator it = candidates_.begin(); | ||
it != candidates_.end(); ++it) { | ||
if ((*it)->sdp_mid() == candidate->sdp_mid() && | ||
(*it)->sdp_mline_index() == candidate->sdp_mline_index() && | ||
(*it)->candidate().IsEquivalent(candidate->candidate())) { | ||
ret = true; | ||
break; | ||
} | ||
} | ||
return ret; | ||
} | ||
|
||
size_t JsepCandidateCollection::remove(const cricket::Candidate& candidate) { | ||
auto iter = std::find_if(candidates_.begin(), candidates_.end(), | ||
[candidate](JsepIceCandidate* c) { | ||
return candidate.MatchesForRemoval(c->candidate()); | ||
}); | ||
if (iter != candidates_.end()) { | ||
delete *iter; | ||
candidates_.erase(iter); | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
|
||
} // namespace webrtc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.