W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2010

Re: [DataCache] Remove or Replace a Local Server Handler?

From: Nikunj R. Mehta <nikunj.mehta@oracle.com>
Date: Mon, 4 Jan 2010 14:40:49 -0800
Message-Id: <76348E01-6993-42B1-943C-34DBA75CFE27@oracle.com>
To: public-webapps@w3.org
> There is no way to remove a handler, or all handlers for a particular
> namespace, after some have been registered. However, this may be a
> valid design decision, because there probably aren't compelling use
> cases for removing or replacing handlers. The only time I ran into
> this need was running multiple tests in a single html file reusing
> the same namespace (uri).
>
> How about an application that wants to seamlessly update its offline
> handlers without reloading the page? It would need to download a
> script that removes the old handlers, and installs the new handlers.
I have added a method to window.navigator to remove any registered  
offline handlers for a given namespace.

>
> Does this sound useful and practical?
>
>
>
> As it stands right now, the Spec should be more specific about how
> registerOfflineHandler handles multiple handlers registered on the
> same namespace.
>
>   var namespace = ...
>   navigator.registerOfflineHandler(namespace, ..., ...); // 1st
>   navigator.registerOfflineHandler(namespace, ..., ...); // 2nd
>
> Possible scenarios:
>
>   1. The 2nd replaces (and removes) the 1st.
>   2. Both remain, the earliest registered handler is the final  
> candidate
>   3. Both remain, the latest registered handler is the final candidate
>   4. A different heuristic.
>
> I would prefer scenario #1. It doesn't make sense to have two  
> different
> handlers for the exact same namespace.  This also cuts down on  
> potential
> memory leaks, references to dead/unreachable code.
>
I have made this change.
Nikunj Mehta
http://blog.o-micron.com
Received on Monday, 4 January 2010 22:42:00 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:36 GMT