W3C home > Mailing lists > Public > public-webrtc@w3.org > September 2012

Re: Stats interface - modelling on IndexedDB API?

From: Harald Alvestrand <harald@alvestrand.no>
Date: Fri, 14 Sep 2012 11:08:23 -0700
Message-ID: <50537297.2090003@alvestrand.no>
To: "Cullen Jennings (fluffy)" <fluffy@cisco.com>
CC: "public-webrtc@w3.org" <public-webrtc@w3.org>
I got some pushback from Tommy - all the other APIs we have are of the form

function(parameters, callbackfn)

so introducing a single function of the form

object=function(parameters); object.callback = callbackfn

seems unreasonable - and it turns out the implementation under the 
covers isn't that different.
So unless I hear howls of protest, I'm changing it back before asking 
for review of the WebKit patch.


On 09/03/2012 08:10 AM, Cullen Jennings (fluffy) wrote:
> On Aug 30, 2012, at 4:53 AM, Harald Alvestrand <harald@alvestrand.no> wrote:
>> Hi,
>> when implementing the Stats interface, I've concluded that it's not quite trivial to do it the way I'd written it up, due to the way WebKit hangs together.
>> Would anyone mind terribly if I changed it around to do it the way the IndexedDB API does it?
>> Basically, it seems to be:
>> - Request returns a "request object" with a status and a result
>> - When the data is ready, it fires a "success" event at the request object
>> - The caller can then read the data out from the request object
>> http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest
>> Seems a bit easier to get threaded through WebKit than the "simpler" method of "just" returning a complex structure in a callback.
>>                        Harald
> I think that sounds like a good pattern to use but don't have strong feelings either way. As long as there is some way for the JS app to get the stats, seems good to me.
Received on Friday, 14 September 2012 18:08:56 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:35:48 UTC