| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/test_runner/mock_web_speech_recognizer.h" | 5 #include "components/test_runner/mock_web_speech_recognizer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 } | 250 } |
| 251 task_queue_running_ = false; | 251 task_queue_running_ = false; |
| 252 } | 252 } |
| 253 | 253 |
| 254 void MockWebSpeechRecognizer::StepTask::RunIfValid() { | 254 void MockWebSpeechRecognizer::StepTask::RunIfValid() { |
| 255 if (object_->task_queue_.empty()) { | 255 if (object_->task_queue_.empty()) { |
| 256 object_->task_queue_running_ = false; | 256 object_->task_queue_running_ = false; |
| 257 return; | 257 return; |
| 258 } | 258 } |
| 259 | 259 |
| 260 Task* task = object_->task_queue_.front(); | 260 MockWebSpeechRecognizer::Task* task = object_->task_queue_.front(); |
| 261 object_->task_queue_.pop_front(); | 261 object_->task_queue_.pop_front(); |
| 262 task->run(); | 262 task->run(); |
| 263 delete task; | 263 delete task; |
| 264 | 264 |
| 265 if (object_->task_queue_.empty()) { | 265 if (object_->task_queue_.empty()) { |
| 266 object_->task_queue_running_ = false; | 266 object_->task_queue_running_ = false; |
| 267 return; | 267 return; |
| 268 } | 268 } |
| 269 | 269 |
| 270 object_->delegate_->PostTask(new StepTask(object_)); | 270 object_->delegate_->PostTask(new StepTask(object_)); |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace test_runner | 273 } // namespace test_runner |
| OLD | NEW |