Use string_view for a few more sdp-related functions
Bug: webrtc:13579
Change-Id: I536bb2b2dbe8e1eb00b7ad4637faa7e08ff849ed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231127
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36836}
diff --git a/pc/webrtc_sdp.h b/pc/webrtc_sdp.h
index 6d6980a..cc6813c 100644
--- a/pc/webrtc_sdp.h
+++ b/pc/webrtc_sdp.h
@@ -22,6 +22,7 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "api/candidate.h"
#include "api/jsep.h"
#include "api/jsep_ice_candidate.h"
@@ -66,7 +67,7 @@
// jdesc - The JsepSessionDescription deserialized from the SDP string.
// error - The detail error information when parsing fails.
// return - true on success, false on failure.
-bool SdpDeserialize(const std::string& message,
+bool SdpDeserialize(absl::string_view message,
JsepSessionDescription* jdesc,
SdpParseError* error);
@@ -77,7 +78,7 @@
// candidates - The JsepIceCandidate from the SDP string.
// error - The detail error information when parsing fails.
// return - true on success, false on failure.
-RTC_EXPORT bool SdpDeserializeCandidate(const std::string& message,
+RTC_EXPORT bool SdpDeserializeCandidate(absl::string_view message,
JsepIceCandidate* candidate,
SdpParseError* error);
@@ -89,8 +90,8 @@
// candidate - The cricket Candidate from the SDP string.
// error - The detail error information when parsing fails.
// return - true on success, false on failure.
-RTC_EXPORT bool SdpDeserializeCandidate(const std::string& transport_name,
- const std::string& message,
+RTC_EXPORT bool SdpDeserializeCandidate(absl::string_view transport_name,
+ absl::string_view message,
cricket::Candidate* candidate,
SdpParseError* error);
@@ -100,7 +101,7 @@
// `error` is not null.
// If `is_raw` is false, `message` is expected to be prefixed with "a=".
// If `is_raw` is true, no prefix is expected in `messaage`.
-RTC_EXPORT bool ParseCandidate(const std::string& message,
+RTC_EXPORT bool ParseCandidate(absl::string_view message,
cricket::Candidate* candidate,
SdpParseError* error,
bool is_raw);