| Index: third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.cpp
|
| diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.cpp
|
| index 4d8d48b6d48fa7f37d373e252e778526a0f045ee..d305c88b1df777b9c28e2c2414966f21674055d9 100644
|
| --- a/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.cpp
|
| +++ b/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.cpp
|
| @@ -17,6 +17,20 @@ bool addPropertyValue(v8::Local<v8::Object>& v8Object,
|
| isolate->GetCurrentContext(), v8String(isolate, name), value));
|
| }
|
|
|
| +bool addPropertySequenceOfBooleans(v8::Local<v8::Object>& v8Object,
|
| + v8::Isolate* isolate,
|
| + WebString name,
|
| + const WebVector<int>& webVector) {
|
| + v8::Local<v8::Array> v8Array = v8::Array::New(isolate, webVector.size());
|
| + for (size_t i = 0; i < webVector.size(); ++i) {
|
| + if (!v8CallBoolean(v8Array->CreateDataProperty(
|
| + isolate->GetCurrentContext(), static_cast<uint32_t>(i),
|
| + v8::Boolean::New(isolate, static_cast<bool>(webVector[i])))))
|
| + return false;
|
| + }
|
| + return addPropertyValue(v8Object, isolate, name, v8Array);
|
| +}
|
| +
|
| template <typename T>
|
| bool addPropertySequenceOfNumbers(v8::Local<v8::Object>& v8Object,
|
| v8::Isolate* isolate,
|
| @@ -64,6 +78,11 @@ v8::Local<v8::Value> webRTCStatsToValue(ScriptState* scriptState,
|
| continue;
|
| WebString name = member->name();
|
| switch (member->type()) {
|
| + case WebRTCStatsMemberTypeBool:
|
| + success &=
|
| + addPropertyValue(v8Object, isolate, name,
|
| + v8::Boolean::New(isolate, member->valueBool()));
|
| + break;
|
| case WebRTCStatsMemberTypeInt32:
|
| success &= addPropertyValue(
|
| v8Object, isolate, name,
|
| @@ -97,6 +116,10 @@ v8::Local<v8::Value> webRTCStatsToValue(ScriptState* scriptState,
|
| success &= addPropertyValue(v8Object, isolate, name,
|
| v8String(isolate, member->valueString()));
|
| break;
|
| + case WebRTCStatsMemberTypeSequenceBool:
|
| + success &= addPropertySequenceOfBooleans(v8Object, isolate, name,
|
| + member->valueSequenceBool());
|
| + break;
|
| case WebRTCStatsMemberTypeSequenceInt32:
|
| success &= addPropertySequenceOfNumbers(v8Object, isolate, name,
|
| member->valueSequenceInt32());
|
|
|