Bug 1031051: Part 9 - Migrate RecordErrorEvent to the WebIDL code generator. r=smaug

This commit is contained in:
Kyle Huey 2014-06-30 16:02:02 -07:00
Родитель 30920f0855
Коммит abf5caa4a0
7 изменённых файлов: 10 добавлений и 40 удалений

Просмотреть файл

@ -10,7 +10,7 @@
#include "mozilla/DOMEventTargetHelper.h"
#include "nsError.h"
#include "nsIDocument.h"
#include "nsIDOMRecordErrorEvent.h"
#include "mozilla/dom/RecordErrorEvent.h"
#include "nsTArray.h"
#include "DOMMediaStream.h"
#include "EncodedBufferCache.h"
@ -762,14 +762,15 @@ MediaRecorder::NotifyError(nsresult aRv)
errorMsg = NS_LITERAL_STRING("GenericError");
}
nsCOMPtr<nsIDOMEvent> event;
rv = NS_NewDOMRecordErrorEvent(getter_AddRefs(event), this, nullptr, nullptr);
nsCOMPtr<nsIDOMRecordErrorEvent> errorEvent = do_QueryInterface(event);
rv = errorEvent->InitRecordErrorEvent(NS_LITERAL_STRING("error"),
false, false, errorMsg);
RecordErrorEventInit init;
init.mBubbles = false;
init.mCancelable = false;
init.mName = errorMsg;
nsRefPtr<RecordErrorEvent> event =
RecordErrorEvent::Constructor(this, NS_LITERAL_STRING("error"), init);
event->SetTrusted(true);
rv = DispatchDOMEvent(nullptr, event, nullptr, nullptr);
if (NS_FAILED(rv)) {
NS_ERROR("Failed to dispatch the error event!!!");

Просмотреть файл

@ -28,7 +28,6 @@ XPIDL_SOURCES += [
'nsIDOMNotifyPaintEvent.idl',
'nsIDOMNSEvent.idl',
'nsIDOMPaintRequest.idl',
'nsIDOMRecordErrorEvent.idl',
'nsIDOMScrollAreaEvent.idl',
'nsIDOMSimpleGestureEvent.idl',
'nsIDOMStyleRuleChangeEvent.idl',

Просмотреть файл

@ -1,27 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 "nsIDOMEvent.idl"
/**
* The nsIDOMRecordErrorEvent interface is used for media recorder sent events
* and for indeciate what's wrong in the object
* The name value is defined in the
* http://www.w3.org/TR/2012/WD-dom-20121206/#error-names-table
*/
[builtinclass, uuid(606e6f94-bf02-11e2-8a01-e722108c6d66)]
interface nsIDOMRecordErrorEvent : nsIDOMEvent
{
/**
* The error name in this event.
*/
readonly attribute DOMString name;
[noscript]
void initRecordErrorEvent(in DOMString aType,
in boolean aCanBubble,
in boolean aCancelable,
in DOMString aName);
};

Просмотреть файл

@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Constructor(DOMString type, optional RecordErrorEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
[Constructor(DOMString type, optional RecordErrorEventInit eventInitDict)]
interface RecordErrorEvent : Event
{
readonly attribute DOMString name;

Просмотреть файл

@ -651,6 +651,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [
'PopStateEvent.webidl',
'PopupBlockedEvent.webidl',
'ProgressEvent.webidl',
'RecordErrorEvent.webidl',
'RTCDataChannelEvent.webidl',
'RTCPeerConnectionIceEvent.webidl',
'RTCPeerConnectionIdentityErrorEvent.webidl',

Просмотреть файл

@ -20,7 +20,6 @@ simple_events = [
'SpeechSynthesisEvent',
#endif
'DeviceStorageChangeEvent',
'RecordErrorEvent',
#ifdef MOZ_WEBSPEECH
'SpeechRecognitionEvent',
#endif

Просмотреть файл

@ -124,7 +124,6 @@
#include "nsIDOMParser.h"
#include "nsIDOMProcessingInstruction.h"
#include "nsIDOMRange.h"
#include "nsIDOMRecordErrorEvent.h"
#include "nsIDOMRect.h"
#include "nsIDOMScreen.h"
#include "nsIDOMScrollAreaEvent.h"
@ -277,7 +276,6 @@
#include "mozilla/dom/PositionErrorBinding.h"
#include "mozilla/dom/ProcessingInstructionBinding.h"
#include "mozilla/dom/RangeBinding.h"
#include "mozilla/dom/RecordErrorEventBinding.h"
#include "mozilla/dom/RectBinding.h"
#include "mozilla/dom/ScreenBinding.h"
#include "mozilla/dom/SelectionBinding.h"
@ -481,7 +479,6 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] =
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMParser, DOMParser),
DEFINE_SHIM(ProcessingInstruction),
DEFINE_SHIM(Range),
DEFINE_SHIM(RecordErrorEvent),
DEFINE_SHIM(Rect),
DEFINE_SHIM(Screen),
DEFINE_SHIM(ScrollAreaEvent),