Bug 1440407 P2 Remove some unnecessary nsPIDOMWindowInner QI to nsIGlobalObject. r=mystor
This commit is contained in:
@@ -2704,11 +2704,10 @@ HTMLMediaElement::SeekToNextFrame(ErrorResult& aRv)
|
||||
/* This will cause JIT code to be kept around longer, to help performance
|
||||
* when using SeekToNextFrame to iterate through every frame of a video.
|
||||
*/
|
||||
nsCOMPtr<nsIGlobalObject> global =
|
||||
do_QueryInterface(OwnerDoc()->GetInnerWindow());
|
||||
nsPIDOMWindowInner* win = OwnerDoc()->GetInnerWindow();
|
||||
|
||||
if (global) {
|
||||
if (JSObject *obj = global->GetGlobalJSObject()) {
|
||||
if (win) {
|
||||
if (JSObject *obj = win->AsGlobal()->GetGlobalJSObject()) {
|
||||
js::NotifyAnimationActivity(obj);
|
||||
}
|
||||
}
|
||||
@@ -7110,13 +7109,12 @@ HTMLMediaElement::SetMediaKeys(mozilla::dom::MediaKeys* aMediaKeys,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIGlobalObject> global =
|
||||
do_QueryInterface(OwnerDoc()->GetInnerWindow());
|
||||
if (!global) {
|
||||
nsPIDOMWindowInner* win = OwnerDoc()->GetInnerWindow();
|
||||
if (!win) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return nullptr;
|
||||
}
|
||||
RefPtr<DetailedPromise> promise = DetailedPromise::Create(global, aRv,
|
||||
RefPtr<DetailedPromise> promise = DetailedPromise::Create(win->AsGlobal(), aRv,
|
||||
NS_LITERAL_CSTRING("HTMLMediaElement.setMediaKeys"));
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
@@ -7607,14 +7605,14 @@ HTMLMediaElement::NotifyAboutPlaying()
|
||||
already_AddRefed<Promise>
|
||||
HTMLMediaElement::CreateDOMPromise(ErrorResult& aRv) const
|
||||
{
|
||||
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(OwnerDoc()->GetInnerWindow());
|
||||
nsPIDOMWindowInner* win = OwnerDoc()->GetInnerWindow();
|
||||
|
||||
if (!global) {
|
||||
if (!win) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return Promise::Create(global, aRv);
|
||||
return Promise::Create(win->AsGlobal(), aRv);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user