Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: talk/app/webrtc/fakemetricsobserver.h

Issue 1156143005: Report metrics about negotiated ciphers. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback from tommi Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | talk/app/webrtc/fakemetricsobserver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/fakemetricsobserver.h
diff --git a/talk/app/webrtc/dtlsidentityservice.h b/talk/app/webrtc/fakemetricsobserver.h
similarity index 58%
copy from talk/app/webrtc/dtlsidentityservice.h
copy to talk/app/webrtc/fakemetricsobserver.h
index 760cab45651dd505731be490fbbc73fef1d4e07a..e9e49749bf104246b32dab0d3ebc124cc355cd2b 100644
--- a/talk/app/webrtc/dtlsidentityservice.h
+++ b/talk/app/webrtc/fakemetricsobserver.h
@@ -25,35 +25,44 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef TALK_APP_WEBRTC_DTLSIDENTITYSERVICE_H_
-#define TALK_APP_WEBRTC_DTLSIDENTITYSERVICE_H_
+#ifndef TALK_APP_WEBRTC_FAKEMETRICSOBSERVER_H_
+#define TALK_APP_WEBRTC_FAKEMETRICSOBSERVER_H_
+#include <map>
#include <string>
#include "talk/app/webrtc/peerconnectioninterface.h"
+#include "webrtc/base/thread_checker.h"
namespace webrtc {
-class DtlsIdentityStore;
-
-// This class forwards the request to DtlsIdentityStore to generate the
-// identity.
-class DtlsIdentityService : public webrtc::DTLSIdentityServiceInterface {
+class FakeMetricsObserver : public MetricsObserverInterface {
public:
- explicit DtlsIdentityService(DtlsIdentityStore* store) : store_(store) {}
+ FakeMetricsObserver();
+ void Reset();
+
+ void IncrementCounter(PeerConnectionMetricsCounter type) override;
+ void AddHistogramSample(PeerConnectionMetricsName type,
+ int value) override;
+ void AddHistogramSample(PeerConnectionMetricsName type,
+ const std::string& value) override;
+
+ // Accessors to be used by the tests.
+ int GetCounter(PeerConnectionMetricsCounter type) const;
+ int GetIntHistogramSample(PeerConnectionMetricsName type) const;
+ const std::string& GetStringHistogramSample(
+ PeerConnectionMetricsName type) const;
- // DTLSIdentityServiceInterface impl.
- // |identity_name| and |common_name| must equal to
- // DtlsIdentityStore::kIdentityName, otherwise the request will fail and false
- // will be returned.
- bool RequestIdentity(const std::string& identity_name,
- const std::string& common_name,
- webrtc::DTLSIdentityRequestObserver* observer) override;
+ protected:
+ ~FakeMetricsObserver() {}
private:
- DtlsIdentityStore* store_;
+ rtc::ThreadChecker thread_checker_;
+ int counters_[kPeerConnectionMetricsCounter_Max];
+ int int_histogram_samples_[kPeerConnectionMetricsCounter_Max];
+ std::string string_histogram_samples_[kPeerConnectionMetricsName_Max];
};
} // namespace webrtc
-#endif // TALK_APP_WEBRTC_DTLSIDENTITYSERVICE_H_
+#endif // TALK_APP_WEBRTC_FAKEMETRICSOBSERVER_H_
« no previous file with comments | « no previous file | talk/app/webrtc/fakemetricsobserver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698