Reland "Move stats ID generation from SSRC to local ID"

This is a reland of e357a4dd4e3b015f8281813f246de793589bd537
Original change's description:
> Move stats ID generation from SSRC to local ID
>
> This generates stats IDs for Track stats (which
> represents stats on the attachment of a track to
> a PeerConnection) from being SSRC-based to being
> based on an ID that is allocated when connecting the
> track to the PC.
>
> This is a prerequisite to generating stats before
> the PeerConnection is connected.
>
> Bug: webrtc:8673
> Change-Id: I82f6e521646b0c92b3af4dffb2cdee75e6dc10d4
> Reviewed-on: https://webrtc-review.googlesource.com/38360
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21582}

TBR=solenberg@webrtc.org

Bug: webrtc:8673
Change-Id: I610302efc5393919569b77e3b59aa3384a9b88a5
Reviewed-on: https://webrtc-review.googlesource.com/38842
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21589}
diff --git a/api/rtpsenderinterface.h b/api/rtpsenderinterface.h
index a7fbbda..a7d7edc 100644
--- a/api/rtpsenderinterface.h
+++ b/api/rtpsenderinterface.h
@@ -59,6 +59,13 @@
   // Returns null for a video sender.
   virtual rtc::scoped_refptr<DtmfSenderInterface> GetDtmfSender() const = 0;
 
+  // Returns an ID that changes every time SetTrack() is called, but
+  // otherwise remains constant. Used to generate IDs for stats.
+  // The special value zero means that no track is attached.
+  // TODO(hta): Remove default implementation when callers have updated,
+  // or move function to an internal interface.
+  virtual int AttachmentId() const { return 0; }
+
  protected:
   virtual ~RtpSenderInterface() {}
 };
@@ -77,7 +84,8 @@
   PROXY_CONSTMETHOD0(RtpParameters, GetParameters);
   PROXY_METHOD1(bool, SetParameters, const RtpParameters&)
   PROXY_CONSTMETHOD0(rtc::scoped_refptr<DtmfSenderInterface>, GetDtmfSender);
-END_PROXY_MAP()
+  PROXY_CONSTMETHOD0(int, AttachmentId);
+  END_PROXY_MAP()
 
 }  // namespace webrtc