* [Edbrowse-dev] switch compartment
@ 2014-02-12 10:21 Karl Dahlke
2014-02-12 10:59 ` Adam Thompson
0 siblings, 1 reply; 3+ messages in thread
From: Karl Dahlke @ 2014-02-12 10:21 UTC (permalink / raw)
To: Edbrowse-dev
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.
Other functions need to use this macro,
and still other functions don't really need to set compartment
because they are internal.
Then we can write some error legs that close down javascript for this session
upon error, but still let edbrowse continue.
Karl Dahlke
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Edbrowse-dev] switch compartment
2014-02-12 10:21 [Edbrowse-dev] switch compartment Karl Dahlke
@ 2014-02-12 10:59 ` Adam Thompson
0 siblings, 0 replies; 3+ messages in thread
From: Adam Thompson @ 2014-02-12 10:59 UTC (permalink / raw)
To: Karl Dahlke; +Cc: Edbrowse-dev
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Edbrowse-dev] switch compartment
@ 2014-02-12 14:51 Karl Dahlke
0 siblings, 0 replies; 3+ messages in thread
From: Karl Dahlke @ 2014-02-12 14:51 UTC (permalink / raw)
To: Edbrowse-dev
> Yeah, I guess we'll need some wrappers to do this.
Well the logic is
if(unrecoverable failure) {
i_puts("helpful messsage saying your javascript is rendered invalid for this session,
but will still operate in other sessions.");
DestroyContext(cw->jss->jcx);
delete cw->jss);
cw->jss = NULL;
}
This could be a function, inline function, or macro,
guess I don't have strong feelings about that.
We'll need at least one new message which is fine;
just add some zeros on the end for the other languages
so I can keep the books.
Don't reindent messages.h, it messes up the line counts.
I've been driving for a while and need to work on some other things
so if you want to carry on for a bit that's fine.
Karl Dahlke
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-12 14:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 10:21 [Edbrowse-dev] switch compartment Karl Dahlke
2014-02-12 10:59 ` Adam Thompson
2014-02-12 14:51 Karl Dahlke
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).