From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 0823A77AAD for ; Wed, 12 Feb 2014 03:00:06 -0800 (PST) Received: by mail-wi0-f172.google.com with SMTP id e4so6699139wiv.11 for ; Wed, 12 Feb 2014 02:59:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=g3n2WZroURDB5w4yCgQU+x51NZyEWoe+QSOQQ0pga6s=; b=xdkgPGjz2gradl1MaC9cswSm8Lm7ww+c8/Abc4vxjLudBGTsAWcMy8t9RDmuKoMAxm EhQTLil4eFoC0b5u4ny65BQHTAAm8ES73ZqF7jNyvtNq5LjabIWl7TkN/zI1UQNN3wvY Q20H1TyDrjcmxpSMFwot58Xinz6HBgXjUI9ssp9JDe5f/asNJoYI0B+S+XT0lSiNMFre vHJzspBnSuMkxUaxBnFcYDu7ifsuRMOuO4TC7AzQaEHRNpCquCLq6kgSF46H6Z91eYlm UU4Er1h3n2hUZLsKqQtjc4PPxzW7SUX10VhqtNFJO6e1KSUKaR/L+2ZncCAu/vL7/cff 3Y/A== X-Received: by 10.194.2.206 with SMTP id 14mr8090807wjw.0.1392202763141; Wed, 12 Feb 2014 02:59:23 -0800 (PST) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by mx.google.com with ESMTPSA id d6sm4812119wiz.4.2014.02.12.02.59.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 12 Feb 2014 02:59:22 -0800 (PST) Date: Wed, 12 Feb 2014 10:59:19 +0000 From: Adam Thompson To: Karl Dahlke Message-ID: <20140212105919.GT11542@toaster.adamthompson.me.uk> References: <20140112052151.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140112052151.eklhad@comcast.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Edbrowse-dev@lists.the-brannons.com Subject: Re: [Edbrowse-dev] switch compartment X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Feb 2014 11:00:07 -0000 On Wed, Feb 12, 2014 at 05:21:51AM -0500, Karl Dahlke wrote: > My latest push adds SWITCH_COMPARTMENT to js.h, as suggested by Adam, > and uses that macro in the establish... and set... functions in jsloc.cpp. > These are gateway functions from html into the javascript world. > I also unrooted a couple more parameters that were rooted > earlier when html did not understand these objects. > This should not change any behavior, it is just a step along the way. Ok, pulled and now testing. Thanks for correcting my macro definition to correctly handle void as well. > Other functions need to use this macro, > and still other functions don't really need to set compartment > because they are internal. Yeah, sounds like a way ahead. > Then we can write some error legs that close down javascript for this session > upon error, but still let edbrowse continue. Yeah, I guess we'll need some wrappers to do this. Something like we've done for switching compartments i.e. if the operation (new object, new value) fails, print an error and return failure imediately. I can have a look at implementing these if you want. On this subject, what c++ standard do we want to try and conform to? I only ask as I'm wondering if we can just use variadic macros to do this. I'm not sure how readable this would be but it could certainly speed up the process whilst not being that unmaintainable in my opinion. Cheers, Adam.