Use string_view to pass track ids to constructors
Bug: webrtc:13579
Change-Id: Icbd08d5fba9d150295675d730b7261d23992488c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264441
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37035}
diff --git a/api/media_stream_track.h b/api/media_stream_track.h
index 738f034..316dd78 100644
--- a/api/media_stream_track.h
+++ b/api/media_stream_track.h
@@ -13,6 +13,7 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "api/media_stream_interface.h"
#include "api/notifier.h"
@@ -41,7 +42,7 @@
void set_ended() { set_state(MediaStreamTrackInterface::TrackState::kEnded); }
protected:
- explicit MediaStreamTrack(const std::string& id)
+ explicit MediaStreamTrack(absl::string_view id)
: enabled_(true), id_(id), state_(MediaStreamTrackInterface::kLive) {}
bool set_state(MediaStreamTrackInterface::TrackState new_state) {