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/rtpreceiverinterface.h b/api/rtpreceiverinterface.h
index 311971d..ac2e090 100644
--- a/api/rtpreceiverinterface.h
+++ b/api/rtpreceiverinterface.h
@@ -127,6 +127,13 @@
   virtual std::vector<RtpSource> GetSources() const {
     return std::vector<RtpSource>();
   }
+  // TODO(hta): Remove default implementation or move function to
+  // an internal interface. content::FakeRtpReceiver in Chromium needs this.
+
+  // Returns an ID that changes if the attached track changes, but
+  // otherwise remains constant. Used to generate IDs for stats.
+  // The special value zero means that no track is attached.
+  virtual int AttachmentId() const { return 0; }
 
  protected:
   virtual ~RtpReceiverInterface() {}
@@ -146,6 +153,7 @@
   PROXY_METHOD1(bool, SetParameters, const RtpParameters&)
   PROXY_METHOD1(void, SetObserver, RtpReceiverObserverInterface*);
   PROXY_CONSTMETHOD0(std::vector<RtpSource>, GetSources);
+  PROXY_CONSTMETHOD0(int, AttachmentId);
   END_PROXY_MAP()
 
 }  // namespace webrtc