Commit Graph

335 Commits

Author SHA1 Message Date
Tooru Fujisawa
ddd36fec56 Bug 1332245 - Move nsScriptError from js/xpconnect to dom/bindings. r=bz
--HG--
rename : js/xpconnect/idl/nsIScriptError.idl => dom/bindings/nsIScriptError.idl
rename : js/xpconnect/src/nsScriptError.cpp => dom/bindings/nsScriptError.cpp
rename : js/xpconnect/src/nsScriptErrorWithStack.cpp => dom/bindings/nsScriptErrorWithStack.cpp
2017-01-28 00:42:47 +09:00
Nicholas Nethercote
bf48aecf29 Bug 1332172 - Remove XPC_MAP_WANT_*. r=mccr8.
nsIXPCScriptable flags handling in xpc_map_end.h is a bit of a mess.

- Half the flags relate to whether various functions are defined (PreCreate,
  GetProperty, etc). These are set using the XPC_MAP_WANT_* macros;
  for each one xpc_map_end.h  inserts the corresponding flag using the
  preprocessor (see XPC_MAP_CLASSNAME::GetScriptableFlags()).

- The other half of the flags relate to other things (IS_GLOBAL_OBJECT,
  DONT_REFLECT_INTERFACE_NAMES, etc). These are set using the XPC_MAP_FLAGS
  macro.

Having two similar but different mechanisms to set the flags for a class is
confusing. (Indeed, until recently we had some classes where a single flag was
redundantly specified via both mechanisms.) Note also that the classes done in
dom/base/nsIDOMClassInfo.h also specify all the flags in a single value,
similar to how XPC_MAP_FLAGS works.

This patch removes the XPC_MAP_WANT_* macros. All flags are now set
via XPC_MAP_FLAGS. This is a significant simplification to xpc_map_end.h and
all the places that use it.

The downside of this change is that I had to change the flag constants from
class constants (i.e. nsIXPCScriptable::FOO) to macros (i.e.
NSIXPCSCRIPTABLE_FOO) because they need to be used in #if statements like this
in xpc_map_end.h:

  #if !((XPC_MAP_FLAGS) & NSIXPCSCRIPTABLE_WANT_PRECREATE)

and you can't use a '::'-qualified name inside a #if. I think this downside is
outweighed by the simplification described above.

Overall the patch removes 80 lines of code.

--HG--
extra : rebase_source : 6d5c341d0deba8f1529d81c17bb8819e09620b05
2017-01-23 13:33:58 +11:00
Nicholas Nethercote
e3685c4266 Bug 1329846 (part 1) - Remove XPCNativeScriptableInfo. r=mccr8.
XPCNativeScriptableInfo is now a very thin wrapper around nsIXPCScriptable, and
it uses manual memory management. Removing it simplifies things quite a bit.

In particular, when setting XPCWrappedNative::mScriptable in
XPCWrappedNative::WrapNewGlobal() and XPCWrappedNative::Init() we no longer
have to worry about sharing the XPCNativeScriptableInfo object with the proto.
And XPCWrappedNative::{Init,Destroy}() have similar simplifications.

--HG--
extra : rebase_source : e58eb28f1574224a8e8badf25fcfa25e5a5b8ad8
2017-01-10 12:47:57 +11:00
Nicholas Nethercote
7fad269a06 Bug 1324330 (part 6) - Streamline nsIXPCScriptable flags. r=mccr8.
This patch adjusts the values so there are no skipped bits, and removes the
no-longer-used RESERVED flag.

--HG--
extra : rebase_source : 88a50110d66ad85c1277213afea7e08f7aa9538a
2016-12-23 08:30:45 +11:00
Nicholas Nethercote
c7018d9f7d Bug 1325542 - Remove XPCNativeScriptableFlags. r=mccr8.
WantFoo() and the similar methods remain, but they've been moved from
XPCNativeScriptableFlags to nsIXPCScriptable.

One consequence of this change is that in places where we used to get the flags
from an XPCNativeScriptableCreateInfo we now need a null check on the
nsIXPCScriptable. (This isn't true when getting flags from
XPCNativeScriptableInfo, however, because nsIXPCScriptable is always non-null
within that type.)

--HG--
extra : rebase_source : 3d1e1d1c313b4629bb2e337cc2fb7c0d1092ed99
2016-12-23 16:14:32 +11:00
Nicholas Nethercote
df925b776c Bug 1321374 - Simplify js::Class handling relating to nsIXPCScriptable. r=mccr8, sr=bholley.
This patch removes XPCNativeScriptableShared and XPCNativeScriptableSharedMap,
which results in a net reduction of ~100 lines of code.
2016-12-14 08:33:46 +11:00
Nicholas Nethercote
f81fa28212 Bug 1322080 (part 3, attempt 2) - Remove nsIXPCScriptable::addProperty. r=peterv.
--HG--
extra : rebase_source : af5d98e2d84bd7592b499134e06c98821302f488
2016-12-02 17:37:55 +11:00
Carsten "Tomcat" Book
5f2a9e53a6 Backed out changeset 9356d8836ca8 (bug 1322080) 2016-12-12 12:15:49 +01:00
Nicholas Nethercote
d307e2a3a9 Bug 1322080 (part 3) - Remove nsIXPCScriptable::addProperty. r=peterv.
The only non-trivial implementation of this method is in nsEventTargetSH, but
it's never called, so no point keeping it around. (Similar methods were removed
in bug 1132184 and bug 1132187.)
2016-12-02 17:37:55 +11:00
Kris Maglione
74012f4fcd Bug 1312690: Load content scripts asynchronously when possible. r=aswan
MozReview-Commit-ID: BzpZA4stbCI

--HG--
extra : rebase_source : 1b93f4ee7add989b3716b75c26ee9835e086d29c
2016-11-02 13:57:19 -07:00
Jan de Mooij
7f794780e0 Bug 1302448 part 2 - Rename XPCJSRuntime to XPCJSContext. r=mrbkap
--HG--
rename : js/xpconnect/src/XPCJSRuntime.cpp => js/xpconnect/src/XPCJSContext.cpp
extra : rebase_source : e6b435ab1ca2739e340669195dff77c561ea573e
2016-09-14 15:48:17 +02:00
Tom Tromey
5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Boris Zbarsky
0184b4df38 Bug 1282150 part 6. Get rid of GetSafeJSContext. r=bholley 2016-07-07 20:08:26 -04:00
Bill McCloskey
c952246316 Bug 1214824 - Forbid CPOW usage if add-on declares it is multiprocessCompatible (r=mrbkap) 2016-07-05 13:59:36 -07:00
Phil Ringnalda
ef87dff4e9 Back out 14928a6b38f3 (bug 1214824) for leaking an nsStringBuffer in debug e10s devtools 2016-06-30 21:12:11 -07:00
Bill McCloskey
3f712641d1 Bug 1214824 - Forbid CPOW usage if add-on declares it is multiprocessCompatible (r=mrbkap) 2016-06-30 17:38:54 -07:00
Boris Zbarsky
16f83caaad Bug 767938 part 6. Get rid of XPConnect's GetCurrentJSContext getter. r=bholley 2016-06-24 14:19:50 -04:00
Boris Zbarsky
9156808526 Bug 1276310 part 2. Get rid of Components.lastResult and the corresponding XPCContext member. r=bholley 2016-06-23 00:22:30 -04:00
Olli Pettay
6371f21e0c Bug 1279746 - Optimize xpc_TryUnmarkWrappedGrayObject, r=mccr8 2016-06-14 13:14:21 +01:00
Boris Zbarsky
98aa24ddc7 Bug 1275704 part 3. Remove the nsXPConnect::ReportAllJSExceptions mechanism, since it's dead code now. r=bholley 2016-05-26 19:39:03 -04:00
Jeff Walden
80f0832949 Bug 1264896 - Kill off nsIRemoteTagService and do what it does, in its sole caller, in far-faster C++. r=billm
--HG--
extra : rebase_source : 4ab4985b1e6731a6caa523d7802a6292454cbc55
2016-04-21 21:51:16 -07:00
Morgan Phillips
9050862722 Bug 1255133 - Surface links to external documentation alongside relevant error messages 1/2; r=bgrins
--HG--
extra : rebase_source : 2c285070e648d42ccdd523c2415c6c6c6ed1a871
extra : amend_source : c6dd5cd109d6a767523dab6d35f8f3509995d9cd
2016-04-01 23:17:49 -07:00
Boris Zbarsky
655d4654c8 Bug 1257919 part 4. Stop returning StackFrame instances from exceptions::CreateStack. C++ callers of GetCurrentJSStack or exceptions::CreateStack always check for null anyway, and none of them seem to want this non-JS thing. r=khuey 2016-03-22 13:50:31 -04:00
Boris Zbarsky
44088b97d0 Bug 1257919 part 2. Make nsIException and nsIStackFrame builtinclass, so we can start using [implicit_jscontext] on them. r=khuey 2016-03-22 13:50:31 -04:00
Sebastian Hengst
4e4e0bcb49 Backed out changeset 8bb1cce4804d (bug 1257919) 2016-03-22 21:11:05 +01:00
Sebastian Hengst
60e4be8fc0 Backed out changeset 1b5db6edd791 (bug 1257919) 2016-03-22 21:10:45 +01:00
Boris Zbarsky
8ba7a0b580 Bug 1257919 part 4. Stop returning StackFrame instances from exceptions::CreateStack. C++ callers of GetCurrentJSStack or exceptions::CreateStack always check for null anyway, and none of them seem to want this non-JS thing. r=khuey 2016-03-22 13:50:31 -04:00
Boris Zbarsky
c978d9ded6 Bug 1257919 part 2. Make nsIException and nsIStackFrame builtinclass, so we can start using [implicit_jscontext] on them. r=khuey 2016-03-22 13:50:31 -04:00
Ms2ger
5ed06a1f77 Bug 1250917 - Remove NS_SUCCESS_I_DID_SOMETHING; r=bholley
It hasn't been used for a while now.
2016-02-25 09:28:06 +01:00
Bill McCloskey
c95da3e673 Bug 1233497 - Fix infrastructure for disallowing unsafe CPOWs in browser code. r=mrbkap
--HG--
extra : commitid : AkRt0J9Cpgt
extra : rebase_source : 39bf3c27ce593c95e4aecb5f7bb55a8ffc05382c
2016-01-05 19:28:27 -05:00
Boris Zbarsky
29345faced Bug 1229664. Drop the concept of inner exceptions from Exception/DOMException. r=bholley 2015-12-02 13:52:59 -05:00
Tom Tromey
4113691556 Bug 1221292 - move nondeterministicGetWeakMapKeys to ThreadSafeChromeUtils; r=bz 2015-11-11 12:55:00 +01:00
Nathan Froyd
01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Bobby Holley
796a2d66a8 Bug 1212693 - Remove skipCOWCallableChecks. r=bz 2015-10-08 10:22:00 -07:00
Mike Kaply
68b080c7c5 Bug 1152512 - Use the latest JavaScript version when parsing AutoConfig files. r=mrbkap
--HG--
extra : rebase_source : 4527671894b43e60e16d4b6be5e6af55b68b6ebe
2015-07-28 13:57:55 -05:00
Carsten "Tomcat" Book
ce5ca9b688 Backed out changeset 0afe24f16cf4 (bug 1152512) for bustage 2015-07-28 14:38:01 +02:00
Mike Kaply
1acb520ff0 Bug 1152512 - Use the latest JavaScript version when parsing AutoConfig files. r=mrbkap 2015-07-28 07:13:26 -05:00
Andrew McCreight
621e57b2b7 Bug 1176341 - De-holder nsIXPConnect::CreateSandbox. r=baku,gabor 2015-07-21 11:31:44 -07:00
Ryan VanderMeulen
fb3e0b058e Backed out changeset 553a3e1e7b18 (bug 1176341) for bustage.
CLOSED TREE
2015-07-21 13:00:55 -04:00
Andrew McCreight
5cbc3abf39 Bug 1176341 - De-holder nsIXPConnect::CreateSandbox. r=baku,gabor 2015-07-21 09:44:37 -07:00
Alexandre Poirot
18efabed2b Bug 814497 - Pass SavedFrame from JS::ErrorObject to nsIScriptError. r=bholley 2015-07-09 07:02:00 -04:00
Andrew McCreight
61c724c488 Bug 958778 - De-holder nsIXPConnect::GetWrappedNativePrototype(). r=gabor 2015-07-01 11:17:17 -07:00
Andrew McCreight
53e8d2ac49 Bug 958641 - De-holder nsIXPConnect::WrapNative. r=gabor 2015-07-01 11:17:17 -07:00
Andrew McCreight
898cb90713 Bug 886459, part 4 - Remove nsIJSRuntimeService. r=bholley,aklotz 2015-06-26 18:44:14 -07:00
Andrew McCreight
fd7600ed25 Bug 886459, part 2 - Remove context callbacks from XPCJSRuntime. r=bholley
These are unused.
2015-06-26 18:44:13 -07:00
Magnus Melin
9ccc5bb1d7 Bug 1176749. nsIScriptError.idl should use nsStringGlue.h, not nsString.h. r=mrbkap 2015-06-23 20:31:17 +03:00
Bill McCloskey
a2c6c7d4bf Bug 1143006 - Show warning for http-on-* in child process (r=mrbkap) 2015-06-19 17:35:06 -07:00
Gabor Krizsanits
c5989e232b Bug 1164014 - Shim optimization. r=billm 2015-06-08 09:28:54 +02:00
Ryan VanderMeulen
1bc8d0eab9 Backed out changesets eebab8b7ea69 and 5b908d656044 (bug 1164014) for e10s OOMs. 2015-06-02 12:23:12 -04:00
Gabor Krizsanits
7a422f317b Bug 1164014 - Shim optimization. r=billm 2015-06-02 16:00:30 +02:00