| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Implement tracing for GObjects and use it so that signal handlers
are rooted to the objects they're connected, and not the global
object. This means that if the object goes away and the only thing
referring to it is the handler function, it is recognized as a
cycle by the GC and collected, reducing memory leaks.
Other closures, as well as callback trampolines and vfuncs, are still
rooted in the usual way.
https://bugzilla.gnome.org/show_bug.cgi?id=678504
|
|
|
|
|
|
| |
Found with make valgrind-check. We should run it more often.
https://bugzilla.gnome.org/show_bug.cgi?id=676843
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=664360
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As reported by valgrind-check.
14 bytes in 1 blocks are definitely lost in loss record 301 of 1,270
at 0x4024F20: malloc (vg_replace_malloc.c:236)
by 0x40FAD63: g_malloc (gmem.c:164)
by 0x4113C18: g_strdup (gstrfuncs.c:102)
by 0x4037F11: gjs_string_get_ascii (jsapi-util-string.c:272)
by 0x5BE20D4: gjs_js_dbus_acquire_name (dbus.c:1178)
by 0x420A016: js_Interpret (in /opt/big/lib/libmozjs.so)
by 0x4213700: js_Execute (in /opt/big/lib/libmozjs.so)
by 0x41B8894: JS_EvaluateUCScriptForPrincipals (in /opt/big/lib/libmozjs.so)
by 0x41B897E: JS_EvaluateUCScript (in /opt/big/lib/libmozjs.so)
by 0x41BCF2F: JS_EvaluateScript (in /opt/big/lib/libmozjs.so)
by 0x4031BE3: gjs_context_eval (context.c:912)
by 0x4031EA7: gjs_context_eval_file (context.c:993)
https://bugzilla.gnome.org/show_bug.cgi?id=639167
|
|
|
|
|
|
|
| |
Fix a case where we would never remove a root we added and another
place where we removed a root twice in a cleanup path.
https://bugzilla.gnome.org/show_bug.cgi?id=636928
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This upstream mozilla commit:
http://hg.mozilla.org/mozilla-central/changeset/f7171a41a816
removed JS_GetStringBytes in favor of an API which requires
the caller to allocate. We were using this function in
a number of places, and most of those now need to malloc()
with the new API. Rather than trying to use JS_GetStringBytes
as "const", and malloc() only with the new API, wrap it
and always malloc()/free().
Based on a patch originally from Sardem FF7 <sardemff7.pub@gmail.com>.
https://bugzilla.gnome.org/show_bug.cgi?id=635707
|
|
|
|
|
|
|
|
| |
In xulrunner2, JS_GetStringBytes has been removed, we will now always need a context.
We won't be able to use gjs_string_get_ascii anymore, port each call to it to gjs_string_get_ascii_checked
Btw, rename gjs_string_get_ascii_checked to gjs_string_get_ascii
https://bugzilla.gnome.org/show_bug.cgi?id=635707
|
|
|
|
|
|
|
| |
These were missed in the big conversion to fast natives in
c78646ed3f24bd915c7cfe4aca
https://bugzilla.gnome.org/show_bug.cgi?id=632159
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously <gjs/gjs.h> pulled in a lot of stuff, and in particular,
<gjs/jsapi-util.h>, which in turn required <jsapi.h>. For a simple
app that wants to embed GJS we should not be pulling that in.
So <gjs/gjs.h> is now the "simple" API that actually just includes
<gjs/context.h>, suitable for creating a context and calling eval().
<gjs/gjs-module.h> is now equivalent to the old <gjs/gjs.h>, it
pulls in the world.
Also, create a corresponding .pc file, gjs-internals-1.0.pc. This one
includes mozjs as Requires, and adds the requisite Cflags. For
gjs-1.0.pc, change the Requires to simply be gobject-2.0.
Conceptually, a gjs-devel RPM should not Require
gobject-introspection-devel or xulrunner-devel, and a simple embedder
program just using gjs_context_new()/gjs_context_eval() should not
have DT_NEEDED on gobject-introspection-1.0.so or mozjs.so.
https://bugzilla.gnome.org/show_bug.cgi?id=632795
|
|
|
|
|
|
|
|
|
| |
In XULRunner 1.9.3, passing a custom prototype or parent to
JS_ConstructObject for Object fails, so work around with a separate calls
to SetPrototype()/SetParent().
See https://bugzilla.mozilla.org/show_bug.cgi?id=599651.
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using multiple nested contexts on the same thread isn't normal usage of
Spidermonkey and triggers bugs in Spidermonkey that might not be caught
in upstream testing. (It is theoretically supported, to at least some extent.)
When calling a callback, the best context to use is the current context.
If that's not available, then using the default context from the GjsContext
is usually sensible.
Add functions:
gjs_runtime_push_context()
gjs_runtime_pop_context()
gjs_runtime_get_current_context()
One potential concern here is the extensive use of GDataset to get data
from a context, which involves locking overhead and hash table lookups and
can be slow; since we can't use GJS with multiple JS_Runtimes in the same
process due to the limitations of toggle references, perhaps we should enforce
that and use global variables.
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
|
|
|
|
|
|
|
|
|
| |
The two have always been conceptually distinct types. Even in 1.9.3,
they are still the same in implementation, but to avoid a pile of
warnings, we should avoid confusing them. Unfortunately, even the
SpiderMonkey docs are wrong in a few places, so gjs' code confusing
them is understandable.
Anyways, fix up places that made this assumption.
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=622896
|
| |
|
|
|
|
|
|
|
|
| |
for methods with an empty out signature.
I broke this with https://bugzilla.gnome.org/show_bug.cgi?id=629965
https://bugzilla.gnome.org/show_bug.cgi?id=629967
|
| |
|
|
|
|
|
|
| |
to avoid re-entrency issues.
https://bugzilla.gnome.org/show_bug.cgi?id=617702
|
|
|
|
|
|
|
| |
This is one step toward thread safety. Remaining work includes at least:
* put locks on our own global state
* JS_SuspendRequest() when blocking in native code
* JS_SetContextThread() on load and call contexts
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The dbus binding had inconsistent and pretty broken support for
retrieving the sender of a DBusMessage. The function
gjs_js_add_dbus_props, when passed an object, added a _dbus_sender
property. However, in many cases it won't be passed an object,
such as a service method implementation.
There are a number of cases here; the primary ones that we need
to support are service methods, signals, and asynchronous callbacks.
This patch regresses one case, which is that previously if you
did a synchronous call that *also* returned multiple values, you
could access _dbus_sender. This patch has no support for synchronous
calls, however there is a workaround - convert them to asynchronous.
https://bugzilla.gnome.org/show_bug.cgi?id=609121
|
|
|
|
|
|
|
| |
call status
Otherwise the exception is a little bit opaque. Well, it is
a little bit opaque anyway, but maybe this helps somewhat.
|
|
|
|
| |
This can be used to ensure that DBus signals have been sent before continuing.
|
|
|
|
|
|
|
|
| |
In order for
#include <gjs-dbus/dbus.h>
in dbus-private.h to work both in the source tree and after it is installed
in $INCUDEDIR/gjs-1.0/gjs-dbus, we need our locate copy of dbus.h to be in
a directory named gjs-dbus, not gjsdbus.
|
|
|
|
|
| |
Commit e6466712a28c29f23e1e3e762c68ccc2d8e339a5 ported over some code
contributed by Litl, but a few bugs crept in. This patch fixes them.
|
|
This patch merges in code from Litl implementing a DBus module.
At a high level there are four pieces. First, the "gjs-dbus"
library is a C support library for DBus.
Second, the modules/dbus*.[ch] implement parts of the JavaScript
API in C. Third, the modules/dbus.js file fills out the rest
of the JavaScript API and implementation. Fourth, there are
tests and examples.
|