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

Unified Diff: third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.h

Issue 2363673002: Promise-based RTCPeerConnection::getStats implementation. (Closed)
Patch Set: RTCStatsReport.idl behind getStats-flag instead of updating virtual/stable/webexposed/global-interf… Created 4 years, 3 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
Index: third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.h
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.h b/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.h
new file mode 100644
index 0000000000000000000000000000000000000000..e36827a39b4fa229157246f4207ae887c74e2f80
--- /dev/null
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.h
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef RTCStatsReport_h
+#define RTCStatsReport_h
+
+#include "bindings/core/v8/Maplike.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "platform/heap/GarbageCollected.h"
+#include "public/platform/WebCString.h"
+#include "public/platform/WebRTCStats.h"
+#include "wtf/text/WTFString.h"
+
+#include <map>
+
+namespace blink {
+
+// https://w3c.github.io/webrtc-pc/#rtcstatsreport-object
+class RTCStatsReport final
+ : public GarbageCollectedFinalized<RTCStatsReport>
+ , public ScriptWrappable
+ , public Maplike<String, v8::Local<v8::Value>> {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ RTCStatsReport(std::unique_ptr<WebRTCStatsReport>);
+
+ // Maplike<String, v8::Local<v8::Value>>
+ PairIterable<String, v8::Local<v8::Value>>::IterationSource* startIteration(ScriptState*, ExceptionState&) override;
+ bool getMapEntry(ScriptState*, const String& key, v8::Local<v8::Value>&, ExceptionState&) override;
+
+ DEFINE_INLINE_VIRTUAL_TRACE() { }
+
+private:
+ std::unique_ptr<WebRTCStatsReport> m_report;
+};
+
+} // namespace blink
+
+#endif // RTCStatsReport_h

Powered by Google App Engine
This is Rietveld 408576698