Bug 1302304. Remove IDL bits that reference nsIDOMMediaError; it's not needed anymore. r=bkelly

This commit is contained in:
Boris Zbarsky 2016-09-15 11:41:35 -04:00
parent 55b2bebccc
commit 0fd831e559
11 changed files with 24 additions and 75 deletions

View File

@ -1889,7 +1889,6 @@ const InterfaceShimEntry kInterfaceShimMap[] =
{ "nsIDOMSimpleGestureEvent", "SimpleGestureEvent" },
{ "nsIDOMUIEvent", "UIEvent" },
{ "nsIDOMHTMLMediaElement", "HTMLMediaElement" },
{ "nsIDOMMediaError", "MediaError" },
{ "nsIDOMOfflineResourceList", "OfflineResourceList" },
{ "nsIDOMRange", "Range" },
{ "nsIDOMSVGLength", "SVGLength" },

View File

@ -85,6 +85,7 @@
#include "mozilla/dom/AudioTrack.h"
#include "mozilla/dom/AudioTrackList.h"
#include "mozilla/dom/MediaErrorBinding.h"
#include "mozilla/dom/VideoTrack.h"
#include "mozilla/dom/VideoTrackList.h"
#include "mozilla/dom/TextTrack.h"
@ -162,6 +163,12 @@ static const double THRESHOLD_HIGH_PLAYBACKRATE_AUDIO = 4.0;
// Threshold under which audio is muted
static const double THRESHOLD_LOW_PLAYBACKRATE_AUDIO = 0.5;
// Media error values. These need to match the ones in MediaError.webidl.
static const unsigned short MEDIA_ERR_ABORTED = 1;
static const unsigned short MEDIA_ERR_NETWORK = 2;
static const unsigned short MEDIA_ERR_DECODE = 3;
static const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
// Under certain conditions there may be no-one holding references to
// a media element from script, DOM parent, etc, but the element may still
// fire meaningful events in the future so we can't destroy it yet:
@ -871,13 +878,6 @@ NS_IMETHODIMP HTMLMediaElement::GetMozAutoplayEnabled(bool *aAutoplayEnabled)
return NS_OK;
}
NS_IMETHODIMP HTMLMediaElement::GetError(nsIDOMMediaError * *aError)
{
NS_IF_ADDREF(*aError = mError);
return NS_OK;
}
bool
HTMLMediaElement::Ended()
{
@ -1045,7 +1045,7 @@ void HTMLMediaElement::NoSupportedMediaSourceError()
NS_ASSERTION(mNetworkState == NETWORK_LOADING,
"Not loading during source selection?");
mError = new MediaError(this, nsIDOMMediaError::MEDIA_ERR_SRC_NOT_SUPPORTED);
mError = new MediaError(this, MEDIA_ERR_SRC_NOT_SUPPORTED);
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_NO_SOURCE);
DispatchAsyncEvent(NS_LITERAL_STRING("error"));
ChangeDelayLoadStatus(false);
@ -4416,7 +4416,7 @@ void HTMLMediaElement::NetworkError()
if (mDecoder) {
ShutdownDecoder();
}
Error(nsIDOMMediaError::MEDIA_ERR_NETWORK);
Error(MEDIA_ERR_NETWORK);
}
void HTMLMediaElement::DecodeError(const MediaResult& aError)
@ -4443,7 +4443,7 @@ void HTMLMediaElement::DecodeError(const MediaResult& aError)
NS_WARNING("Should know the source we were loading from!");
}
} else {
Error(nsIDOMMediaError::MEDIA_ERR_DECODE, aError);
Error(MEDIA_ERR_DECODE, aError);
}
}
@ -4454,16 +4454,16 @@ bool HTMLMediaElement::HasError() const
void HTMLMediaElement::LoadAborted()
{
Error(nsIDOMMediaError::MEDIA_ERR_ABORTED);
Error(MEDIA_ERR_ABORTED);
}
void HTMLMediaElement::Error(uint16_t aErrorCode,
const MediaResult& aErrorDetails)
{
NS_ASSERTION(aErrorCode == nsIDOMMediaError::MEDIA_ERR_DECODE ||
aErrorCode == nsIDOMMediaError::MEDIA_ERR_NETWORK ||
aErrorCode == nsIDOMMediaError::MEDIA_ERR_ABORTED,
"Only use nsIDOMMediaError codes!");
NS_ASSERTION(aErrorCode == MEDIA_ERR_DECODE ||
aErrorCode == MEDIA_ERR_NETWORK ||
aErrorCode == MEDIA_ERR_ABORTED,
"Only use MediaError codes!");
// Since we have multiple paths calling into DecodeError, e.g.
// MediaKeys::Terminated and EMEH264Decoder::Error. We should take the 1st
@ -6488,10 +6488,9 @@ HTMLMediaElement::HaveFailedWithSourceNotSupportedError() const
return false;
}
uint16_t errorCode;
mError->GetCode(&errorCode);
uint16_t errorCode = mError->Code();
return (mNetworkState == nsIDOMHTMLMediaElement::NETWORK_NO_SOURCE &&
errorCode == nsIDOMMediaError::MEDIA_ERR_SRC_NOT_SUPPORTED);
errorCode == MEDIA_ERR_SRC_NOT_SUPPORTED);
}
void

View File

@ -17,8 +17,7 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(MediaError)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MediaError)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsIDOMMediaError)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMMediaError)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
MediaError::MediaError(HTMLMediaElement* aParent, uint16_t aCode,
@ -29,18 +28,10 @@ MediaError::MediaError(HTMLMediaElement* aParent, uint16_t aCode,
{
}
NS_IMETHODIMP MediaError::GetCode(uint16_t* aCode)
{
if (aCode)
*aCode = Code();
return NS_OK;
}
NS_IMETHODIMP MediaError::GetMessage(nsAString& aResult)
void
MediaError::GetMessage(nsAString& aResult) const
{
CopyUTF8toUTF16(mMessage, aResult);
return NS_OK;
}
JSObject*

View File

@ -7,7 +7,6 @@
#ifndef mozilla_dom_MediaError_h
#define mozilla_dom_MediaError_h
#include "nsIDOMMediaError.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "nsWrapperCache.h"
#include "nsISupports.h"
@ -16,7 +15,7 @@
namespace mozilla {
namespace dom {
class MediaError final : public nsIDOMMediaError,
class MediaError final : public nsISupports,
public nsWrapperCache
{
~MediaError() {}
@ -29,9 +28,6 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaError)
// nsIDOMMediaError
NS_DECL_NSIDOMMEDIAERROR
HTMLMediaElement* GetParentObject() const
{
return mParent;
@ -44,6 +40,8 @@ public:
return mCode;
}
void GetMessage(nsAString& aResult) const;
private:
RefPtr<HTMLMediaElement> mParent;

View File

@ -51,7 +51,6 @@ XPIDL_SOURCES += [
'nsIDOMHTMLTableCellElement.idl',
'nsIDOMHTMLTextAreaElement.idl',
'nsIDOMHTMLUListElement.idl',
'nsIDOMMediaError.idl',
'nsIDOMMozBrowserFrame.idl',
'nsIDOMTimeRanges.idl',
'nsIDOMValidityState.idl',

View File

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
#include "nsIDOMMediaError.idl"
#include "nsIDOMTimeRanges.idl"
/**
@ -31,9 +30,6 @@ native Visibility(mozilla::Visibility);
[uuid(c041d76c-15ce-47ad-b61d-e8755a6db638)]
interface nsIDOMHTMLMediaElement : nsISupports
{
// error state
readonly attribute nsIDOMMediaError error;
// network state
attribute DOMString src;
readonly attribute DOMString currentSrc;

View File

@ -1,29 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "domstubs.idl"
[uuid(7bd8c29f-8a76-453f-9373-79f820f2dc01)]
interface nsIDOMMediaError : nsISupports
{
/* The download of the media resource was aborted by
the user agent at the user's requet */
const unsigned short MEDIA_ERR_ABORTED = 1;
/* A network error of some description caused the
user agent to stop downloading the media resource */
const unsigned short MEDIA_ERR_NETWORK = 2;
/* An error of some description occurred while decoding
the media resource */
const unsigned short MEDIA_ERR_DECODE = 3;
/* No suitable media resource could be found */
const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
readonly attribute unsigned short code;
readonly attribute DOMString message;
};

View File

@ -7,7 +7,6 @@
#ifndef mozilla_dom_mediakeys_h__
#define mozilla_dom_mediakeys_h__
#include "nsIDOMMediaError.h"
#include "nsWrapperCache.h"
#include "nsISupports.h"
#include "mozilla/Attributes.h"

View File

@ -12,6 +12,7 @@
*/
interface MediaError {
// Keep these constants in sync with the ones defined in HTMLMediaElement.h
const unsigned short MEDIA_ERR_ABORTED = 1;
const unsigned short MEDIA_ERR_NETWORK = 2;
const unsigned short MEDIA_ERR_DECODE = 3;

View File

@ -35,7 +35,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=790732
is(Ci.nsIDOMSimpleGestureEvent, SimpleGestureEvent);
is(Ci.nsIDOMUIEvent, UIEvent);
is(Ci.nsIDOMHTMLMediaElement, HTMLMediaElement);
is(Ci.nsIDOMMediaError, MediaError);
is(Ci.nsIDOMOfflineResourceList, OfflineResourceList);
is(Ci.nsIDOMRange, Range);
is(Ci.nsIDOMSVGLength, SVGLength);

View File

@ -93,7 +93,6 @@
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsIDOMHTMLUListElement.h"
#include "nsIDOMKeyEvent.h"
#include "nsIDOMMediaError.h"
#include "nsIDOMMediaList.h"
#include "nsIDOMMouseEvent.h"
#include "nsIDOMMouseScrollEvent.h"
@ -225,7 +224,6 @@
#include "mozilla/dom/HTMLUListElementBinding.h"
#include "mozilla/dom/KeyEventBinding.h"
#include "mozilla/dom/ListBoxObjectBinding.h"
#include "mozilla/dom/MediaErrorBinding.h"
#include "mozilla/dom/MediaListBinding.h"
#include "mozilla/dom/MessageEventBinding.h"
#include "mozilla/dom/MenuBoxObjectBinding.h"
@ -414,7 +412,6 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] =
DEFINE_SHIM(HTMLUListElement),
DEFINE_SHIM(KeyEvent),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIListBoxObject, ListBoxObject),
DEFINE_SHIM(MediaError),
DEFINE_SHIM(MediaList),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIMenuBoxObject, MenuBoxObject),
DEFINE_SHIM(MouseEvent),