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

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

Issue 26878003: Reduce repetitive EventTarget subclassing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 2 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 | Annotate | Revision Log
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 26 matching lines...) Expand all
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 class ExceptionState; 40 class ExceptionState;
41 class ScriptExecutionContext; 41 class ScriptExecutionContext;
42 class SpeechRecognitionController; 42 class SpeechRecognitionController;
43 class SpeechRecognitionError; 43 class SpeechRecognitionError;
44 class SpeechRecognitionResult; 44 class SpeechRecognitionResult;
45 class SpeechRecognitionResultList; 45 class SpeechRecognitionResultList;
46 46
47 class SpeechRecognition : public RefCounted<SpeechRecognition>, public ScriptWra ppable, public ActiveDOMObject, public EventTarget { 47 class SpeechRecognition : public RefCounted<SpeechRecognition>, public ScriptWra ppable, public ActiveDOMObject, public EventTargetWithInlineData {
48 public: 48 public:
49 static PassRefPtr<SpeechRecognition> create(ScriptExecutionContext*); 49 static PassRefPtr<SpeechRecognition> create(ScriptExecutionContext*);
50 ~SpeechRecognition(); 50 ~SpeechRecognition();
51 51
52 // Attributes. 52 // Attributes.
53 PassRefPtr<SpeechGrammarList> grammars() { return m_grammars; } 53 PassRefPtr<SpeechGrammarList> grammars() { return m_grammars; }
54 void setGrammars(PassRefPtr<SpeechGrammarList> grammars) { m_grammars = gram mars; } 54 void setGrammars(PassRefPtr<SpeechGrammarList> grammars) { m_grammars = gram mars; }
55 String lang() { return m_lang; } 55 String lang() { return m_lang; }
56 void setLang(const String& lang) { m_lang = lang; } 56 void setLang(const String& lang) { m_lang = lang; }
57 bool continuous() { return m_continuous; } 57 bool continuous() { return m_continuous; }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 private: 104 private:
105 friend class RefCounted<SpeechRecognition>; 105 friend class RefCounted<SpeechRecognition>;
106 106
107 explicit SpeechRecognition(ScriptExecutionContext*); 107 explicit SpeechRecognition(ScriptExecutionContext*);
108 108
109 109
110 // EventTarget 110 // EventTarget
111 virtual void refEventTarget() OVERRIDE { ref(); } 111 virtual void refEventTarget() OVERRIDE { ref(); }
112 virtual void derefEventTarget() OVERRIDE { deref(); } 112 virtual void derefEventTarget() OVERRIDE { deref(); }
113 virtual EventTargetData* eventTargetData() OVERRIDE { return &m_eventTargetD ata; }
114 virtual EventTargetData* ensureEventTargetData() OVERRIDE { return &m_eventT argetData; }
115 113
116 RefPtr<SpeechGrammarList> m_grammars; 114 RefPtr<SpeechGrammarList> m_grammars;
117 String m_lang; 115 String m_lang;
118 bool m_continuous; 116 bool m_continuous;
119 bool m_interimResults; 117 bool m_interimResults;
120 unsigned long m_maxAlternatives; 118 unsigned long m_maxAlternatives;
121 119
122 EventTargetData m_eventTargetData;
123
124 SpeechRecognitionController* m_controller; 120 SpeechRecognitionController* m_controller;
125 bool m_stoppedByActiveDOMObject; 121 bool m_stoppedByActiveDOMObject;
126 bool m_started; 122 bool m_started;
127 bool m_stopping; 123 bool m_stopping;
128 Vector<RefPtr<SpeechRecognitionResult> > m_finalResults; 124 Vector<RefPtr<SpeechRecognitionResult> > m_finalResults;
129 }; 125 };
130 126
131 } // namespace WebCore 127 } // namespace WebCore
132 128
133 #endif // SpeechRecognition_h 129 #endif // SpeechRecognition_h
OLDNEW
« no previous file with comments | « Source/modules/notifications/Notification.cpp ('k') | Source/modules/speech/SpeechSynthesisUtterance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698