This severs the ChromiumCDMVideoDecoder's connection with the CDM. The CDM process
will shutdown when the MediaKeys also severs its connection.
MozReview-Commit-ID: Aqc4y5Nxjvc
--HG--
extra : rebase_source : 5a2f77ffe84f9b99b4668520c838b29a428578d3
Merge "DOMServiceWorkerFocusClient" & "DOMWebNotificationClicked"
to "DOMWindowFocus" event. Utilize the event to switch tab when
loading links to an existing target tab.
MozReview-Commit-ID: Hd1NkVkrJA1
--HG--
extra : rebase_source : 745c0d66c3afd8e487c616891c0f10bd820da1fe
At this stage, I store video frames in memory in nsTArrays rather than in
shmems just so we can get this working. Once this is working, I'll follow up
with patches to switch to storing all large buffer traffic between the CDM and
other processes in shmems.
I'm not planning on preffing this new CDM path on until that's in place.
MozReview-Commit-ID: LSTb42msWQS
--HG--
extra : rebase_source : b7f162515a1a32b2c344c11d0fa5c7004cec2e15
The MediaKeys accesses the ChromiumCDMProxy on the main thread. But the
ChromiumCDMVideoDecoder will need to access the ChromiumCDMProxy on the decode
task queue in order to get a reference to the ChromiumCDMParent so that it can
talk to the CDM (on the GMP thread).
Additionally we'll need to shutdown the ChromiumCDMProxy, and if we do that
on the main threrad while the ChromiumCDMVideoDecoder is trying to get the
ChromiumCDMParent reference, we could hit thread safety issues.
So we need to hold a lock while reading or writing from the ChromiumCDMProxy's
reference to the ChromiumCDMParent. So add a GetCDMParent() function to the
ChromiumCDMProxy which takes the lock while reading or writing the reference.
This means that the caller will always get a valid reference. There is no guarantee
that the ChromiumCDMParent isn't shutdown after the reference is taken; if that
happens, the ChromiumCDMParent returned will fail on all operations.
In a later patch in this series, the ChromiumCDMProxy will anull its reference
to the ChromiumCDMParent on shutdown, and cause GetCDMParent to return null.
So callers need to null check the return value of GetCDMParent.
MozReview-Commit-ID: 4xL41YbwkxL
--HG--
extra : rebase_source : aa854e9d88965d7da60231d6f6a3912bf6ad2eeb
This commit refactors the SetDomain method in a Document to call a new function
IsRegistrableDomainSuffixOfOrEqualTo(), defined in HTML [1]. This commit tries
not to rename anything except input variables, so as to remain as clear as
possible. It likely should have various variables renamed, but given the
author's unfamiliarity with this module, review seems a good time to do that.
It's also duplicating comments a little bit; let me know which one(s) you'd like
to keep!
Note: Commentary on the HTML change is available in the PR [2], and the
rationale for this behavior in Web Auentication, where this algorithm will be
used, is also recorded [3].
Update 1: Refactored two new protected methods to avoid code duplication.
Update 2: Bugfix: Be sure to use CreateInheritingURIForHost for the
provided domain so as to catch internationalized domains.
Update 3: Nit-fix and rebase
[1] https://html.spec.whatwg.org/multipage/browsers.html#is-a-registrable-domain-suffix-of-or-is-equal-to
[2] https://github.com/whatwg/html/pull/2365
[3] https://github.com/w3ctag/spec-reviews/issues/97#issuecomment-175766580
MozReview-Commit-ID: 4Dr8yOMdhez
--HG--
extra : rebase_source : 634bd3c7b60c7ad996ee38ab7314071b426e3f6f
Under some circumstances, and seen on Windows 8, a decoded sample can be returned without the MFT returning MF_E_TRANSFORM_STREAM_CHANGE.
For historical reasons, we required that message to be returned at least once to set the output image size. This was required as the decoder used to be recycled with different video streams.
This is no longer the case, we can rely on the video info instead. It also greatly simplifies the code
MozReview-Commit-ID: H14KBiNWrjQ
Our caller is C++ code, and the implementations are all also written in C++,
so there is no reason to go through SpiderMonkey here. This patch also makes
nsILoadContext builtinclass to ensure that the implementation is always native.
In this patch, we simply modify the ImageBitmap::createInternal(..., HTMLMediaElement&, ...) method to use
HTMLMediaElement::GetCurrentImage() utility and HTMLMediaElement::GetCurrentImage() marks the
videl element as tainted.
MozReview-Commit-ID: KyN2xRqKVrr
--HG--
extra : rebase_source : 5e0e0400f1848823751cd88f2bbe734bc5aec5fe
Our caller is C++ code, and the implementations are all also written in C++,
so there is no reason to go through SpiderMonkey here. This patch also makes
nsILoadContext builtinclass to ensure that the implementation is always native.
This mMediaTracksConstructed flag should belong to a MediaDecoder,
every time a HTMLMediaElement switches its MediaDecoder, the flag should be reset to false again.
So, we move the mMediaTracksConstructed flag back to MediaDecoder, by this way,
HTMLMediaElement provides only the mechanism to construct and remove media tracks,
and MediaDecoder uses the flag, mMediaTracksConstructed, to provide policy.
MozReview-Commit-ID: L7mMAmLjQCy
--HG--
extra : rebase_source : 1625d604afb34bffe79eda06a46c9feb780a14d9
This patch changes the crashreporter client code as well as the crash service
code to compute a SHA256 hash of a crash' minidump file and add it to the
crash ping. The crash service code computes the hash on the fly before handing
over the crash to the crash manager; the crash manager will then add it to the
crash ping. The crashreporter client on the other hand sends the hash via the
ping it generates but it also adds it to the event file so that the crash
manager can pick it up and send it along with its own crash ping. On Fennec
the crashreporter activity takes care of computing the hash.
SHA256 hash computation uses nsICryptoHash in the crash service, the
java.security.MessageDigest class in Fennec, the bundled NSS library in the
crashreporter when running on Windows and Mac and the system-provided NSS
library under Linux. The latter is required because the crashreporter client
uses the system curl library which is linked to NSS and which would thus clash
with the bundled one if used together.
This patch introduces two new methods for the nsICrashService interface:
|getMinidumpForID()| and |getExtraFileForID()|, these reliably retrieve the
.dmp and .extra files associated with a crash and ensure the files exist
before returning. These new methods are used in the CrashService for
processing and will become the only way to reliably retrieve those files
from a crash ID.
MozReview-Commit-ID: 8BKvqj6URcO
--HG--
extra : source : a4d8291c56fcde00238ab3166bbe6af6dd602340
This is a bug from https://hg.mozilla.org/mozilla-central/rev/2d171d75b746 (bug 1157546). It took a shortcut in trying to get around one of the downsides of tracking visibility on frames instead of content nodes.
We cannot get our primary frame during FrameCreate calls because FrameCreate is called during the frame's Init() function, which happens before the primary frame pointer is set.
So when TrackImage is called from FrameCreate |frame| will be null but mFrameCreateCalled will be true. So we won't hit the early return that tries to detect nonvisible images.
The comment being removed is just wrong. We can obtain a frame for <feImage> just as well as any other image type.
The thing that is different about <feImage> is that it calls IncApproximateVisibleCount() followed by FrameCreated() in the frame's Init() function. This means that the frame is marked visible at the time of the FrameCreated, and there will be no further calls to TrackImage (because there are no further changes). So the FrameCreated call is the last chance to mark this image visible. The regressing changeset tries to get around this by just considering the image visible whenever we know a frame exists (because of mFrameCreateCalled) but can't access it. This ends up affecting all types of images, not just <feImage>.
The above paragraph is also true for SVG <image> that are non-display.
This property allows enumerating over all permissions. As the content
process no longer has access to all permissions, this method cannot be
correctly implemented in the content process anymore.
Because of that, we now error with NS_ERROR_NOT_AVALIABLE when it is
accessed in the content process.
MozReview-Commit-ID: BLNeYYcZhIi
These APIs are intended to use the mechanism defined in Part 1.
Part 3 implements the usage of these APIs to synchronize permissions.
MozReview-Commit-ID: HNKyDPtoaHl
Our caller is C++ code, and the implementations are all also written in C++,
so there is no reason to go through SpiderMonkey here. This patch also makes
nsILoadContext builtinclass to ensure that the implementation is always native.
nsStyleContext::CalcDifference had an optimization where, when we knew
that the old and new style context have the same rule node, we knew that
the only change hints that would need to be handled are those in the
"not handled for descendants" category, generated due to explicit
'inherit' values on reset properties. This was because any changes due
to differences in inherited properties should only have generated
"handled for descendants" change hints (and thus would already have been
handled on an ancestor).
Before bug 931668, this let us avoid calling CalcDifference on structs
that only would have generated hints that we knew we already would have
handled. However, after bug 931668, we compare all structs anyway so
that we can set the aEqualStructs outparam, so we don't gain anything
from this optimization. We can still return these change hints we know
will not need to be handled, and rely on ElementRestyler::CaptureChange
to filter them out.
MozReview-Commit-ID: Ld1s2Js0i6r
LazyLog can be used easily via adding the pref("logging.MODULE_NAME", DEBUG_LEVEL).
It's more convenient than PRLog.
MozReview-Commit-ID: T7uSxVAiN3
--HG--
extra : rebase_source : c0b8925e5c60353c690ca68b8fe4361b48a0f57a
We use Servo css-parser to parse keyframe property-value pairs, so we
should also use it to parse easing for Web Animations.
MozReview-Commit-ID: FsfHQaNT2xO
--HG--
extra : rebase_source : 8eb6489f257839f2c0de943b63cc1c04b44ff7a5
In order to avoid creating a temporary nsTimingFunction in some cases and
calling Init(), add some useful constructors to reduce the redundant code.
MozReview-Commit-ID: I8zmWeKl9aw
--HG--
extra : rebase_source : 50a9adc90c26c16fd1dcd7b70c519794b8d406fd
Since canvas element is only run on main thread, and OwnerDoc is never null,
we should be able to use the new Dispatch API directly.
A trivial indent fix is included in this patch as well.
Since this is a one-line-change, I decided not to split this to a separated
patch.
MozReview-Commit-ID: ExjUdOdPGd4
--HG--
extra : rebase_source : b990bf9caff0616658541a29ae46aa4c8df616e3
In bug 1044586 we changed nsDocument::GetEventTargetParent such that events for
a document were not sent to its parent window if the inner window for the
document wasn't the current inner window. Unfortunately it seems this means
event listeners on the window sometimes miss user input events (mousedown etc.)
when user input takes place before the first paint of a new document that's
loading. In order to fix this, this patch backs out the changes from bug 1044586.
This reintroduces the issue we had before with the preference window, where
reloading the preferences quickly meant that its listeners (attached to the
window) got confused by DOMContentLoaded events from a previously loaded
document. Instead of the broad fix to nsDocument::GetEventTargetParent, this
patch simply changes the event listeners from the preferences code to be
attached to the document instead of the window, thus ensuring they only get
notified for events relating to their own document.
MozReview-Commit-ID: 9DImyNst9fS
--HG--
extra : rebase_source : 94936a0ec7e60d61b25ea2e2f3236884b3cf4293
This commit refactors the SetDomain method in a Document to call a new function
IsRegistrableDomainSuffixOfOrEqualTo(), defined in HTML [1]. This commit tries
not to rename anything except input variables, so as to remain as clear as
possible. It likely should have various variables renamed, but given the
author's unfamiliarity with this module, review seems a good time to do that.
It's also duplicating comments a little bit; let me know which one(s) you'd like
to keep!
Note: Commentary on the HTML change is available in the PR [2], and the
rationale for this behavior in Web Auentication, where this algorithm will be
used, is also recorded [3].
Updates: Refactored two new protected methods to avoid code duplication.
[1] https://html.spec.whatwg.org/multipage/browsers.html#is-a-registrable-domain-suffix-of-or-is-equal-to
[2] https://github.com/whatwg/html/pull/2365
[3] https://github.com/w3ctag/spec-reviews/issues/97#issuecomment-175766580
MozReview-Commit-ID: 4Dr8yOMdhez
--HG--
extra : rebase_source : 5d042c4e97b8866027c81ea0f1c544ce1721b7c4
When constructing a Loader without passing a document, we added a DocGroup
parameter so that we could still use it to dispatch events to the DocGroup.
Delete NS_ENSURE_TRUE because new() is infallable.
Use another runnable pointer for calling dispatching because forget() will
nuke the pointer and we need to use evt afterwards.
MozReview-Commit-ID: Ce2K6j4pUhA
--HG--
extra : rebase_source : 2bacf1f856e0700f36b2fefe4d2424719cad77a7
If a media element is in-tree with UNTRACKED visibility state, the information is incomplete, just ignore it.
MozReview-Commit-ID: FcKybQZqF6c
--HG--
extra : rebase_source : 0d10cf1b80189db200999b3881f42773c34ad798
In bug 1346987 we're attempting to remove uses of the
NS_OpenAnonymousTemporaryFile() in the content process as it sends a
synchronous IPC to the parent process on the main thread, which can cause UI
jank. This patch makes the MediaCache use the async anonymous temporary file
creation function added in bug 1346987.
The file descriptor is held by the FileBlockCache. This object buffers data
passed to it in memory, and defers writing of said data to another thread. I
added the async wait for the file descriptor to be inside that async "defer to
other thread" step.
This means that while the content process is waiting for the file descriptor to
come down from the parent process, we'll buffer media data being streamed in
memory. Given that our MSE implementation will buffer up to 100MB of media data
in memory anyway, it seems that more buffering in the src=url case while we
wait for an async IPC to do a round trip to the main process is acceptable.
MozReview-Commit-ID: 3OTBTWw5pr0
--HG--
extra : rebase_source : 56e0a1f1473db3c9722330254f7a4bf3a1f5caa3
So that we can write gtests easily at next patch.
MozReview-Commit-ID: 8ZWVYO1hDOW
--HG--
extra : rebase_source : 8c3523b06fe284376d59914ecfa3791a91930fc2
UIEvent.isChar is not supported by the other browsers and the value isn't initialized any platforms except on macOS. So, the value isn't useful and we have no reason to keep it.
MozReview-Commit-ID: 4BLpo88gSZj
--HG--
extra : rebase_source : ca950f8cb618a0cadc99ba4c80b5a8df94a20f27
When nsRange::*JS() is called, mCalledByJS is set to true. In such case, Selection::NotifySelectionListeners() may move focus or anyway, it calls selection listeners. Then, they may cause calling non-*JS() methods of the nsRange instance. In this case, nsRange treats the call as called by JS since mCalledByJS is still true.
For preventing this issue, before calling Selection::NotifySelectionListeners(), nsRange should set mCalledByJS to false.
This patch renames AutoCalledByJSSetter to AutoCalledByJSRestore and make it stop setting mCalledByJS automatically. So, AutoCalledByJSRestore works same as AutoRestore now.
MozReview-Commit-ID: IYsbQTGp3VA
--HG--
extra : rebase_source : 582eb2288c035861f16149dde42c22aba555bb5a
Before this patch, we store each computed values in a hashtable,
nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>, for all
KeyframeEffectReadOnly on an element, and convert the ServoAnimationValues of
the hashtable into an nsTArray<ServoAnimationValue*> and then convert
the ServoAnimationValues of the nsTArray into PropertyDeclarationBlock
in rust. This way was really inefficient.
In this patch, we store the computed values into AnimationValueMap and
convert all AnimationValue in the map into PropertyDeclarationBlock
after EffectCompositor::GetAnimationRule.
MozReview-Commit-ID: EJ2Kl65fVeF
--HG--
extra : rebase_source : e30a9d440dc9855e21b94501b07a3501d31bc345
Later in this patch series we will replace ServoAnimationRule with a hashmap.
At that point, we would like to pass the hashmap to ComposeStyle. In order
to achieve that, this patch templatizes the 'animation rule' parameter of
ComposeStyle in both Animation and KeyframeEffectReadOnly so that it can
represent a hashmap instead.
MozReview-Commit-ID: H5bMxjN3W8n
--HG--
extra : rebase_source : 58cd9ee1cda51970d35c52b39d2cdab12055e24a
The only one caller of GetServoAnimationRule is Gecko_GetAnimationRule.
There is no risk that pres context is destroyed in Gecko_GetAnimationRule.
MozReview-Commit-ID: 52pxbCiCNoJ
--HG--
extra : rebase_source : 8000e267d1d5706c709f807e11396dda3579c4dc
Move the creation of MediaElementGMPCrashHelper out from MediaDecoder.cpp
which reduces the dependency of MediaDecoder to HTMLMediaElement.
MozReview-Commit-ID: E60aMfcFr7V
--HG--
extra : rebase_source : f50a8ee6f2fbec0bdf117eb1217066bc9c701745
extra : source : dd4e52da6d0d6205fe61d0caba44bbff008fd21a
ConstructMediaTracks and RemoveMediaTracks are actually HTMLMediaElement's responsibilities.
MozReview-Commit-ID: 8lOdzD4pN7N
--HG--
extra : rebase_source : 7159d2c62b77429e5b2305b9e3eb7a0020a3b52c
extra : source : 0467c059be3cd8f066da5fc912b7738a5b9c4dd9
Merge "DOMServiceWorkerFocusClient" & "DOMWebNotificationClicked"
to "DOMWindowFocus" event. Utilize the event to switch tab when
loading links to an existing target tab.
MozReview-Commit-ID: Hd1NkVkrJA1
Open a GetOwnerDoc() method to the MediaDecoderOwner interface and then we can get the
owner document via a pointer to MediaDecoderOwner in MediaDecoder.
MozReview-Commit-ID: JCzQDLx1MsU
--HG--
extra : rebase_source : e194c95cb1513046ec7aa19d6c6e9f8231971a2d
extra : source : 1b9c45911a036e3677b6636cda84a636681d71de
Instead of calling DownloadSuspended() via a pointer to a HTMLMediaElement,
we should call DownloadSuspended() via a pointer to a MediaDecoderOwner.
MozReview-Commit-ID: BvExQuchsWb
--HG--
extra : rebase_source : 0c8a5d412e91e2c370050a4706fc6f2afc0c20e9
extra : source : fb5ca26fc018e273296411a037b70b922cb26f4d
In order to asynchronously load content scripts that need to run very early in
the page load cycle, before any ordinary page scripts, we need to be able to
block parsing from the document-element-inserted listener. Since the script
loader operates by returning promises, blocking on promise resolution is the
simplest way to achieve this.
MozReview-Commit-ID: CTWlyrP6dqG
--HG--
extra : rebase_source : 28ce713a6450c223f9b2089e6c6e8c78284ef8af
In order to support asynchronous loading of extension content scripts, we need
to be able to exit the HTML parser flush loop immediately after inserting the
document element. Normally this doesn't cause problems, but when we enter edit
mode with an empty element selected, the editor inserts a <br> node, and a
<br> node at the start of the <html> element causes issues.
These changes solve that issue by putting off entering editor mode until we
begin laying out the document.
MozReview-Commit-ID: H2ksNz0jRxs
--HG--
extra : rebase_source : 26e0d254744363f5bd60f3b4f4df7b51c3dc446f