Hi,
I'm working on webrtc and I'm new to blink, hope this is an appropriate place to ask questions.
TL;DR: I have a Dictionary that should contain a "sequence<RTCCertificate> certificates" and I want to obtain RTCCertificate* pointers to these certificate objects.
Details:
I have a dictionary called RTCConfiguration which has a set of expected member variables according to webrtc standards. I'm trying to add a new member to it. This dictionary has not been defined as a type with an .idl file (not sure why) but is passed to the javascript function as a general Dictionary object which is parsed using DictionaryHelper::get to read out its members.
The new member of RTCConfiguration that I'm adding is "sequence<RTCCertificate> certificates" (RTCCertificate being a new interface that I've added and defined in .idl).
- My question is how do I obtain pointers to these RTCCertificate objects? If I have a Dictionary rtcConfiguration.
The existing code does something similar to read out another member variable, "sequence<RTCIceServer> iceServers". It roughly does this:
ArrayValue iceServers;
DictionaryHelper::get(rtcConfiguration, "iceServers", iceServers);
for (size_t i = 0; ...) {
Dictionary iceServer;
iceServers.get(i, iceServer);
/* Proceeds to parse the member variables of iceServer */
}
But for me it is not enough to parse out the member variables of the RTCCertificate objects. I want pointers to the actual certificate objects that rtcConfiguration.certificates references, I don't want to create new RTCCertificate objects upon parsing.
I looked at Dictionary::get(const String&, v8::Local<v8::Value>&). This should contain a pointer to the member object?
But I'm not sure how to do the casting to get the RTCCertificate*. (And if I end up trying to cast something that isn't an RTCCertificate I need to know about it so that I can cause a javascript invalid argument related exception.)
Any help is appreciated, thanks!
Henrik