Closed Bug 884407 Opened 11 years ago Closed 11 years ago

Update SpeechRecognitionError to use enum

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: smaug, Unassigned)

References

Details

Attachments

(2 files, 1 obsolete file)

This patch creates an enum for the error codes for SpeechRecognitionError. It also removes nsIDOMSpeechRecognitionError, since that turned out to be possible (but let me know if you'd actually like to keep it), and updates the tests accordingly.
Attachment #766141 - Flags: review?(bugs)
Comment on attachment 766141 [details] [diff] [review] Bug 884407 - Use an enum in SpeechRecognitionError >+DOMCI_DATA(SpeechRecognitionError, mozilla::dom::SpeechRecognitionError) No need for DOMCI_DATA >+namespace mozilla { >+namespace dom { >+ >+SpeechRecognitionError::SpeechRecognitionError(mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, nsEvent* aEvent) >+: nsDOMEvent(aOwner, aPresContext, aEvent), >+ mError(), >+ mMessage() There shouldn't be need for mMessage(). (codegen may create such). >+{ >+ SetIsDOMBinding(); No need for this anymore. These days all the events use DOM bindings, so SetIsBOMBinding() is called in the nsDOMEvent ctor. >+ nsresult >+ InitSpeechRecognitionError(const nsAString& aType, >+ bool aCanBubble, >+ bool aCancelable, >+ SpeechRecognitionErrorCode aError, >+ const nsAString& aMessage); So if we don't have .idl, why do we need this version? Wouldn't the one with ErrorResult be enough?
Attachment #766141 - Flags: review?(bugs) → review+
Refreshing the patch after addressing review comments. Keeping r+ from smaug.
Attachment #766141 - Attachment is obsolete: true
Attachment #766918 - Flags: review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
It seems this breaks compilation with --disable-webspeech ... Can you please fix it?
Sorry about that. This patch should fix it.
Attachment #768102 - Flags: review?(bugs)
Comment on attachment 768102 [details] [diff] [review] Only build SpeechRecognitionError when MOZ_WEBSPEECH is enabled I guess that works (I'm not familiar with the syntax moz.build uses)
Attachment #768102 - Flags: review?(bugs) → review+
Seems to work, thanks.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: