Add thread checker to StatsCollection.

This CL makes sure the methods are always called on the correct thread.

Review URL: https://codereview.webrtc.org/1235263003

Cr-Commit-Position: refs/heads/master@{#9688}
diff --git a/talk/app/webrtc/statstypes.h b/talk/app/webrtc/statstypes.h
index c58f390..156e784 100644
--- a/talk/app/webrtc/statstypes.h
+++ b/talk/app/webrtc/statstypes.h
@@ -43,6 +43,7 @@
 #include "webrtc/base/linked_ptr.h"
 #include "webrtc/base/scoped_ref_ptr.h"
 #include "webrtc/base/stringencode.h"
+#include "webrtc/base/thread_checker.h"
 
 namespace webrtc {
 
@@ -383,7 +384,6 @@
 // A map from the report id to the report.
 // This class wraps an STL container and provides a limited set of
 // functionality in order to keep things simple.
-// TODO(tommi): Use a thread checker here (currently not in libjingle).
 class StatsCollection {
  public:
   StatsCollection();
@@ -409,6 +409,7 @@
 
  private:
   Container list_;
+  rtc::ThreadChecker thread_checker_;
 };
 
 }  // namespace webrtc