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

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

Issue 2862963003: Replace ASSERT with DCHECK in modules/ (Closed)
Patch Set: NOTREACHED instead of DCHECK(false) Created 3 years, 7 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 21 matching lines...) Expand all
32 #include "modules/mediastream/MediaStreamTrack.h" 32 #include "modules/mediastream/MediaStreamTrack.h"
33 #include "modules/speech/SpeechRecognitionController.h" 33 #include "modules/speech/SpeechRecognitionController.h"
34 #include "modules/speech/SpeechRecognitionError.h" 34 #include "modules/speech/SpeechRecognitionError.h"
35 #include "modules/speech/SpeechRecognitionEvent.h" 35 #include "modules/speech/SpeechRecognitionEvent.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 SpeechRecognition* SpeechRecognition::Create(ExecutionContext* context) { 39 SpeechRecognition* SpeechRecognition::Create(ExecutionContext* context) {
40 ASSERT(context && context->IsDocument()); 40 ASSERT(context && context->IsDocument());
41 Document* document = ToDocument(context); 41 Document* document = ToDocument(context);
42 ASSERT(document); 42 DCHECK(document);
43 return new SpeechRecognition(document->GetPage(), context); 43 return new SpeechRecognition(document->GetPage(), context);
44 } 44 }
45 45
46 void SpeechRecognition::start(ExceptionState& exception_state) { 46 void SpeechRecognition::start(ExceptionState& exception_state) {
47 if (!controller_) 47 if (!controller_)
48 return; 48 return;
49 49
50 if (started_) { 50 if (started_) {
51 exception_state.ThrowDOMException(kInvalidStateError, 51 exception_state.ThrowDOMException(kInvalidStateError,
52 "recognition has already started."); 52 "recognition has already started.");
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 DEFINE_TRACE(SpeechRecognition) { 180 DEFINE_TRACE(SpeechRecognition) {
181 visitor->Trace(grammars_); 181 visitor->Trace(grammars_);
182 visitor->Trace(audio_track_); 182 visitor->Trace(audio_track_);
183 visitor->Trace(controller_); 183 visitor->Trace(controller_);
184 visitor->Trace(final_results_); 184 visitor->Trace(final_results_);
185 EventTargetWithInlineData::Trace(visitor); 185 EventTargetWithInlineData::Trace(visitor);
186 ContextLifecycleObserver::Trace(visitor); 186 ContextLifecycleObserver::Trace(visitor);
187 } 187 }
188 188
189 } // namespace blink 189 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698