From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from qmta15.westchester.pa.mail.comcast.net (qmta15.westchester.pa.mail.comcast.net [IPv6:2001:558:fe14:44:76:96:59:228]) by hurricane.the-brannons.com (Postfix) with ESMTP id BA15C7788B for ; Tue, 4 Feb 2014 11:17:49 -0800 (PST) Received: from omta24.westchester.pa.mail.comcast.net ([76.96.62.76]) by qmta15.westchester.pa.mail.comcast.net with comcast id NHZ71n0031ei1Bg5FKHJcc; Tue, 04 Feb 2014 19:17:18 +0000 Received: from eklhad ([107.5.36.150]) by omta24.westchester.pa.mail.comcast.net with comcast id NKHJ1n00i3EMmQj3kKHJ2F; Tue, 04 Feb 2014 19:17:18 +0000 To: Edbrowse-dev@lists.the-brannons.com From: Karl Dahlke User-Agent: edbrowse/3.4.10 Date: Tue, 04 Feb 2014 14:17:19 -0500 Message-ID: <20140104141719.eklhad@comcast.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1391541438; bh=96sd4/unwSgbA0NUFlw2n9osVWMUW91+bLxoYWufPrM=; h=Received:Received:To:From:Reply-to:Subject:Date:Message-ID: Mime-Version:Content-Type; b=HY/ZFq6dshQyQ9jv+UptEW87k/4USOxdKmgMXDthXb/n4fxlxt1u3zNRQ9aH6ohhb agk8H48BBslV8wk/l6979lrgnQ5JluFkisxPTr/LS8FKioTPoZVvZqNtelp9w+r2ZU /dO5azBSGj7XnQIt1MD2Futh7dS5eNWi8HhuU04Ea7h1WXpTbOiRXayMpbnkGrgLjr 7wbyRhFgXY4NmGXZxyhbfaIAjr+GwMRnMUEGp6MMBLuRTRMHC55CtX7+ii5mJY1VTf JYxqHeq+cMZKYzvawvFigDVP23xq6ZK8NBG0qlYeVrLFJf/dJYz541Vw9oBTOG1ZO9 ncZAd7JyPNcXA== Subject: [Edbrowse-dev] compartments X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Karl Dahlke List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 19:17:50 -0000 Sorry to bother you; don't know if this should move off-line. > a runtime is created which holds everything else Ok. > A runtime can contain multiple contexts, Ok. > Each context contains multiple compartments; Ok. > 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. > 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. Karl Dahlke