Switch from pointer to ID for OnSctpDataChannelStateChanged

* The pointer isn't needed for this notification. Arguably using
  the internal id is more consistent with the stats code.
* Using the int makes it safer down the line to post the operation
  from the network thread to the signaling thread rather than post
  an object reference.

Bug: none
Change-Id: I1e9eb31d8386dca3feaa90ee3267ea98eb3e81ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299144
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39696}
diff --git a/pc/sctp_data_channel.h b/pc/sctp_data_channel.h
index 8d95cc4..184603d 100644
--- a/pc/sctp_data_channel.h
+++ b/pc/sctp_data_channel.h
@@ -211,6 +211,11 @@
 
   DataChannelStats GetStats() const;
 
+  // Returns a unique identifier that's guaranteed to always be available,
+  // doesn't change throughout SctpDataChannel's lifetime and is used for
+  // stats purposes (see also `GetStats()`).
+  int internal_id() const { return internal_id_; }
+
   const StreamId& sid() const { return id_; }
 
   // Reset the allocator for internal ID values for testing, so that