OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_TRACK_METRICS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_TRACK_METRICS_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_TRACK_METRICS_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_TRACK_METRICS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
9 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
10 #include "base/threading/non_thread_safe.h" | 11 #include "base/threading/non_thread_safe.h" |
11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
12 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h
" | 13 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h
" |
13 | 14 |
14 namespace webrtc { | 15 namespace webrtc { |
15 class MediaStreamInterface; | 16 class MediaStreamInterface; |
16 class MediaStreamTrackInterface; | 17 class MediaStreamTrackInterface; |
17 } | 18 } |
18 | 19 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 75 |
75 protected: | 76 protected: |
76 // Calls SendLifetimeMessage for |observer| depending on |ice_state_|. | 77 // Calls SendLifetimeMessage for |observer| depending on |ice_state_|. |
77 void SendLifeTimeMessageDependingOnIceState( | 78 void SendLifeTimeMessageDependingOnIceState( |
78 MediaStreamTrackMetricsObserver* observer); | 79 MediaStreamTrackMetricsObserver* observer); |
79 | 80 |
80 // Implements MakeUniqueId. |pc_id| is a cast of this object's | 81 // Implements MakeUniqueId. |pc_id| is a cast of this object's |
81 // |this| pointer to a 64-bit integer, which is usable as a unique | 82 // |this| pointer to a 64-bit integer, which is usable as a unique |
82 // ID for the PeerConnection this object is attached to (since there | 83 // ID for the PeerConnection this object is attached to (since there |
83 // is a one-to-one relationship). | 84 // is a one-to-one relationship). |
84 uint64 MakeUniqueIdImpl(uint64 pc_id, | 85 uint64_t MakeUniqueIdImpl(uint64_t pc_id, |
85 const std::string& track, | 86 const std::string& track, |
86 StreamType stream_type); | 87 StreamType stream_type); |
87 | 88 |
88 private: | 89 private: |
89 // Make a unique ID for the given track, that is valid while the | 90 // Make a unique ID for the given track, that is valid while the |
90 // track object and the PeerConnection it is attached to both exist. | 91 // track object and the PeerConnection it is attached to both exist. |
91 uint64 MakeUniqueId(const std::string& track, StreamType stream_type); | 92 uint64_t MakeUniqueId(const std::string& track, StreamType stream_type); |
92 | 93 |
93 typedef ScopedVector<MediaStreamTrackMetricsObserver> ObserverVector; | 94 typedef ScopedVector<MediaStreamTrackMetricsObserver> ObserverVector; |
94 ObserverVector observers_; | 95 ObserverVector observers_; |
95 | 96 |
96 webrtc::PeerConnectionInterface::IceConnectionState ice_state_; | 97 webrtc::PeerConnectionInterface::IceConnectionState ice_state_; |
97 }; | 98 }; |
98 | 99 |
99 } // namespace | 100 } // namespace |
100 | 101 |
101 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_TRACK_METRICS_H_ | 102 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_TRACK_METRICS_H_ |
OLD | NEW |