edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Adam Thompson <arthompson1990@gmail.com>
To: Karl Dahlke <eklhad@comcast.net>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] compartments
Date: Tue, 4 Feb 2014 21:00:27 +0000	[thread overview]
Message-ID: <20140204210027.GM32200@toaster.adamthompson.me.uk> (raw)
In-Reply-To: <20140104141719.eklhad@comcast.net>

On Tue, Feb 04, 2014 at 02:17:19PM -0500, Karl Dahlke wrote:
> > In edbrowse each window has its own js context.
> 
> Ok.
> 
> > Each page within that window has its own global object.
> 
> But there is only one page within the window.
> An edbrowse window has one html file, one context,
> and One global object via JS_NewGlobalObject().
> Each context has one global object, and thus one compartment.
> So the context is given as the first argument to a js function,
> and from there there should be just one compartment and one global object.
> I don't see how js could ever get the wrong compartment,
> there is only one to choose from.

In theory, but the compartment field is, by default, NULL.
The context needs to explicitly be told to use the compartment of the global object.

> > What this means when switching pages is that the context needs to be switched
> 
> Switch to another edbrowse page and you get another js context,
> with its one and only one global object.
> 
> I don't doubt you at all when you say the compartment calls
> are necessary, I'm just trying to figure out why they are necessary.
> If they are, maybe could be confined to jSyncup(),
> which starts the javascript thread, and j new context to build
> the global for the first time.

When I say a page within a window I'm referring to the ability of edbrowse to go back pages.
This seems to be where the trouble happens with compartments,
and to fix this I just used the autocompartment construct.
How are js contexts handled in this case?

Cheers,
Adam.

  reply	other threads:[~2014-02-04 21:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 19:17 Karl Dahlke
2014-02-04 21:00 ` Adam Thompson [this message]
2014-02-04 22:03 Karl Dahlke
2014-02-05 10:44 ` Adam Thompson
2014-02-05 13:55 Karl Dahlke
2014-02-05 22:09 ` Adam Thompson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140204210027.GM32200@toaster.adamthompson.me.uk \
    --to=arthompson1990@gmail.com \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=eklhad@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).