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

284 Коммитов

Автор SHA1 Сообщение Дата
Peter Van der Beken 395356226a Bug 932322 - Make Window's WebIDL properties be own properties of window. r=bz.
--HG--
extra : rebase_source : b8ce4fedf7fc46b14a1d01663945d1b0e22bdcdd
2013-10-08 18:18:40 +02:00
Ed Morley 339e4d3302 Backed out changeset e697e7dcc321 (bug 932322) 2013-11-01 11:14:30 +00:00
Peter Van der Beken af8c9a9b08 Bug 932322 - Make Window's WebIDL properties be own properties of window. r=bz.
--HG--
extra : rebase_source : 0225f25a61d1bffdae8eac4f82d7fe725a3af2df
2013-10-08 18:18:40 +02:00
Peter Van der Beken a4fe40c32e Bug 932315 - Throw a different error when this-unwrapping fails for security reasons. r=bz.
--HG--
extra : rebase_source : a92639be64d8d591ea4c97955bc04e6047e0d027
2013-10-16 18:11:25 +02:00
Brian Hackett 98ec75f9e6 Bug 930048 - Remove need to read objects directly when optimizing singleton accesses, r=jandem. 2013-10-29 16:10:59 -06:00
Birunthan Mohanathas 98f3b9652a Bug 784739 - Switch from NULL to nullptr in dom/ (1/2); r=ehsan 2013-10-28 10:04:12 -04:00
Tom Schuster 127ebf3721 Bug 930782 - Handlify JS_WrapValue. r=terrence 2013-10-26 18:19:05 +02:00
Steve Fink 1b7c5fcec0 Bug 925916 - Random minor code cleanups, r=smaug 2013-10-15 15:34:13 -07:00
Steve Fink a484573cac Bug 925916 - Add some handles to dom/bindings, r=bz
--HG--
extra : rebase_source : 2443d2b988dea432c4961e8b042b0288e1dc7016
2013-10-11 22:02:39 -07:00
Tom Schuster 1faae39271 Bug 8844105 - Handlify JS_WrapObject. r=terrence 2013-10-15 20:02:23 -04:00
Boris Zbarsky a22f746363 Bug 918011 part 1. Move RootedDictionary into its own header. r=smaug
--HG--
rename : dom/bindings/BindingUtils.h => dom/bindings/RootedDictionary.h
2013-09-26 00:04:59 -04:00
Boris Zbarsky db4d6d4736 Bug 919603 part 2. Change this-handling in codegen to only do the special global object stuff on interfaces where it might matter. r=peterv 2013-09-25 14:38:30 -04:00
Ryan VanderMeulen b2c316d8b2 Backed out 5 changesets (bug 905493, bug 920125, bug 919603) for mochitest orange on a CLOSED TREE.
Backed out changeset ccef656b2973 (bug 919603)
Backed out changeset 4b29ce0b2fff (bug 919603)
Backed out changeset b0a051ec55b7 (bug 919603)
Backed out changeset baa9a774aad1 (bug 920125)
Backed out changeset e03276bf4eaa (bug 905493)
2013-09-25 18:22:33 -04:00
Boris Zbarsky d7f8928b36 Bug 919603 part 2. Change this-handling in codegen to only do the special global object stuff on interfaces where it might matter. r=peterv 2013-09-25 14:38:30 -04:00
Peter Van der Beken d0b24c7ccf Bug 920196 - Make QueryInterface opt-in for WebIDL interfaces. r=bz.
--HG--
extra : rebase_source : 4cf7f9dc90f234dd663da05f27c0dc9484c7c0e1
2013-09-24 21:37:53 +02:00
Benoit Jacob 229d2760cd Bug 913847 - Include MainThreadUtils.h instead of nsThreadUtils.h - r=ehsan 2013-09-19 09:54:42 -04:00
Wes Kocher 0b90687d1e Backed out changeset 040522aacba4 (bug 913847) 2013-09-18 17:18:56 -07:00
Benoit Jacob b7afc93adc Bug 913852 - BindingUtils.h doesn't need to include <algorithm> - r=bz 2013-09-18 18:50:32 -04:00
Benoit Jacob 5526ea7b69 Bug 913847 - Include MainThreadUtils.h instead of nsThreadUtils.h - r=ehsan 2013-09-18 18:50:32 -04:00
Boris Zbarsky 7f0a897989 Bug 915419. Add support for "object" types in owning unions (so union return values and unions in dictionaries and sequences. r=dzbarsky, smaug
Adds RootedUnion and NullableRootedUnion structs that are used on the
stack for union return values when the union needs rooting.  It also
adds a TraceUnion method on union return values, which is called by
(Nullable)RootedUnion or by dictionary tracing.  TraceUnion traces
typed array and object members of unions (the only things unions can
contain so far that might need tracing).  Union return values are
changed to store raw JSObject* or typed array structs instead of
Rooted versions of both; the tracing is now handled via TraceUnion.

The wrapping code for dictionary arguments to constructors is fixed to
actually work.  This required adding GetAs* methods to union return
values that return references to the internal data.

The SetToObject method is adjusted to actually work for union return
value structs and not assume it's being generated for a
union-conversion struct, and we now generate SetToObject methods as
needed for union return values.
2013-09-12 22:34:16 -04:00
Dan Gohman a50084b38d Bug 910823 - Constify static js::Class/JSClass instances. r=waldo 2013-09-11 05:49:05 -07:00
Olli Pettay f5c09ae0aa Bug 910910 - Enable Event ctors in workers, r=khuey
--HG--
extra : rebase_source : 983d01d13aa66a8499350a4960b5913b22c9783a
2013-09-10 21:27:32 +03:00
Ms2ger fd34744914 Bug 913923 - Part b: Move OwningNonNull into its own header; r=dzbarsky
--HG--
rename : dom/bindings/BindingUtils.h => dom/bindings/OwningNonNull.h
2013-09-10 09:03:37 +02:00
Ms2ger 31f1d9f15c Bug 913923 - Part a: Move UnionMember into its own header; r=dzbarsky 2013-09-10 09:03:37 +02:00
Kyle Huey bf7d0aa16a Bug 911258: Part 5 - Use the unified exception handling mechanism on workers. r=bz 2013-09-08 20:29:21 -07:00
Kyle Huey 888aba875b Bug 910937: Remove xpc_UnmarkGrayObject and use JSAPI directly. r=mccr8 2013-09-08 20:28:48 -07:00
Ehsan Akhgari 82b9523028 Bug 913531 - Remove the unnecessary #includes from nsIXPConnect.idl; r=bholley 2013-09-06 13:50:24 -04:00
Peter Van der Beken 19de89f34e Bug 905392 - Need way to throw web-console-visible exception-message from JS-implemented webidl object - bustage fix on a CLOSED TREE. 2013-09-06 15:27:25 +02:00
Peter Van der Beken b174788298 Bug 905392 - Need way to throw web-console-visible exception-message from JS-implemented webidl object. r=bz. 2013-09-03 14:01:53 +02:00
Boris Zbarsky 0931f880af Bug 910795 part 2. Use the new Rebind() setup to avoid creating string copies for variadic string arguments. r=smaug 2013-09-04 16:43:12 -04:00
Boris Zbarsky 9ca8e983b5 Bug 868799 part 3. Use RootedTypedArray in codegen. r=smaug 2013-08-29 00:30:05 -04:00
Andrew McCreight f8bde121bd Bug 904826 - Remove some unneeded nsLayoutStatics calls. r=smaug,bholley,bz 2013-08-27 15:39:02 -07:00
Boris Zbarsky 8955ed2808 Bug 908576 part 3. Get rid of PrototypeIDMap structs. r=smaug 2013-08-23 22:42:41 -04:00
Ms2ger e88cf99a15 Bug 907605 - Remove BindingUtils.h include from PrimitiveConversions.h; r=bz 2013-08-22 08:34:48 +02:00
Trevor Saunders c64e5ea4a3 bug 905418 - get rid of more static constructors in dom/bindings/ r=smaug 2013-08-14 18:04:24 -04:00
Ms2ger 9d023a67df Bug 904110 - Move alignment features out of Util.h into a new header; r=Waldo 2013-08-14 09:00:52 +02:00
Jon Coppeard e133b9b2a9 Bug 903352 - Handlify remaining PropertyDescriptor APIs r=terrence r=bholley r=smaug 2013-08-12 12:09:14 +01:00
Peter Van der Beken ac70c03afa Bug 895758. Make the global scope polluter a proxy. r=bzbarsky 2013-07-09 10:45:13 -04:00
Terrence Cole 09de524f1a Bug 862115 - Use Rooted<JSPropertyDescriptor> in favor of JSPropertyDescriptor::AutoRooter r=terrence r=smaug r=bholley 2013-04-30 10:29:40 -07:00
Nicholas Nethercote d8f824e34e Bug 898914 (part 1) - Remove JSBool.
--HG--
extra : rebase_source : 2d202e0e5005a7f54724b1540481c15cde3ad52e
2013-08-08 15:53:04 -07:00
Boris Zbarsky a91edf5138 Bug 897913 part 2. Allow touching interface objects via an Xray even if the page they're in can't touch them. r=bholley,smaug 2013-08-07 17:40:00 -04:00
Nicholas Nethercote 9624be5713 Bug 901750 - Change return type of |JSNative| from |JSBool| to |bool|. code=nnethercote,jandem. r=luke,bz.
--HG--
extra : rebase_source : 5b3d7cc339af6d93bde078322e25c6e740d1b617
2013-08-02 00:41:57 -07:00
Boris Zbarsky ba2cacb577 Bug 900898 part 4. Support typed arrays inside sequences and variadics. r=smaug 2013-08-05 13:40:02 -04:00
Bill McCloskey 35518f5639 Bug 899804 - Make CPOWs handle instanceof with WebIDL interfaces (r=bz,dvander) 2013-08-01 16:45:17 -07:00
Ehsan Akhgari 2824b29025 Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo
This patch was mostly generated by running the following scripts on the codebase, with some
manual changes made afterwards:

# static_assert.sh
#!/bin/bash
# Command to convert an NSPR integer type to the equivalent standard integer type

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.mm" \) | \
    xargs -n 1 `dirname $0`/assert_replacer.py #sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_STATIC_ASSERT static_assert
hg rev --no-backup mfbt/Assertions.h \
                   media/webrtc/signaling/src/sipcc/core/includes/ccapi.h \
                   modules/libmar/src/mar_private.h \
                   modules/libmar/src/mar.h


# assert_replacer.py
#!/usr/bin/python

import sys
import re

pattern = re.compile(r"\bMOZ_STATIC_ASSERT\b")

def replaceInPlace(fname):
  print fname
  f = open(fname, "rw+")
  lines = f.readlines()
  for i in range(0, len(lines)):
    while True:
      index = re.search(pattern, lines[i])
      if index != None:
        index = index.start()
        lines[i] = lines[i][0:index] + "static_assert" + lines[i][index+len("MOZ_STATIC_ASSERT"):]
        for j in range(i + 1, len(lines)):
          if lines[j].find("                 ", index) == index:
            lines[j] = lines[j][0:index] + lines[j][index+4:]
          else:
            break
      else:
        break
  f.seek(0, 0)
  f.truncate()
  f.write("".join(lines))
  f.close()

argc = len(sys.argv)
for i in range(1, argc):
  replaceInPlace(sys.argv[i])

--HG--
extra : rebase_source : 4b4a4047d82f2c205b9fad8d56dfc3f1afc0b045
2013-07-18 13:59:53 -04:00
Trevor Saunders 6b2dfe7a73 Bug 899368 - remove static constructors added in bug 894448 with some constexpr pixi dust. r=bz 2013-07-30 08:57:28 +09:00
Peter Van der Beken f3d03f59de Bug 894448 part 2 - Remove nativeOwnership = 'nsisupports'. r=bzbarsky 2013-07-04 17:24:59 +02:00
Ms2ger 8609abdb1f Bug 885170 - Remove nsINode::GetClassInfo(); r=peterv 2013-07-24 09:31:06 +02:00
Boris Zbarsky 0314f249cd Bug 895009. Don't pass in NonNull/OwningNonNull arguments to WebIDL binding consumers. r=peterv 2013-07-22 08:15:43 -04:00
Jon Coppeard a0056f5fa0 Bug 888338 - 6 - more browser post barriers r=mccr8 2013-07-23 10:58:27 +01:00
Ryan VanderMeulen 7c21303600 Backed out changesets 0a196c0e9f96 (bug 895974) and 0d8aa14f5ed3 (bug 895009) for causing intermittent Linux32 mochitest-1 asserts on a CLOSED TREE. 2013-07-22 18:18:17 -04:00
Boris Zbarsky cebee2f230 Bug 895009. Don't pass in NonNull/OwningNonNull arguments to WebIDL binding consumers. r=peterv 2013-07-22 08:15:43 -04:00
Nicholas Nethercote 9cdaaf7828 Bug 887558 (part 2) - Move various functions into ProxyObject and FunctionProxyObject. r=jorendorff.
--HG--
extra : rebase_source : 14402b9ab7eda3389eb1b812ee961e46067b5b1d
2013-06-20 22:39:22 -07:00
Nicholas Nethercote ff86dae788 Bug 887558 (part 1) - Introduce ProxyObject and some sub-classes. r=jorendorff.
--HG--
extra : rebase_source : 33ed2aff35acbe4de8891a9fb34c60e7a314d9c8
2013-06-20 21:27:28 -07:00
Boris Zbarsky 4ee1caf801 Bug 891585. Don't JS_WrapValue same-compartment typed array return values in bindings code (e.g. ImageData.data). r=peterv 2013-07-11 11:58:29 -04:00
Kyle Huey ab927a2cc9 Bug 885866: Separate deferred finalization from XPConnect so we can use it off the main thread. r=mccr8, peterv, bsmedberg, jorendorff 2013-07-09 07:28:15 -07:00
Ehsan Akhgari 7721ae648c Bug 889016 - Part 1: Add an API to report a not-enough-arguments error in Web IDL bindings; r=bzbarsky 2013-07-04 09:24:49 -04:00
Jon Coppeard ef8bb39711 Bug 885310 - 1 Rename JSHandleFoo in the browser r=bz 2013-06-21 14:12:46 +01:00
Andrea Marchesini 91c64da847 Bug 841442 - Move HTMLFormElement to WebIDL, r=bz 2013-06-19 10:24:37 -04:00
Jon Coppeard b4a1d2128a Bug 884371 - Remove JSMutableHandleXXX from the browser r=bz 2013-06-19 11:32:27 +01:00
Boris Zbarsky c23542725a Bug 883358 part 2. Use the new information in bindings error reporting. r=smaug 2013-06-17 16:31:13 -04:00
Ryan VanderMeulen 71c9853712 Backed out 3 changesets (bug 883358) for Android mochitest-3 failures on a CLOSED TREE.
Backed out changeset 84b35dd1879d (bug 883358)
Backed out changeset b5e6522257cb (bug 883358)
Backed out changeset 757a3f2e5de6 (bug 883358)
2013-06-17 19:51:12 -04:00
Boris Zbarsky 4fea0995d3 Bug 883358 part 2. Use the new information in bindings error reporting. r=smaug 2013-06-17 16:31:13 -04:00
Boris Zbarsky ad494b55cc Bug 882653 part 4. Improve the WebIDL binding error reporting for the not-sequence, not-callable, not-dictionary, not-date, and invalid-enum-value cases. r=smaug 2013-06-17 13:07:03 -04:00
Boris Zbarsky f33f6d5496 Bug 882653 part 1. Improve error reporting for bogus this objects in WebIDL bindings. r=smaug 2013-06-17 13:07:03 -04:00
Peter Van der Beken e246f74b5d Bug 851465 - Remove slim wrappers - remove various slim wrapper code and checks. r=bholley. 2013-04-19 21:57:18 +02:00
James Kitchener b71cfc0ec2 Bug 796850 - Implement Code Generation for Bytestring in WebIDL bindings r=bz 2013-06-13 01:18:35 -04:00
Boris Zbarsky 7a3587f2d2 Bug 877281 part 6. Replace ${jsvalPtr} with a MutableHandle ${jsvalHandle}. r=peterv
It's a little unfortunate that we need both ${jsvalHandle} and
${jsvalRef}, but the only other option is to consistently have a
MutableHandle in this code.  If the thing we have to work with is a
Rooted, that means doing JS::MutableHandle<JS::Value>(&myRooted) as
the thing to substitute for ${jsvalHandle}.  Just using "&myRooted"
doesn't work, because things like "&myRooted.set()" or
"&myRooted.address()" fail, even if parenthesized as
"(&myRooted).set()", because &myRooted is actually a Rooted*, not a
MutableHandle.

We could go the JS::MutableHandle<JS::Value>(&myRooted) route if
desired; it would primarily uglify dictionary and sequence to-js
conversions.  With the setup in this patch, ideally it looks pretty
idiomatic except for the use of .set() instead of operator= on Rooted.
2013-06-07 22:45:46 -04:00
Ms2ger 94aefffcb2 Bug 876602 - Move JS-implemented webidl construction code into C++; r=bz 2013-06-01 08:56:23 +02:00
Ms2ger 6452f0c3f0 Bug 876604 - Outparamdel UnwrapDOMObjectToISupports; r=bz 2013-06-01 08:56:02 +02:00
Peter Van der Beken 3402cab97c Bug 874321 - Fix setting of expandos on Xrays for DOM bindings with named properties. r=bz.
--HG--
extra : rebase_source : 697545417d27696de05c0f22987e4cb187d226cd
2013-05-29 11:38:57 +02:00
Kyle Huey 0d78767303 Bug 876555: Avoid including xpcprivate.h in most generated dom binding code. r=bz 2013-05-30 11:15:31 +08:00
Boris Zbarsky 3ed0c22089 Bug 875622 part 2. Use handles in ConvertJSValueToString. r=smaug 2013-05-24 09:16:00 -04:00
Boris Zbarsky cb039702b6 Bug 865951. If the return value of a JS-implemented method or attribute is a JS-implemented interface and the returned object is not a DOM object, automatically wrap it up in an instance of that interface. r=mccr8
This does not invoke __init on the chrome object, since there are no
arguments to do it with anyway.  It also doesn't invoke init(), so
don't do this in cases in which the chrome-side object will need to
know its window.
2013-05-20 13:47:08 -04:00
Boris Zbarsky 43f774459d Bug 868312 finale: finish rooting dom/ code. r=smaug 2013-05-17 21:48:25 -04:00
Boris Zbarsky 6b527597e0 Bug 873337. Change the order of the decl and holder in js-to-native conversions to clean up the code some. Now the holder always comes after the decl. r=smaug 2013-05-17 21:48:25 -04:00
Nathan Froyd 0b82017ee5 Bug 873479 - fix BindingUtils.h to compile with GCC 4.4 in non-C++0x mode; r=bz 2013-05-17 10:44:19 -04:00
Boris Zbarsky 90dcaa61d5 Bug 868715 part 8. Add tracing to WebIDL sequence return values. r=peterv 2013-05-16 12:36:56 -04:00
Boris Zbarsky 79374d2426 Bug 868715 part 7. Add tracing to dictionaries. r=peterv 2013-05-16 12:36:55 -04:00
Boris Zbarsky ac6b11ed0d Bug 868715 part 6. Add the ability to trace sequence arguments. r=peterv 2013-05-16 12:36:55 -04:00
Boris Zbarsky 68c0f91dfe Bug 868715 part 4. Use on-stack Rooted<JSObject*> for 'object' arguments in WebIDL bindings. r=peterv 2013-05-16 12:36:55 -04:00
Boris Zbarsky 42f794f96b Bug 871177. Fix rooting hazard in IsNotDateOrRegexp. r=smaug 2013-05-15 21:46:44 -04:00
Terrence Cole b6490325af Bug 777548 - Make non-cc-participant tracing indirect; r=smaug,billm,jst 2013-03-28 13:37:22 -07:00
Boris Zbarsky 3aaf7effea Bug 867863. Be a little more careful in GlobalObject initialization. r=peterv 2013-05-08 15:50:58 -04:00
Boris Zbarsky da03e696a5 Bug 869311. More rooting in dom/bindings and content/base. r=smaug 2013-05-07 22:34:56 -04:00
Boris Zbarsky ec2d2df69a Bug 865969 part 9. Remaining miscellaneous rooting fixes in WebIDL bindings. r=ms2ger 2013-05-03 19:29:09 -04:00
Boris Zbarsky 7640b170ac Bug 865969 part 6. Fix rooting hazards in BindingUtils.cpp. r=smaug 2013-05-03 19:29:08 -04:00
Boris Zbarsky 6e1db48b4d Bug 865969 part 1. Better rooting in bindings for 'object' arguments, as well as for worker interface arguments passed as JSObject*. r=smaug 2013-05-03 19:29:07 -04:00
David Zbarsky 8cdcfa8969 Bug 866450 Part 1: Fix rooting hazards under content/ and dom/ r=bz 2013-05-02 05:12:45 -04:00
Boris Zbarsky fb71a87689 Bug 860841. Hook up the proto chain of a WebIDL interface object to the interface object of its nearest ancestor interface that has one, as if these were ES6 classes. r=peterv 2013-05-02 14:38:19 -04:00
Ed Morley cd58a5c447 Backed out changeset ad10907da2d4 (bug 866450) for B2G build failures 2013-05-02 11:58:05 +01:00
David Zbarsky 1527681014 Bug 866450 Part 1: Fix rooting hazards under content/ and dom/ r=bz 2013-05-02 05:12:45 -04:00
Boris Zbarsky 8766287733 Bug 861022 part 2. Root the global object in WebIDL prototype and interface object setup. r=peterv,terrence 2013-05-01 23:44:12 -04:00
Boris Zbarsky d975beea20 Bug 861022 part 1. Root the non-globals in WebIDL prototype and interface object setup. r=peterv,terrence 2013-05-01 23:44:11 -04:00
Boris Zbarsky 9e0ae56b05 Bug 865961. Root the scope argument of wrap-the-xpconnect-object helpers in WebIDL bindings. r=ms2ger 2013-04-29 17:33:42 -04:00
Boris Zbarsky 3394bf9a4a Bug 717637. Stop using non-global parent objects for everything that's not an element, since having a mix of parent objects makes us fail shape guards in the JIT. r=peterv 2013-04-29 17:33:41 -04:00
Boris Zbarsky 69e8214aeb Bug 865964. Remove dead WrapCallbackInterface code. r=smaug 2013-04-26 13:41:21 -04:00
Boris Zbarsky eb318bbb88 Bug 766583 part 1. Stop declaring dictionaries as const on the stack in bindings code. r=smaug 2013-04-25 19:03:06 -04:00
Boris Zbarsky 1ffcf1ad91 Bug 861493. When passing arguments to an Xray for a WebIDL constructor, make sure to do the argument unwrapping before entering the content compartment. r=bholley,waldo
There are several changes here:

1) Adds some MutableThis methods to Optional, Nullable, and dictionaries to
   effectively allow doing a const_cast without knowing the actual type being
   templated over.  I needed this because I do not in fact know that type in
   the relevant code.  I'm open to suggestions for a better name for this
   method.
2) Adds some operator& to RootedJSValue to make it look more like a JS::Value,
   and in particular so I can JS_WrapValue the thing in it.
3) Adds a Slot() method to NonNullLazyRootedObject, just like NonNull has.
4) Adds an operator& to LazyRootedObject to make it look more like JSObject* so
   I can JS_WrapObject the thing in it.
5) Implements the actual rewrapping of the arguments into the content compartment.
6) Fixes a small preexisting bug in which we didn't look at named constructors
   in getTypesFromDescriptor (this was causing my tests to not compile).
7) Changes Xrays to not enter the content compartment when calling a WebIDL
   constructor.
8) Adds some friend API to report things as not being functions.
2013-04-25 19:03:05 -04:00
Boris Zbarsky b834439797 Bug 864727 part 5. Make all the WrapObject methods take a handle for the scope object. r=ms2ger 2013-04-25 12:29:54 -04:00