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

Side by Side Diff: Source/modules/speech/SpeechRecognition.h

Issue 139803012: Move speech module over to Oilpan. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More namespace tweaks for clang Created 6 years, 10 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 11 matching lines...) Expand all
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef SpeechRecognition_h 26 #ifndef SpeechRecognition_h
27 #define SpeechRecognition_h 27 #define SpeechRecognition_h
28 28
29 #include "bindings/v8/ScriptWrappable.h" 29 #include "bindings/v8/ScriptWrappable.h"
30 #include "core/dom/ActiveDOMObject.h" 30 #include "core/dom/ActiveDOMObject.h"
31 #include "core/events/EventTarget.h" 31 #include "core/events/EventTarget.h"
32 #include "heap/Handle.h"
32 #include "modules/speech/SpeechGrammarList.h" 33 #include "modules/speech/SpeechGrammarList.h"
34 #include "modules/speech/SpeechRecognitionResult.h"
33 #include "wtf/Compiler.h" 35 #include "wtf/Compiler.h"
34 #include "wtf/PassRefPtr.h" 36 #include "wtf/PassRefPtr.h"
35 #include "wtf/RefCounted.h" 37 #include "wtf/RefCounted.h"
36 #include "wtf/text/WTFString.h" 38 #include "wtf/text/WTFString.h"
37 39
38 namespace WebCore { 40 namespace WebCore {
39 41
40 class ExceptionState; 42 class ExceptionState;
41 class ExecutionContext; 43 class ExecutionContext;
42 class SpeechRecognitionController; 44 class SpeechRecognitionController;
43 class SpeechRecognitionError; 45 class SpeechRecognitionError;
44 class SpeechRecognitionResult;
45 class SpeechRecognitionResultList;
46 46
47 class SpeechRecognition FINAL : public RefCounted<SpeechRecognition>, public Scr iptWrappable, public ActiveDOMObject, public EventTargetWithInlineData { 47 class SpeechRecognition FINAL : public RefCountedWillBeRefCountedGarbageCollecte d<SpeechRecognition>, public ScriptWrappable, public ActiveDOMObject, public Eve ntTargetWithInlineData {
48 REFCOUNTED_EVENT_TARGET(SpeechRecognition); 48 DECLARE_GC_INFO;
49 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<S peechRecognition>);
49 public: 50 public:
50 static PassRefPtr<SpeechRecognition> create(ExecutionContext*); 51 static PassRefPtrWillBeRawPtr<SpeechRecognition> create(ExecutionContext*);
51 virtual ~SpeechRecognition(); 52 virtual ~SpeechRecognition();
52 53
53 // Attributes. 54 // Attributes.
55 // FIXME (oilpan transition): tidier way to express?
haraken 2014/02/12 05:18:45 Use "FIXME: oilpan:". Blink doesn't use "FIXME(xxx
56 #if ENABLE(OILPAN)
57 RawPtr<SpeechGrammarList> grammars() { return m_grammars.get(); }
58 #else
54 PassRefPtr<SpeechGrammarList> grammars() { return m_grammars; } 59 PassRefPtr<SpeechGrammarList> grammars() { return m_grammars; }
tkent 2014/02/12 04:02:06 Returning PassRefPtr looks a bug of the original c
haraken 2014/02/12 05:18:45 Yeah, let's fix this before landing this CL so tha
sof 2014/02/12 07:48:51 Good, good; switched to SpeechGrammarList*.
55 void setGrammars(PassRefPtr<SpeechGrammarList> grammars) { m_grammars = gram mars; } 60 #endif
61 void setGrammars(PassRefPtrWillBeRawPtr<SpeechGrammarList> grammars) { m_gra mmars = grammars; }
56 String lang() { return m_lang; } 62 String lang() { return m_lang; }
57 void setLang(const String& lang) { m_lang = lang; } 63 void setLang(const String& lang) { m_lang = lang; }
58 bool continuous() { return m_continuous; } 64 bool continuous() { return m_continuous; }
59 void setContinuous(bool continuous) { m_continuous = continuous; } 65 void setContinuous(bool continuous) { m_continuous = continuous; }
60 bool interimResults() { return m_interimResults; } 66 bool interimResults() { return m_interimResults; }
61 void setInterimResults(bool interimResults) { m_interimResults = interimResu lts; } 67 void setInterimResults(bool interimResults) { m_interimResults = interimResu lts; }
62 unsigned long maxAlternatives() { return m_maxAlternatives; } 68 unsigned long maxAlternatives() { return m_maxAlternatives; }
63 void setMaxAlternatives(unsigned long maxAlternatives) { m_maxAlternatives = maxAlternatives; } 69 void setMaxAlternatives(unsigned long maxAlternatives) { m_maxAlternatives = maxAlternatives; }
64 70
65 // Callable by the user. 71 // Callable by the user.
(...skipping 26 matching lines...) Expand all
92 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechstart); 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechstart);
93 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechend); 99 DEFINE_ATTRIBUTE_EVENT_LISTENER(speechend);
94 DEFINE_ATTRIBUTE_EVENT_LISTENER(soundend); 100 DEFINE_ATTRIBUTE_EVENT_LISTENER(soundend);
95 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioend); 101 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioend);
96 DEFINE_ATTRIBUTE_EVENT_LISTENER(result); 102 DEFINE_ATTRIBUTE_EVENT_LISTENER(result);
97 DEFINE_ATTRIBUTE_EVENT_LISTENER(nomatch); 103 DEFINE_ATTRIBUTE_EVENT_LISTENER(nomatch);
98 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); 104 DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
99 DEFINE_ATTRIBUTE_EVENT_LISTENER(start); 105 DEFINE_ATTRIBUTE_EVENT_LISTENER(start);
100 DEFINE_ATTRIBUTE_EVENT_LISTENER(end); 106 DEFINE_ATTRIBUTE_EVENT_LISTENER(end);
101 107
108 void trace(Visitor*);
109
102 private: 110 private:
103 friend class RefCounted<SpeechRecognition>; 111 friend class RefCounted<SpeechRecognition>;
104 112
105 explicit SpeechRecognition(ExecutionContext*); 113 explicit SpeechRecognition(ExecutionContext*);
106 114
107 RefPtr<SpeechGrammarList> m_grammars; 115 RefPtrWillBeMember<SpeechGrammarList> m_grammars;
108 String m_lang; 116 String m_lang;
109 bool m_continuous; 117 bool m_continuous;
110 bool m_interimResults; 118 bool m_interimResults;
111 unsigned long m_maxAlternatives; 119 unsigned long m_maxAlternatives;
112 120
113 SpeechRecognitionController* m_controller; 121 SpeechRecognitionController* m_controller;
114 bool m_stoppedByActiveDOMObject; 122 bool m_stoppedByActiveDOMObject;
115 bool m_started; 123 bool m_started;
116 bool m_stopping; 124 bool m_stopping;
117 Vector<RefPtr<SpeechRecognitionResult> > m_finalResults; 125 Vector<RefPtr<SpeechRecognitionResult> > m_finalResults;
118 }; 126 };
119 127
120 } // namespace WebCore 128 } // namespace WebCore
121 129
122 #endif // SpeechRecognition_h 130 #endif // SpeechRecognition_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698