On Oct 15, 2014, at 12:14 PM, Boris Zbarsky wrote:

> On 10/15/14, 3:05 PM, Allen Wirfs-Brock wrote:
>> ...
> 
>> So, the basic question becomes one how the browser maps web pages to
>> Vats. If each pages get a separate Vat
> 
> They don't.  Basically, same-origin web pages correspond to multiple Realms 
> within a single Vat, since from their point of view direct object references 
> exist between them.
> 
> Worse yet, different-origin web pages might be able to become same-origin 
> (due to document.domain).
> 
> So in practice in a web browser a bunch of different web pages are all 
> separate Realms in the same Vat.

Right,  but in practice, for different-origin pages, don't you use various 
forms of serialization/proxying to provide  Vat-like object reference 
isolation? If you do that, then it feels like multiple Vats that share a single 
execution thread. We didn't current have that concept in ES, but we probably 
could.

Don't multi-process (eg, process per tab, etc.) browsers in fact have multiple 
execution threads?

> 
>> If the entire browser environment was represent
>> as one vat then the loop continues as long as the browser is running.
> 
> Yes, this is precisely the failure mode in Firefox right now.
> 
>> For example, perhaps it could purge all Jn jobs if Realm R is destroyed.
> 
> You can't really "destroy" a realm while someone is holding references to 
> functions from that realm, yes?
> 
> What Gecko does do is mark a realm that corresponds to a navigated-away-from 
> web page (but NOT a web page loaded in an <iframe> that is then removed from 
> the DOM, for web compat reasons) as "inactive", and Web IDL callbacks that 
> are backed by functions from such a Realm become no-ops.  Functions in that 
> Realm can still be called directly, but not via a Web IDL callback.

I intentionally used "destroy"  as a ill defined, non-technical terms.  What 
you describe above is along the lines of what I was thinking. A 
PromiseReactionJob that is associated with a marked Realm might plausibly by 
purged (perhaps by replacing its reaction function with a "Thrower", which 
would break the loop).

Regardless, it seems desirable to be able to describe what happens in terms of 
the specified Promise/Realm/Job semantics.


Allen
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to