Current stats interface as implemented - issues

Hello folks,
here's the current IDL for the stats interface as implemented in WebKit 
(extra fluff deleted):

     interface [
         Callback
     ] RTCStatsCallback {
         boolean handleEvent(in RTCStatsResponse response);
     };

     interface [
     ] RTCStatsResponse {
         sequence<RTCStatsReport> result();
     };

     interface [
     ] RTCStatsReport {
         sequence<RTCStatsElement> local();
         sequence<RTCStatsElement> remote();
     };

     interface [
     ] RTCStatsElement {
         readonly attribute long timestamp;
         DOMString stat(in DOMString name);
     };

Implementing this brought several questions to mind:

- What's the format of a timestamp? A "long" can't be an int32 of 
milliseconds since Jan 1, 1970 - because that would run out of bits some 
time in August 1970. What time representations do other Web APIs use, 
and why?

- What was I trying to achieve with the sequences in local() and 
remote()? Would it be equally powerful as single (optional) elements? 
(The reason for having them separate is that they have different 
timestamps.)

- Picking up on an earlier discussion: Should we make the argument to 
RTCStatsCallback be a sequence<RTCStatsReport>, and lose the 
RTCStatsResponse type from the IDL?

Implementation makes for clearer questions....

                   Harald

Received on Tuesday, 2 October 2012 13:22:37 UTC