Граф коммитов

647 Коммитов

Автор SHA1 Сообщение Дата
Jan de Mooij 7e5724db61 Bug 1383775 - Clean up function toString/toSource code, remove remnants of source decompiler. r=anba 2017-07-25 13:22:11 +02:00
Ting-Yu Chou a4c77b8ab9 Bug 1363959 - Compare jsid equality instead of string comparison in XrayResolveOwnProperty(). r=bholley
MozReview-Commit-ID: LFK5hR2RBGF

--HG--
extra : rebase_source : 1aa34b9998840302574f23c00d15ec713f70dcde
2017-07-20 15:12:03 +08:00
Boris Zbarsky 66481a7a29 Bug 1371259 part 9. Make UnwrapReflectorToISupports return already_AddRefed<nsISupports>. r=peterv
The main reason to not do this would be performance (avoiding the
addref/release), but there are two main mitigating factors:

1)  All calls to UnwrapReflectorToISupports that pass in a Web IDL object
    already do the addref (and in fact QI).  So this only affects the
    XPCWrappedNative case.

2)  The vast majority of the callers proceed to QI on the pointer anyway, and a
    second addref is cheap; it's the first addref after a CC that can be
    expensive on a cycle-collected object.

Going through the changes one by one:

* In GlobalObject::GetAsSupports, we do have a change that slightly slows down
  precisely in the XPCWrappedNative global case.  That's the message managers
  and the backstagepass.  And this really only affects calls to Web IDL statics
  from those globals.

* In UnwrapArgImpl we're talking about a Web IDL method taking an "external
  interface" type, and the UnwrapReflectorToISupports call is immediately
  followed by QI anyway.

* In UnwrapXPConnectImpl we're talking about the case when we have a
  non-WebIDL-object implementation of a Web IDL interface.  Again, this is the
  message manager globals, for EventTarget.  And we have a QI call immediately
  after the UnwrapReflectorToISupports.

* In the generated HasInstance hook for EventTarget we will be slightly slower
  when the LHS of the instanceof is an XPCWrappedNative.  And not much slower,
  because again there's an immediate QI.

* In InstallXBLField we're never going to have an XPCWrappedNative as thisObj;
  it's always an Element in practice.  So this is no more expensive than before.

* In sandbox's GetPrincipalOrSOP we now have an extra addref.  But it was
  followed by various QIs anyway.

* In XPCConvert::JSValToXPCException we have an extra addref if someone throws
  an XPCWrappedNative, which is fairly unlikely; our actual Exception objects
  are on Web IDL bindings.  Plus we have an immediate QI.

* In xpc::HasInstance we have an extra addred if the LHS of instanceof is an
  XPCWrappedNative.  But, again, there's an immediated QI after the
  UnwrapReflectorToISupports.

* In xpcJSWeakReference::Init we are likely doing an extra addref, but again
  immediately followed by QI.

I think it's worth making this change just to remove the footgun and that the
perf impact, if any, is pretty minimal.
2017-07-10 16:05:26 -04:00
Boris Zbarsky cdd8fe10d4 Bug 1371259 part 4. Stop using UnwrapArg to unwrap this values. r=peterv 2017-07-10 16:05:25 -04:00
Boris Zbarsky 5c76874a46 Bug 1371259 part 3. Change UnwrapObject<> and the UNWRAP_OBJECT macro to allow passing in mutable object or value handles for the thing being unwrapped, and do so at various callsites. r=peterv
I did audit all UNWRAP_OBJECT callers to make sure that the lifetimes of all the
temporary Rooted or the RefPtrs they unwrap into are long enough.
2017-07-10 16:05:24 -04:00
Ting-Yu Chou 2a8c9b7ffd Bug 1348099 part 1 - Binary search property id when resolve DOM Xrays own property. r=bz
Currently we resolve a property by iterating every prefable and check whether it
is enabled.  If it is, we linear search the ids that it manages.  This patch
changes that to binary searching to find whether the id being resolved is
present first, and checking whether its prefable is enabled only when we find
it.  This improves the performance of property resolution, especially when the
property is not present.

The patch stores all the property ids a NativePropertiesN owns in a single array
of PropertyInfo structs.  Each struct contains an id and the information needed
to find the corresponding Prefable for the enabled check, as well as the
information needed to find the correct property descriptor in the Prefable.  We
also store an array of indices into the PropertyInfo array, sorted by bits of
the corresponding jsid.  Given a jsid, this allows us to binary search for the
index of the corresponding PropertyInfo, if any.  The index array requires 2
bytes for each property, which is ~20k across all our bindings.  The extra
information stored in each PropertyInfo requires 4 bytes for each property,
which is about 40k across all our bindings in 32-bit builds, or 80k in 64-bit
builds due to alignment requirements on PropertyInfo.  However we save a bit of
memory from changing NativePropertiesN's trios to duos.

The array of unsorted ids is kept because XrayOwnPropertyKeys() includes only
properties that are enabled.  Without it, we will need to check every single
property to know whether its prefable is enabled or not, which is inefficient.

With this patch, initializing property ids takes longer because of the sorting.
I measured also insertion sort because I thought the ids should be nearly sorted
as they are generated sequentially at run time, but that's not the case and
NS_QuickSort() runs faster.

MozReview-Commit-ID: Lc4Z1ui3t0o

--HG--
extra : rebase_source : 314efe467a14428c57f90af2ecc0ec5c47a31993
2017-06-12 12:13:38 +08:00
Jan de Mooij bf6aed7a06 Bug 1370608 part 3 - Use JS_NewEnumerateStandardClasses outside js/src. r=bz 2017-06-14 10:39:11 +02:00
Jan de Mooij 83f290de99 Bug 1370608 part 1 - Move newEnumerate hook from ObjectOps to ClassOps. r=evilpie,bz 2017-06-14 10:37:44 +02:00
Boris Zbarsky 2f1f31e6d0 Bug 1370640. Get rid of ProtoAndIfaceCache::EntrySlotIfExists. r=peterv 2017-06-07 12:56:27 -04:00
Andrea Marchesini 31b48170ed Bug 1368296 - Renaming WorkerProxyToMainThreadRunnable::RunBackOnWorkerThread to RunBackOnWorkerThreadForCleanup and improving the description for this method, r=asuth 2017-06-02 11:05:27 +02:00
Edgar Chen be79c5bdce Bug 1359346 - Implement custom element state; r=wchen
https://dom.spec.whatwg.org/#concept-element-custom-element-state

MozReview-Commit-ID: TpGVfTEXPj

--HG--
extra : rebase_source : 26c65a4c83eb4f3c0ccb60a3598336c4afcb0247
2016-12-28 11:43:29 +08:00
Jan de Mooij f480e9ecdf Bug 1237504 - Refactor proxy slot layout to allow proxies to have more than 2 slots. r=bz,jonco
The patch makes the following proxy changes:

* The number of slots in ProxyValueArray is now dynamic and depends on the number of reserved slots we get from the Class.
* "Extra slots" was renamed to "Reserved slots" to make this clearer.
* All proxy Classes now have 2 reserved slots, but it should be easy to change that for proxy Classes that need more than 2 slots.
* Proxies now store a pointer to these slots and this means GetReservedSlot and SetReservedSlot can be used on proxies as well. We no longer need GetReservedOrProxyPrivateSlot and SetReservedOrProxyPrivateSlot.

And some changes to make DOM Proxies work with this:

* We now store the C++ object in the first reserved slot (DOM_OBJECT_SLOT) instead of in the proxy's private slot. This is pretty nice because it matches what we do for non-proxy DOM objects.
* We now store the expando in the proxy's private slot so I removed GetDOMProxyExpandoSlot and changed the IC code to get the expando from the private slot instead.
2017-04-28 14:12:28 +02:00
John Dai b32e4c240b Bug 1309147 - Part 3: Implement the support for CEReactions in Codegen. r=bz
MozReview-Commit-ID: F1mxKzlru9s

--HG--
extra : rebase_source : a5e52ef2f3168028dec2c3186e857941953ad517
extra : histedit_source : 2336479daf177cb7ca55ee517c8317852bed09ef
2017-03-08 17:11:48 +08:00
Jan de Mooij 76f56574e3 Bug 1342439 part 1 - Replace macros to check for overrecursion with functions. r=luke 2017-02-25 16:07:56 +01:00
Jessica Jong cf17189117 Bug 1340086 - Remove uses of AnimationsPaused() since it is always false after bug 1316330. r=mrbkap 2017-02-22 01:00:00 -05:00
Boris Zbarsky 2816ec4748 Bug 1339540 part 2. Move the three ErrorResult-internal NS_ERROR_DOM_* values over to the ErrorResult error module. r=smaug 2017-02-15 00:02:35 -05:00
Boris Zbarsky a449ccb8fa Bug 1333045. Update Location object properties to current spec. r=qdot
Specifically, three changes:

1) valueOf should be non-enumerable.
2) valueOf should be === to Object.prototype.valueOf.
3) There should be no toJSON.

The tests come directly from https://github.com/w3c/web-platform-tests/pull/4623
so not much need to review them.
2017-02-15 00:01:48 -05:00
Boris Zbarsky 90896220ac Bug 1330699 part 11. Add ConvertJSValueTo*String functions that just take a value and hand out a string, without extra complications. r=qdot 2017-02-15 00:01:37 -05:00
Andrea Marchesini 16bc4a8d06 Bug 1334564 - Deprecate URL.createObjectURL(mediastream), r=smaug, r=rjesup 2017-02-07 08:58:35 +01:00
Boris Zbarsky da79ef55fe Bug 1335368 part 8. Stop using IsCallerChrome in UnwrapArgImpl. r=bholley 2017-02-01 15:43:37 -05:00
Boris Zbarsky 39d50c2647 Bug 1332713 part 4. Make Promise-returning getters return a rejected Promise on exception instead of throwing. r=qdot 2017-01-27 18:53:37 -05:00
Yury Delendik 994e1a0538 Bug 1333796 - Set descriptor value as undefined in XrayResolveAttribute. r=evilpie
When property getter is specified the desc's value must the set to undefined --
the desc can be re-used by a caller, so it must be done to preserve this
PropertyDescriptor invariant. We also do this in NativeGetOwnPropertyDescriptor.

MozReview-Commit-ID: 39MCwplbzL3

--HG--
extra : rebase_source : c39e3c6808bed3bcb8a1aa9a8194a89e58338a55
2017-01-25 16:15:09 -06:00
Edgar Chen 881cbd80bd Bug 1274159 - Part 2-2: Support HTMLConstructor WebIDL extended attribute for custom elements; r=bz,wchen
MozReview-Commit-ID: 6egmavfTmFT
2016-11-17 23:31:50 +08:00
Till Schneidereit 95b8398292 Bug 1322920 - Remove DOM Promise implementation. r=bz
MozReview-Commit-ID: 1zzd0x2LNNb
2016-12-14 17:11:48 +01:00
Sebastian Hengst 5e1b29b9c0 Backed out changeset f2a5fc3e8c4e (bug 1274159) 2016-12-14 13:27:22 +01:00
Edgar Chen da0139302c Bug 1274159 - Part 2-2: Support HTMLConstructor WebIDL extended attribute for custom elements; r=bz,wchen
MozReview-Commit-ID: 6egmavfTmFT

--HG--
extra : rebase_source : 07436a4b8dfc1960f0cc24b67b8cc5d1e2ffd5cd
2016-11-17 23:31:50 +08:00
Boris Zbarsky d9af26b7e0 Bug 1321879 part 1. Add an API on GlobalObject to get the caller type, for use in things like WebIDL constructors. r=bholley 2016-12-06 23:41:52 -10:00
Tomislav Jurin 348bfffc19 Bug 1296189 - Replace NS_RUNTIMEABORT("some string literal message") with MOZ_CRASH(). r=froydnj 2016-12-02 13:46:53 -08:00
Andrea Marchesini 8524257019 Bug 1290021 - Implement a prototype version of Houdini "Worklets Level 1" spec - part 2 - WorkletGlobalScope, r=smaug 2016-11-06 09:54:29 +01:00
Boris Zbarsky 1ef30fd1e4 Bug 1021289 another followup. Make sure that we don't leave an uninitialized opresult when deleting things on DOM objects via Xrays. r=bustage and CLOSED TREE 2016-11-04 15:58:32 -04:00
Boris Zbarsky 598f3f4180 Bug 1021289 part 4. Implement support for WebIDL deleters over Xrays. r=peterv 2016-11-04 12:41:26 -04:00
Ben Kelly 0983850a63 Bug 1303167 P6 Rename new suspend and freeze methods to final names. r=smaug 2016-10-26 10:20:16 -07:00
Ben Kelly bf0ca72f77 Bug 1303167 P2 Use new window suspend and freeze methods. r=smaug
* * *
Bug 1303167 P2 interdiff 0001 Review feedback
2016-10-26 10:20:15 -07:00
Boris Zbarsky 13514334ba Bug 946906 part 8. When getting a cacheable property off a DOM Xray, cache it on the Xray's expando object. r=bholley 2016-10-10 18:16:26 -04:00
Boris Zbarsky 8070de70a2 Bug 946906 part 5. Use the codegenned JSClass, if available, when creating Xray expando objects. r=bholley 2016-10-10 18:16:26 -04:00
Boris Zbarsky 7f2945874f Bug 946906 part 3. Create a macro for declaring Xray expando classes, and move the default Xray expand class definition to bindings code. r=bholley 2016-10-10 18:16:25 -04:00
Andrea Marchesini 4077c84f75 Bug 1306222 - Introducing GlobalObject::GetSubjectPrincipal, r=ehsan 2016-09-30 19:54:13 +02:00
Tooru Fujisawa 64346ea2e2 Bug 1289050 - Part 11: Use UTF8 variant of JS_ReportErrorNumberVA. r=jwalden 2016-08-14 20:39:30 +09:00
Tooru Fujisawa 6d493d48ec Bug 1289050 - Part 1: Use ASCII variant of JS_ReportError in simple case. r=jwalden 2016-08-14 20:39:28 +09:00
Boris Zbarsky 7afde49b04 Bug 1096267. Stop calling into the nsIInputStream overload of XMLHttpRequest.send() if a random object is passed in (except in chrome code, where we will keep doing that). r=smaug 2016-09-22 16:58:37 +01:00
Tom Schuster 55a65363a9 Bug 1299321 - Make DOM/Xray handle string values in JSPropertySpec. r=peterv 2016-09-02 18:39:50 +02:00
Kan-Ru Chen b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
Igor 175543fda8 Bug 1293384 - Part 2: Rename Snprintf.h header to Sprintf.h. r=froydnj 2016-08-14 23:43:21 -07:00
Igor a57972337d Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj 2016-08-14 23:44:00 -07:00
Jan de Mooij 5149714d22 Bug 1292892 part 6 - Remove nsContentUtils::RootingCx. r=bz 2016-08-11 14:39:23 +02:00
Jan de Mooij 0ad12515f4 Bug 1292892 part 1 - Stop using JSRuntime outside SpiderMonkey. r=bz,terrence,fitzgen,kanru 2016-08-11 14:39:22 +02:00
Boris Zbarsky d7821950f4 Bug 1278583 part 5. Switch DOM code from using hasInstance class hooks to using Symbol.hasInstance. r=peterv 2016-08-03 18:32:07 -07:00
Boris Zbarsky ba5962ed70 Bug 1278583 part 4. Rip out the now-unused construct hook holder bits in bindings. r=peterv 2016-08-03 18:32:06 -07:00
Boris Zbarsky ab204ba73e Bug 1278583 part 3. Make static stuff (static attributes, methods, constants) actually work on globals. r=peterv 2016-08-03 18:32:06 -07:00
Tom Schuster 473d3dc22d Bug 1197324 - Fix new warnings. r=froydnj 2016-08-03 14:37:31 +02:00
Andrew McCreight e806f57820 Bug 1289136 - Fifth argument to XPCConvert::NativeInterface2JSObject() is always null. r=gabor 2016-07-27 10:11:40 -07:00
Boris Zbarsky 8e34004cf1 Bug 1288791 part 1. Rename the GetParentObject template bits to make it clearer what they're really doing: finding the associated global for an object's native. r=bkelly 2016-07-27 11:05:36 -04:00
Jeff Walden 9251e2a1da Bug 1285649 - Replace an ellipsis function, whose last non-ellipsis argument was subject to integer promotions, with a variadic template function so as not to invoke C++ undefined behavior, because that would be Bad. r=froydnj 2016-07-20 15:06:48 -07:00
Jeff Walden d6391c60ea Backed out changeset 1a2627378a0d, didn't tag the reviewer correctly. 2016-07-26 11:12:21 -07:00
Jeff Walden b0edcf1fb1 Bug 1285649 - Replace an ellipsis function, whose last non-ellipsis argument was subject to integer promotions, with a variadic template function so as not to invoke C++ undefined behavior, because that would be Bad. NOT REVIEWED YET
--HG--
extra : rebase_source : 4b2fe5fbf7baaf599026f916e8969862c053a64c
2016-07-20 15:06:48 -07:00
Carsten "Tomcat" Book a0992595d6 merge mozilla-inbound to mozilla-central a=merge 2016-07-17 10:08:08 +02:00
Boris Zbarsky c100c511bf Bug 933378 part 4. Change the ErrorResult destructor to suppress the exception, after asserting that it's already suppressed. r=bkelly 2016-07-15 22:35:13 -04:00
Boris Zbarsky e3b8194f3f Bug 933378 part 1. Introduce a TErrorResult class that will serve as a base class for various ErrorResult-like subclasses. No actual behavior changes so far. r=bkelly 2016-07-15 22:35:13 -04:00
Emilio Cobos Álvarez 12929ea07e Bug 1224664 - Assert if an ErrorResult is accessed on a thread different than the one it's created on, r=khuey 2016-07-15 22:35:13 -04:00
Carsten "Tomcat" Book 255d05f484 Backed out changeset 03362dd7616d (bug 1224664) 2016-07-16 10:03:12 +02:00
Carsten "Tomcat" Book 2abd5d3f18 Backed out changeset dd2d38b7c16b (bug 933378) 2016-07-16 10:03:11 +02:00
Carsten "Tomcat" Book dfb4a51bab Backed out changeset ed38780a242c (bug 933378) 2016-07-16 10:03:08 +02:00
Boris Zbarsky a522fa79b7 Bug 933378 part 4. Change the ErrorResult destructor to suppress the exception, after asserting that it's already suppressed. r=bkelly 2016-07-15 22:35:13 -04:00
Boris Zbarsky 4e44fce24b Bug 933378 part 1. Introduce a TErrorResult class that will serve as a base class for various ErrorResult-like subclasses. No actual behavior changes so far. r=bkelly 2016-07-15 22:35:13 -04:00
Emilio Cobos Álvarez c5ce5bdb84 Bug 1224664 - Assert if an ErrorResult is accessed on a thread different than the one it's created on, r=khuey 2016-07-15 22:35:13 -04:00
Alexandre Lissy 6798f02654 Bug 1286530 - Clean AvailableIn, CheckAnyPermissions and CheckAllPermissions from WebIDL r=bz,fabrice
MozReview-Commit-ID: 6EQfBM09xUE

--HG--
rename : dom/contacts/tests/test_contacts_cache.xul => dom/contacts/tests/test_contacts_a_cache.xul
rename : dom/contacts/tests/test_contacts_shutdown.xul => dom/contacts/tests/test_contacts_a_shutdown.xul
rename : dom/contacts/tests/test_contacts_upgrade.xul => dom/contacts/tests/test_contacts_a_upgrade.xul
rename : dom/mobilemessage/tests/mochitest/mochitest.ini => dom/mobilemessage/tests/mochitest/chrome.ini
extra : rebase_source : 5f708f2a927fafff66626367ef07080785ba9f55
2016-04-21 15:48:59 +02:00
Boris Zbarsky efc4dcf284 Bug 1275315 part 2. Use the new Realm getters in binding code. r=peterv 2016-07-09 00:19:52 -04:00
Boris Zbarsky 97b0a16147 Bug 1282150 part 4. Have just one way of getting the rooting JSContext, and call it nsContentUtils::RootingCx(). r=bholley 2016-07-07 20:08:26 -04:00
Boris Zbarsky d208b0de7a Bug 1282150 part 3. Add a way to get the JSRuntime for the thread, and use it in various places for rooting. r=bholley 2016-07-07 20:08:26 -04:00
Boris Zbarsky e990418707 Bug 1282150 part 2. Get rid of GetDefaultJSContextForThread. r=bholley 2016-07-07 20:08:26 -04:00
Andrea Marchesini 43868a9da7 Bug 1282366 - Improve WorkerHolder use in Runnables, r=khuey 2016-07-04 08:19:10 +02:00
Andrea Marchesini aac2306f2c Bug 1269154 - Get rid of WorkerFeature: WorkerHolder, r=khuey
--HG--
rename : dom/cache/Feature.cpp => dom/cache/CacheWorkerHolder.cpp
rename : dom/cache/Feature.h => dom/cache/CacheWorkerHolder.h
rename : dom/workers/WorkerFeature.h => dom/workers/WorkerHolder.h
2016-06-23 10:53:14 +02:00
Carsten "Tomcat" Book 47aeb86e2c Backed out changeset 1c5d78c7ba43 (bug 1269154) for bustage on a CLOSED TREE
--HG--
rename : dom/cache/CacheWorkerHolder.cpp => dom/cache/Feature.cpp
rename : dom/cache/CacheWorkerHolder.h => dom/cache/Feature.h
rename : dom/workers/WorkerHolder.h => dom/workers/WorkerFeature.h
extra : rebase_source : 49f9e9ce0500ac441fe97878cf9308804926544f
2016-06-23 10:13:54 +02:00
Andrea Marchesini 45087a7970 Bug 1269154 - Get rid of WorkerFeature: WorkerHolder, r=khuey
--HG--
rename : dom/cache/Feature.cpp => dom/cache/CacheWorkerHolder.cpp
rename : dom/cache/Feature.h => dom/cache/CacheWorkerHolder.h
rename : dom/workers/WorkerFeature.h => dom/workers/WorkerHolder.h
2016-06-22 17:24:35 +02:00
Andrea Marchesini 43a1cd6c16 Bug 1277226 - Implement MainThreadWorkerRunnable, r=sicking 2016-06-08 07:12:05 +02:00
Nicholas Nethercote 2fda0872c8 Bug 1267551 (part 10) - Use MOZ_MUST_USE in AutoVectorRooterBase. r=terrence.
This patch fixes numerous unchecked calls.

--HG--
extra : rebase_source : 566f2ca9fba1c8b18fa7ec1753168dbae9cf70d1
2016-06-01 15:49:04 +10:00
Andrea Marchesini e004a6613e Bug 1276887 - webidl "Deprecated" keyword should work in workers, r=smaug 2016-06-01 12:15:34 +02:00
Wes Kocher 043b2fdedd Backed out changeset e5f0088f8ca2 (bug 1276887) for WorkerPrivate assertions CLOSED TREE 2016-05-31 11:31:29 -07:00
Andrea Marchesini e7015103b0 Bug 1276887 - webidl "Deprecated" keyword should work in workers, r=smaug 2016-05-31 17:46:52 +02:00
Bill McCloskey efab9ca4b1 Bug 1276353 - Use UncheckedUnwrap in DOMInstanceOf (r=mrbkap) 2016-05-27 17:22:20 -07:00
Bill McCloskey 291c555f34 Bug 1262671 - void** -> PickleIterator (r=froydnj) 2016-05-27 09:57:38 -07:00
Peter Van der Beken 5c9bb43e9d Bug 1267186 - Split lookup of WebIDL DOM class names from lookup of DOMCI DOM class names. r=bz.
--HG--
extra : rebase_source : 073ec0857b63df3e2ecef43ef3b982f2e1be2d24
2016-05-09 17:08:31 +02:00
Carsten "Tomcat" Book 98f0a3271a Backed out changeset d385df62c0e7 (bug 1267186) for hazard failures 2016-05-09 13:40:01 +02:00
Peter Van der Beken b6c1e074c2 Bug 1267186 - Split lookup of WebIDL DOM class names from lookup of DOMCI DOM class names. r=bz.
--HG--
extra : rebase_source : 324cf124544c0ffe2ad2ceccbed397d5069d1435
2016-03-09 15:48:12 +01:00
Sebastian Hengst faffe478f6 Backed out changeset f9d3ea58c195 (bug 1267186) for static bustage in WebIDLGlobalNameHash.cpp. r=backout 2016-05-06 18:11:03 +02:00
Peter Van der Beken 827ee394ba Bug 1267186 - Split lookup of WebIDL DOM class names from lookup of DOMCI DOM class names. r=bz.
--HG--
extra : rebase_source : 5578057666186f58e434767af84fbfeac0cbdc3c
2016-03-09 15:48:12 +01:00
Boris Zbarsky 2f533f506d Bug 1265770. Don't try to get a prototype for the interface object for an interface that's [NoInterfaceObject], since it's just unnecessary work that can't even be done at all in some cases (e.g. when the parent interface is also [NoInterfaceObject]). r=peterv 2016-04-20 18:04:56 -04:00
Nicholas Nethercote 60dcde7875 Bug 1261723 (part 2) - Separate class ops from js::Class. code=njn,h4writer. r=efaust,bz.
js::Class op are often all null. And when they're not all null, they're often
duplicated among classes. By pulling them out into their own struct, and using a
(possibly null) pointer in js::Class, we can save 114 KiB per process on
64-bit, and half that on 32-bit.
* * *
imported patch separate-ClassOps-2

--HG--
extra : rebase_source : bd751bf247e9491c1966a123dbeffa573657dfb1
2016-04-01 11:00:01 +11:00
Nicholas Nethercote 358a6071d9 Bug 1260653 - Shrink NativeProperties. r=bz.
This patch makes NativeProperties variable-length and reduces static data by
110,336 bytes on 64-bit, and half that on 32-bit.

MozReview-Commit-ID: 2etZ5AnEhgO

--HG--
extra : rebase_source : 6a167b64df7da3c6940114782fe08337f04a694d
2016-03-31 09:57:20 +11:00
Nicholas Nethercote e114b226dc Bug 1259194 (part 4) - Separate js::ObjectOps from js::Class. r=efaust,mrbkap,bz.
js::ObjectOps is often all null. When it's not all null, it's often duplicated
many times among classes. By pulling it out into its own struct, and using a
(possibly null) pointer in js::Class, we can save 208 KiB per process on
64-bit, and half that on 32-bit.

--HG--
extra : rebase_source : 5be8fe45f652392571b8a6d7b63777cbafba6ae4
2016-03-24 07:00:29 +11:00
Boris Zbarsky 4622df74e0 Bug 1104955 part 3. Pass our unscopable names to CreateInterfaceObjects and have it define the right thing on the prototype. r=khuey 2016-03-29 15:50:38 -04:00
Boris Zbarsky 25c4270d09 Bug 1258585. Remove some remaining vestiges of WebIDL quickstubs. r=peterv 2016-03-23 17:46:26 -04:00
Kyle Huey f00a582ac4 Bug 1257389: Use fallible allocation for content-controlled string in bug 1257389. r=bz
--HG--
extra : rebase_source : 904526e9c7ef9a90ac0bb73984af5d95dd8e60fc
2016-03-16 20:04:10 -07:00
Nicholas Nethercote 666b54a97d Bug 1255655 - Const-ify mozilla::dom::ErrorFormatString. r=baku.
--HG--
extra : rebase_source : 0f8d74ff1043835c54d68eb4002d72c2f94921cd
2016-03-11 13:05:10 +11:00
Boris Zbarsky 57fc0e989c Bug 1255709. Simplify the JSContext/GlobalObject handling in ServiceWorkerRegistrationMainThread::GetPushManager a bit. r=bkelly 2016-03-11 16:43:31 -05:00
Kyle Huey 9eea75a6f5 Bug 1252268: If the slow script dialog aborts an interval timer callback, don't schedule it again. r=bz 2016-03-10 01:50:56 -08:00
Morgan Phillips d95ecfa483 Bug 1245877 - Expose error message names via the debugger object; r=jorendorff
--HG--
extra : rebase_source : 87a2c2f682285048be1c57c280f4e3af48b9d524
2016-03-04 12:21:57 -08:00
sakshi 1af0b67296 Bug 1197311 - Remove PR_snprintf calls in dom/ r=froydnj 2016-02-17 14:23:39 -05:00
Boris Zbarsky 38ed0f626b Bug 1249652 part 1. Add a method on ErrorResult to steal an exception, if any, from a JSContext. r=khuey 2016-02-24 10:38:31 -05:00
Boris Zbarsky 3dba4c9b72 Bug 1248719. Fix things so that taking ownership of error reporting on an AutoJSAPI on a worker is OK even if that AutoJSAPI was initialized without an explicit global. r=bholley 2016-02-17 22:56:36 -05:00
Boris Zbarsky b0e7faec5a Bug 1241349 part 3. Add a binding_detail::UnprivilegedJunkScopeOrWorkerGlobal function which returns a global object that can be used for some bindings things. r=bholley 2016-02-10 23:31:33 -05:00
Boris Zbarsky 9f63f6adc2 Bug 1241349 part 2. Restrict generation of ToJSON methods on dictionaries to only dictionaries we can safely stringify with JS::ToJSONMaybeSafely. r=bholley 2016-02-10 23:31:33 -05:00
Boris Zbarsky 24566ec012 Bug 1243001 part 7. Stop wrappercaching dom::Promise when SPIDERMONKEY_PROMISE is defined. r=peterv
nsWrapperCache expects the object it stores to have an ObjectMoved op that will
notify the wrapper cache when the object is moved.  SpiderMonkey promises don't
have a way to do this.

The XPCConvert changes are needed to allow code that passes around Promise
objects as nsISupports to continue working instead of ending up with
double-wrapped nsISupports (XPCWrappedNative for an nsISupports XPCWrappedJS)
around the SpiderMonkey Promise.
2016-02-09 17:40:31 -05:00
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Tom Schuster 4d6aaf2f25 Bug 1242214 - Rename JSPropertyDescriptor JS::PropertyDescriptor everywhere else. r=smaug 2016-01-28 11:28:04 +01:00
Tooru Fujisawa 88d3b3ecc6 Bug 1180290 - Part 5: Remove getter/setter variant for ThrowInvalidThis message. r=bz 2016-01-06 17:54:00 +09:00
Boris Zbarsky e4fd35820f Bug 1048695 part 2. Make interface members not be exposed based on their nonExposedGlobals. r=peterv 2015-12-01 12:02:36 -05:00
Boris Zbarsky 64186b5b76 Bug 1170760 part 2. Pass in the 'this' value to Promise static methods. r=peterv 2015-11-25 15:48:08 -05:00
Phil Ringnalda 53745073f0 Back out 13 changesets (bug 1170760) for Gu bustage in homescreen/test/unit/apps_test.js
CLOSED TREE

Backed out changeset 5d84599a8846 (bug 1170760)
Backed out changeset 6104fe33d5f5 (bug 1170760)
Backed out changeset 1dfb229da01d (bug 1170760)
Backed out changeset f380faddfdd8 (bug 1170760)
Backed out changeset 541831dc6b57 (bug 1170760)
Backed out changeset 6a5b7dfab882 (bug 1170760)
Backed out changeset ee514a256922 (bug 1170760)
Backed out changeset 3c2c1acc34ee (bug 1170760)
Backed out changeset dc2a7f5dc5d6 (bug 1170760)
Backed out changeset b312a08fbab5 (bug 1170760)
Backed out changeset cb6aba9b8497 (bug 1170760)
Backed out changeset 39e4f5b1ba40 (bug 1170760)
Backed out changeset 7d79cce3630a (bug 1170760)
2015-11-25 21:02:55 -08:00
Boris Zbarsky b4cbee7794 Bug 1170760 part 2. Pass in the 'this' value to Promise static methods. r=peterv 2015-11-25 15:48:08 -05:00
Sunny Sidhu 268b906ced Bug 1225782 - Removes GlobalPropertiesAreOwn(). r=bz 2015-11-20 10:00:00 +01:00
Boris Zbarsky 71b052b436 Bug 1224007 part 6. Change MaybeSetPendingException to set the ErrorResult state to "not failed", just like SuppressException and StealNSResult already do, and assert in the destructor that the ErrorResult is not Failed().
This is not quite as strong as being able to assert that all codepaths that might
lead to failure call one of the above methods, but being able to assert that
would involve a lot of extra noise at callsites.  Or at least changing the
signature of StealNSResult to use an outparam and return a boolean indicating
whether the ErrorResult was failure or not, or something, so StealNSResult
can be usefully called on successful ErrorResults too.
2015-11-20 16:29:41 -05:00
Boris Zbarsky c3bc1cdc40 Bug 1224007 part 5. Get rid of ErrorResult::StealJSException. r=peterv 2015-11-20 16:29:41 -05:00
Boris Zbarsky 8ab5390043 Bug 1224007 part 2. Make the various ErrorResult::Report* methods private, so consumers all go through MaybeSetPendingException and rename them to more clearly indicate what they're actually doing. r=peterv 2015-11-20 16:29:41 -05:00
Boris Zbarsky c19412a7ac Bug 1224007 part 1. Rename ThrowMethodFailed to MaybeSetPendingException and make it an ErrorResult instance method. r=peterv 2015-11-20 16:29:40 -05:00
Ben Kelly 7f326cef7c Bug 1225219 Implement ErrorResult::CloneTo(). r=bz 2015-11-18 11:07:58 -08:00
Wes Kocher f1dac52970 Backed out changeset cc92635ec29a (bug 1225219) for build bustage CLOSED TREE
--HG--
extra : commitid : 1lUK2KD78dX
2015-11-18 09:52:19 -08:00
Ben Kelly 442a013f24 Bug 1225219 Implement ErrorResult::CloneTo(). r=bz 2015-11-18 08:50:28 -08:00
Boris Zbarsky 2c6c586ca9 Bug 1219749. Add a way to faithfully propagate the "exception is already on JSContext" state through an ErrorResult. r=peterv 2015-11-09 20:47:05 -05:00
Jan de Mooij 73b313f3b4 Bug 1125423 part 6 - Remove nsGlobalWindow::OuterObject and ObjectToOuterObjectValue. r=bz 2015-11-06 19:03:52 +01:00
Jan de Mooij fffc37012e Bug 1125423 part 2 - Rename stopAtOuter argument to *Unwrap functions to stopAtWindowProxy. r=bz 2015-11-06 19:03:52 +01:00
Jan de Mooij a84c33ecb0 Bug 1125423 part 1 - Attach WindowProxies to globals instead of using innerObject/outerObject hooks. r=bz,luke 2015-11-06 19:03:51 +01:00
Boris Zbarsky 7ae3b58eb6 Bug 1039986. Make Function.prototype.toString work on Web IDL interface objects. r=jorendorff,peterv 2015-10-27 16:25:14 -04:00
Andrew McCreight edab757f4e Bug 1218496 - Add MOZ_COUNT_CTOR/DTOR to ErrorResult::Message. r=bz 2015-10-26 14:50:00 +01:00
Jon Coppeard 59be23d316 Bug 930414 - Replace |thisObject| object op with |thisValue| and use if for modules r=shu r=smaug 2015-10-21 10:21:44 +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
Boris Zbarsky c3d471f9c4 Bug 1213289 part 4. Convert to using an enum for tracking our union state. r=bkelly 2015-10-09 16:48:10 -04:00
Boris Zbarsky af065c06f0 Bug 1213289 part 3. Add a way to throw a DOMException with a custom message on ErrorResult. r=bkelly 2015-10-09 16:48:10 -04:00
Boris Zbarsky 9c2bcd09d7 Bug 1213289 part 2. Introduce ErrorResult::ClearUnionData and use it in various places where we're trying to do that. r=bkelly 2015-10-09 16:48:10 -04:00
Martin Thomson 4574e04530 Bug 1155923 - Add Deprecated attribute to interfaces, r=peterv
--HG--
extra : transplant_source : q%B6%21%A22%A6%8Ftg%C8%1D%02%91/%C7%8A%AA%E2%C6g
2015-09-28 11:25:04 -07:00
Carsten "Tomcat" Book 4952084732 Backed out 3 changesets (bug 1155923) for causing test failures in promises-call.html
Backed out changeset 321a932e01a7 (bug 1155923)
Backed out changeset 6ac38acd6ab2 (bug 1155923)
Backed out changeset 2981db92416a (bug 1155923)
2015-09-28 14:02:41 +02:00
Martin Thomson d4f1b7fa44 Bug 1155923 - Add Deprecated attribute to interfaces. r=peterv
--HG--
extra : transplant_source : %E7_%24v%EA%08%AB1%A2%2BPl%AE%85%B9-%A6%D9%FEG
2015-09-24 16:31:47 -07:00
Tom Schuster e3fbb8bc43 Bug 603201 - Change GetProperty receiver argument to Value in the browser. r=smaug 2015-09-18 00:14:41 +02:00
Andrew McCreight 17fe28d40c Bug 1195977, part 8 - Check that ThrowInvalidThis is passing in enough arguments. r=peterv
We have to permit passing in too many arguments because sometimes the
error is MSG_METHOD_THIS_UNWRAPPING_DENIED which only takes one
argument.
2015-09-15 11:47:04 -07:00
Andrew McCreight 4d25fb9ee0 Bug 1195977, part 6 - Inline ErrorResult throw error methods into the header. r=peterv
This is needed to turn these into templates later.
2015-09-15 11:47:04 -07:00
Andrew McCreight 46a8a4fbb4 Bug 1195977, part 5 - Hoist out inner part of ErrorResult::ThrowErrorWithMessage() into a helper. r=peterv
This will enable us to move it to the header later, which is needed to
turn it into a template.
2015-09-15 11:47:04 -07:00
Andrew McCreight 77be143629 Bug 1195977, part 4 - Enforce number of arguments more consistently. r=peterv
The new check in ErrorResult::ReportErrorWithMessage() shouldn't be
needed and is just to protect against the possibility of another way
to construct messages being added.
2015-09-15 11:47:04 -07:00
Andrew McCreight 786ccb5a0e Bug 1195977, part 3 - Add helper for getting the number of error arguments. r=peterv 2015-09-15 11:47:04 -07:00
Andrew McCreight 53e9657f0d Bug 1195977, part 2 - Statically assert that DOM error messages don't have more arguments than the JS engine supports. r=peterv.
This makes it so that we do not need to dynamically enforce this
constraint in ErrorResult::ThrowErrorWithMessage().
2015-09-15 11:47:04 -07:00
Cameron McCormack 57f66406e3 Bug 968923 - part 4 - hook up use counters to WebIDL bindings; r=bz 2015-02-05 12:53:01 -05:00
Boris Zbarsky 57621e1167 Bug 1135961. Implement subclassing of DOM objects. r=peterv 2015-07-31 13:30:55 -04:00
Kan-Ru Chen 5c2f3fc74e Bug 1179718 - Rename CheckPermissions to CheckAnyPermissions. r=bz 2015-07-17 11:07:53 +08:00
Kan-Ru Chen a5886f19c7 Bug 1179718 - Add a CheckAllPermissions extended attribute to WebIDL. r=bz 2015-07-17 11:06:23 +08:00
Birunthan Mohanathas a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Boris Zbarsky 8d3a6f26dd Bug 1180851. Don't make ThrowMethodFailed an inline function, because there's no really good reason to and we might as well save the codesize. r=peterv 2015-07-09 22:51:28 -04:00
Boris Zbarsky d39d28be5c Bug 1180770 part 2. Remove the unused ifaceName/memberName arguments of ThrowMethodFailedWithDetails and rename it to ThrowMethodFailed. r=peterv 2015-07-09 22:51:28 -04:00
Boris Zbarsky afdc22e267 Bug 1180770 part 1. Remove the unused ThrowNotEnoughArgsError. r=peterv 2015-07-09 22:51:28 -04:00
Terrence Cole 620b712967 Bug 1178581 - Interning does not and should not imply infinite lifetime; r=sfink
--HG--
extra : rebase_source : f6fb6b881bffe5af0dfde6a45e9e0c29932c8885
2015-06-30 07:58:31 -07:00
Kyle Machulis c035543458 Bug 1123516 - Implement maplike/setlike in WebIDL Codegen; r=bz 2015-06-29 15:38:53 -07:00
Boris Zbarsky fefbd0cfd7 Bug 1174954 part 3. Remove ReportJSExceptionFromJSImplementation, since it no longer does anything interesting. r=bholley 2015-06-16 16:44:11 -04:00