CDMProxy stores a reference to the main thread. We'd been passing this in as an
argument. This patch changes the proxy to just fetch the main thread upon
construction. This avoids passing arguments around and also removes the risk of
passing a non-main thread arg.
Depends on D87788
Differential Revision: https://phabricator.services.mozilla.com/D87878
This patch reworks how the MediaKeys does 2 things:
1. Listens for documents becoming inactive. Mediakeys will no longer listen
on the top document in the process, and will now instead listen to their own
document.
2. Obtains the top level principal used to create the media keys. Instead of
grabbing the principal from the top document, the MediaKeys will now use their
document's channel's LoadInfo and query the principal from that.
1 will change how the keys behave in iframes -- keys will now shutdown if their
iframe doc becomes inactive, rather than the top in process document. This is
likely to only matter in very niche cases as EME is almost always used in a top
level context.
2 seeks to retain the previous behaviour, but does so in a fission compatible
way.
Differential Revision: https://phabricator.services.mozilla.com/D87788
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.
Differential Revision: https://phabricator.services.mozilla.com/D83674
Before P1, GetCurrentThreadSerialEventTarget would have always returned the same data as NS_GetCurrentThread, making the comment incorrect Now it will properly return the running TaskQueue if any.
This change of name more clearly exposes what they are doing, as we aren't always dealing with threads directly; but a nsISerialEventTarget
Differential Revision: https://phabricator.services.mozilla.com/D80354
In this bug we're moving away from monolithic JNI headers to class-specific
headers so that we don't have to rebuild the world every time we make a change
to a JNI interface.
Differential Revision: https://phabricator.services.mozilla.com/D75374
This covers most cycle collected objects which support weak references, but
not the ones which inherit from a cycle collected class and don't do any cycle
collection on their own.
Differential Revision: https://phabricator.services.mozilla.com/D63962
--HG--
extra : moz-landing-system : lando
Please review this very carefully! This exposes a bunch of error messages that
used to only be visible on DetailedPromise to web content. Are there any
privacy/security issues with exposing those? If needed, we could use more
generic messages instead, but exposing this information if we can seemed like
the right way to go.
I did look over the error messages coming from GeckoMediaDrmBridgeV21.java and
none of them look like they expose any interesting state. The messages from
ChromiumCDMProxy expose mKeySystem, but that came from the web page to start
with, I think.
Also, are these messages even meaningful for web content? Some of the error
messages (like the one from MediaDrmCDMProxy::md_SetServerCertificate) seem
like they include internal function names, so are not great for web content...
I'm not quite sure what the best thing to do there is.
Note: There is a behavior change to ChromiumCDMParent::GetStatusForPolicy because
NS_ERROR_INVALID_ARG is not a valid thing to throw to web content. I've used
TypeError, since that's what normally gets used for invalid args.
Differential Revision: https://phabricator.services.mozilla.com/D62645
--HG--
extra : moz-landing-system : lando
The rejection process consumes the ErrorResult, so an rvalue reference is the honest thing here.
Differential Revision: https://phabricator.services.mozilla.com/D62632
--HG--
extra : moz-landing-system : lando
This changes fixes a failfast in a call to Navigator.requestMediaKeySystemAccess for the case where there is no browser available from a window when e10s is on. This can happen when a document is disconnected from the DOM.
The fix is to reject the promise in this case.
Differential Revision: https://phabricator.services.mozilla.com/D60022
--HG--
extra : moz-landing-system : lando
This changes fixes a failfast in a call to Navigator.requestMediaKeySystemAccess for the case where there is no browser available from a window when e10s is on. This can happen when a document is disconnected from the DOM.
The fix is to reject the promise in this case.
Differential Revision: https://phabricator.services.mozilla.com/D60022
--HG--
extra : moz-landing-system : lando
This was done by:
This was done by applying:
```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
from subprocess import Popen, PIPE, check_output, CalledProcessError
diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
- args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+ args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']
if not output_file:
args.append("-i")
```
Then running `./mach clang-format -c <commit-hash>`
Then undoing that patch.
Then running check_spidermonkey_style.py --fixup
Then running `./mach clang-format`
I had to fix four things:
* I needed to move <utility> back down in GuardObjects.h because I was hitting
obscure problems with our system include wrappers like this:
0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94 MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94 ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)
Which I really didn't feel like digging into.
* I had to restore the order of TrustOverrideUtils.h and related files in nss
because the .inc files depend on TrustOverrideUtils.h being included earlier.
* I had to add a missing include to RollingNumber.h
* Also had to partially restore include order in JsepSessionImpl.cpp to avoid
some -WError issues due to some static inline functions being defined in a
header but not used in the rest of the compilation unit.
Differential Revision: https://phabricator.services.mozilla.com/D60327
--HG--
extra : moz-landing-system : lando
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'
Further manual fixups and cleanups to the include order incoming.
Differential Revision: https://phabricator.services.mozilla.com/D60323
--HG--
extra : moz-landing-system : lando
Bug 1510424/D13135 remove them from Windows along with Android by mistake.
This patch also moves some code to separate Android only logic from other
platforms to avoid making similar mistakes.
Differential Revision: https://phabricator.services.mozilla.com/D59248
--HG--
extra : moz-landing-system : lando
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
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
Seeing this linker error when building with optimization flags -O2 and others:
.../mozilla-central/dom/media/eme/mediadrm/MediaDrmCDMProxy.cpp:297: error: undefined reference to 'void mozilla::dom::MediaKeys::ResolvePromiseWithResult<bool>(unsigned int, bool const&)'
This patch moves the template definition from dom/media/eme/MediaKeys.cpp to dom/media/eme/MediaKeys.h
Differential Revision: https://phabricator.services.mozilla.com/D51188
--HG--
extra : moz-landing-system : lando
This change fixes a crash when there is no BrowserChild available (i.e., e10s is is turned off in Windows). In this case, the window is assumed to support protected media and will proceed without making the IPC call to check.
Differential Revision: https://phabricator.services.mozilla.com/D52190
--HG--
extra : moz-landing-system : lando
The MediaKeySystemAccessManager should be used entirely on the main thread
because it's interacting with JS. Making this explicit via comments in the
header and MOZ_ASSERTs helps document the threading model of the class.
Differential Revision: https://phabricator.services.mozilla.com/D49318
--HG--
extra : moz-landing-system : lando