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

21 Коммитов

Автор SHA1 Сообщение Дата
Kris Maglione e8b0862194 Bug 1588839 - Part 3: Preserve cross-process async stacks in sendQuery/sendAsyncMessage calls. r=bzbarsky
This makes it much simpler to track down the source of message handler errors
by linking the cross-process caller chains which sent the problematic message.

Differential Revision: https://phabricator.services.mozilla.com/D50883

--HG--
extra : moz-landing-system : lando
2019-12-07 18:59:23 +00:00
Kris Maglione 7ae4407d5f Bug 1588839 - Part 2: Return the actual rejection value when a sendQuery handler rejects. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D50882

--HG--
extra : moz-landing-system : lando
2019-12-07 18:59:21 +00:00
Ciure Andrei cbb1fe8008 Backed out 4 changesets (bug 1588839) for causing JSWindowActor.cpp failures CLOSED TREE
Backed out changeset 7cfcd0f5da4f (bug 1588839)
Backed out changeset cde41501372a (bug 1588839)
Backed out changeset 65cc1910918c (bug 1588839)
Backed out changeset 2f8b5b48c896 (bug 1588839)
2019-12-07 19:41:36 +02:00
Kris Maglione 56a686929a Bug 1588839 - Part 3: Preserve cross-process async stacks in sendQuery/sendAsyncMessage calls. r=bzbarsky
This makes it much simpler to track down the source of message handler errors
by linking the cross-process caller chains which sent the problematic message.

Differential Revision: https://phabricator.services.mozilla.com/D50883

--HG--
extra : moz-landing-system : lando
2019-12-02 18:28:28 +00:00
Kris Maglione 42c0feff20 Bug 1588839 - Part 2: Return the actual rejection value when a sendQuery handler rejects. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D50882

--HG--
extra : moz-landing-system : lando
2019-12-07 05:32:51 +00:00
Daniel Varga 84a601a6d4 Backed out 17 changesets (bug 1596918) for multiple browser-chrome and dev-tools failures. On a CLOSED TREE
Backed out changeset ab87d2c1afae (bug 1596918)
Backed out changeset 775f3b06a687 (bug 1596918)
Backed out changeset 67cc63ef5d7f (bug 1596918)
Backed out changeset 7d290bcd2067 (bug 1596918)
Backed out changeset 048db9f4db7c (bug 1596918)
Backed out changeset 96a79d2ba614 (bug 1596918)
Backed out changeset be770d112dd8 (bug 1596918)
Backed out changeset 302c8ab8391c (bug 1596918)
Backed out changeset 44ef8f20732e (bug 1596918)
Backed out changeset 38c11ebfb8ff (bug 1596918)
Backed out changeset b586fc081374 (bug 1596918)
Backed out changeset 12283166716f (bug 1596918)
Backed out changeset 99b0421015d8 (bug 1596918)
Backed out changeset 97ec49dbbbf3 (bug 1596918)
Backed out changeset ec79478f58f1 (bug 1596918)
Backed out changeset c6d356833bb8 (bug 1596918)
Backed out changeset 5ef6026806c8 (bug 1596918)
2019-12-07 03:12:07 +02:00
Kris Maglione a05bf74656 Bug 1596918: Part 1e - Correctly handle query handlers throwing uncatchable exceptions. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D53738

--HG--
extra : moz-landing-system : lando
2019-12-06 22:13:57 +00:00
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Agi Sferro 3a3968887a Bug 1570115 - Add do_QueryActor to query JS-implemented interfaces. r=kmag
This allows querying an actor for interfaces implemented in JS.

Differential Revision: https://phabricator.services.mozilla.com/D44050

--HG--
extra : moz-landing-system : lando
2019-09-20 18:01:07 +00:00
John Dai da2a2940ad Bug 1580907 - Remove transferables attribute for SendAsyncMessage and SendQuery in JSWindowActor; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D45809

--HG--
extra : moz-landing-system : lando
2019-09-13 16:51:23 +00:00
Kris Maglione 7467b1470b Bug 1561705: Part 1 - Add JSWindowActor.actorCreated callback. r=jdai
The JSWindowActor constructor is called before the actor is fully initialized,
which means it can't do things like send messages or access its content
window. This patch adds a new callback which can do those things immediately
after the actor is created.

Differential Revision: https://phabricator.services.mozilla.com/D42178

--HG--
extra : rebase_source : ba17cacb00d8fc74f84c5d34f64addcc3e6d3f8b
extra : source : ac3da20c687971c412d1164f08b17e0cccc5fbd5
2019-08-14 16:13:13 -07:00
Olli Pettay c7ee50989c Bug 1565930, try to make Promise less error prone to compartment mismatches, r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D38762

--HG--
extra : moz-landing-system : lando
2019-07-29 14:43:54 +00:00
Kris Maglione e1913dc244 Bug 1541557: Part 2 - Stop sending uninitialized StructuredCloneData objects. r=nika
There are a couple of places where JSWindowActor currently sends uninitialized
StructuredCloneData objects in places where it wants the message data to be
undefined. The problem with this is that it causes an error when trying to
read the data, which leads to odd behavior like `sendQuery` promises never
being settled if the message handler throws, or `sendAsyncMessage` and
`sendQuery` failing to decode the message if the caller doesn't pass a second
argument.

The errors reported for these problems also have no context, which means it's
very hard for a developer to figure out the source of the problem. And, to
make matters worse, the errors look the same as structured clone encoding
errors, so there isn't even the clue that the error is happening on decode.

This patch updates the offending code to always explicitly initialize the
structured clone data with `undefined` when that's what it wants, and adds
assertions to make it more obvious where the decode errors are actually
happening.

Differential Revision: https://phabricator.services.mozilla.com/D35052

--HG--
extra : rebase_source : dd4720d63cd0722a554524e65d16e31b702adbf3
extra : source : 158a4000c44b9b17a7935340db79431d544fb556
2019-06-13 15:01:05 -07:00
Kris Maglione ae31355192 Bug 1541557: Part 1 - Use correct globals for JSWindowActors not in the shared JSM global. r=nika
The current JSWindowActor code assumes that all actors will be created in the
shared JSM global. This has a few problems:

1) For actors in other scopes, it enters the wrong compartment before decoding
messages, which leads to a compartment checker error when trying to call
message handlers. That could be fixed by just wrapping the result for the
caller, but that would lead to other problems. Aside from the efficiency
concerns of having to deal with cross-compartment wrappers, SpecialPowers in
particular would not be able to pass the resulting objects to unprivileged
scopes, since only SpecialPowers compartments have permissive CCWs enabled.

2) It also leads to the prototype objects for the actor instances being
created in the shared JSM scope, even when the actors themselves are defined
in other compartments. Again, aside from CCW efficiency issues, this prevents
the SpecialPowers instances from being accessed by the unprivileged scopes
that they're exposed to, since the prototype objects live in privileged scopes
which don't have permissive CCWs enabled.

This patch changes child actors to always create their objects in the global
of their constructors.

The parent objects are still created in the shared JSM global, but they now
wrap values for the appropriate compartment before trying to call message
handlers.

Differential Revision: https://phabricator.services.mozilla.com/D35051

--HG--
extra : rebase_source : 436ce516080812680d1433bf3ecbd12f91d88165
extra : source : 61fa2745733f3631488a3ecccc144823683b7b6d
2019-06-12 16:06:40 -07:00
John Dai 2c0a4d5a88 Bug 1557448 - Add this value for invocation callback; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D34219

--HG--
extra : moz-landing-system : lando
2019-06-10 17:53:22 +00:00
John Dai 916234b917 Bug 1538979 - Part 2: Add WillDestroy and DidDestroy lifecycle methods on JSWindowActor; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D30196

--HG--
extra : moz-landing-system : lando
2019-05-10 15:01:40 +00:00
Csoregi Natalia ca5858897f Backed out 3 changesets (bug 1538979) for bustage on JSWindowActor.cpp. CLOSED TREE
Backed out changeset a098226e4211 (bug 1538979)
Backed out changeset 8e065761738c (bug 1538979)
Backed out changeset 9df2b856b655 (bug 1538979)
2019-05-10 12:44:22 +03:00
John Dai c22ef89c64 Bug 1538979 - Part 2: Add WillDestroy and DidDestroy lifecycle methods on JSWindowActor; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D30196

--HG--
extra : moz-landing-system : lando
2019-05-10 09:19:30 +00:00
Nika Layzell 6114a5f7ab Bug 1544936 - Part 1: Add a sendQuery method to send an async message with a response to JSWindowActor, r=mconley,jdai
This adds a single new method, which acts like sendAsyncMessage, but
also returns a promise. This promise is fulfilled when the promise
returned from the receiveMessage callback is resolved.

```
partial interface JSWindowActor {
  [Throws]
  Promise<any> sendQuery(DOMString messageName,
                         optional any obj,
                         optional any transfers);
}
```

Differential Revision: https://phabricator.services.mozilla.com/D27809

--HG--
extra : moz-landing-system : lando
2019-04-18 19:37:15 +00:00