Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Side by Side Diff: third_party/WebKit/Source/modules/speech/SpeechRecognitionError.cpp

Issue 2217763003: Remove Blink-WebKit-only document.createEvent strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 ASSERT_NOT_REACHED(); 53 ASSERT_NOT_REACHED();
54 return String(); 54 return String();
55 } 55 }
56 56
57 SpeechRecognitionError* SpeechRecognitionError::create(ErrorCode code, const Str ing& message) 57 SpeechRecognitionError* SpeechRecognitionError::create(ErrorCode code, const Str ing& message)
58 { 58 {
59 return new SpeechRecognitionError(ErrorCodeToString(code), message); 59 return new SpeechRecognitionError(ErrorCodeToString(code), message);
60 } 60 }
61 61
62 SpeechRecognitionError* SpeechRecognitionError::create()
63 {
64 return new SpeechRecognitionError(emptyString(), emptyString());
65 }
66
67 SpeechRecognitionError* SpeechRecognitionError::create(const AtomicString& event Name, const SpeechRecognitionErrorInit& initializer) 62 SpeechRecognitionError* SpeechRecognitionError::create(const AtomicString& event Name, const SpeechRecognitionErrorInit& initializer)
68 { 63 {
69 return new SpeechRecognitionError(eventName, initializer); 64 return new SpeechRecognitionError(eventName, initializer);
70 } 65 }
71 66
72 SpeechRecognitionError::SpeechRecognitionError(const String& error, const String & message) 67 SpeechRecognitionError::SpeechRecognitionError(const String& error, const String & message)
73 : Event(EventTypeNames::error, /*canBubble=*/false, /*cancelable=*/false) 68 : Event(EventTypeNames::error, /*canBubble=*/false, /*cancelable=*/false)
74 , m_error(error) 69 , m_error(error)
75 , m_message(message) 70 , m_message(message)
76 { 71 {
77 } 72 }
78 73
79 SpeechRecognitionError::SpeechRecognitionError(const AtomicString& eventName, co nst SpeechRecognitionErrorInit& initializer) 74 SpeechRecognitionError::SpeechRecognitionError(const AtomicString& eventName, co nst SpeechRecognitionErrorInit& initializer)
80 : Event(eventName, initializer) 75 : Event(eventName, initializer)
81 { 76 {
82 if (initializer.hasError()) 77 if (initializer.hasError())
83 m_error = initializer.error(); 78 m_error = initializer.error();
84 if (initializer.hasMessage()) 79 if (initializer.hasMessage())
85 m_message = initializer.message(); 80 m_message = initializer.message();
86 } 81 }
87 82
88 const AtomicString& SpeechRecognitionError::interfaceName() const 83 const AtomicString& SpeechRecognitionError::interfaceName() const
89 { 84 {
90 return EventNames::SpeechRecognitionError; 85 return EventNames::SpeechRecognitionError;
91 } 86 }
92 87
93 } // namespace blink 88 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698