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

Side by Side Diff: content/shell/renderer/test_runner/mock_web_speech_recognizer.cc

Issue 566833002: Update WebTask in chromium c++ style (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolved build error Created 6 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 // 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 "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" 5 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/shell/renderer/test_runner/WebTestDelegate.h" 8 #include "content/shell/renderer/test_runner/WebTestDelegate.h"
9 #include "third_party/WebKit/public/web/WebSpeechRecognitionResult.h" 9 #include "third_party/WebKit/public/web/WebSpeechRecognitionResult.h"
10 #include "third_party/WebKit/public/web/WebSpeechRecognizerClient.h" 10 #include "third_party/WebKit/public/web/WebSpeechRecognizerClient.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
225 225
226 void MockWebSpeechRecognizer::ClearTaskQueue() { 226 void MockWebSpeechRecognizer::ClearTaskQueue() {
227 while (!task_queue_.empty()) { 227 while (!task_queue_.empty()) {
228 delete task_queue_.front(); 228 delete task_queue_.front();
229 task_queue_.pop_front(); 229 task_queue_.pop_front();
230 } 230 }
231 task_queue_running_ = false; 231 task_queue_running_ = false;
232 } 232 }
233 233
234 void MockWebSpeechRecognizer::StepTask::runIfValid() { 234 void MockWebSpeechRecognizer::StepTask::RunIfValid() {
235 if (m_object->task_queue_.empty()) { 235 if (object_->task_queue_.empty()) {
236 m_object->task_queue_running_ = false; 236 object_->task_queue_running_ = false;
237 return; 237 return;
238 } 238 }
239 239
240 Task* task = m_object->task_queue_.front(); 240 Task* task = object_->task_queue_.front();
241 m_object->task_queue_.pop_front(); 241 object_->task_queue_.pop_front();
242 task->run(); 242 task->run();
243 delete task; 243 delete task;
244 244
245 if (m_object->task_queue_.empty()) { 245 if (object_->task_queue_.empty()) {
246 m_object->task_queue_running_ = false; 246 object_->task_queue_running_ = false;
247 return; 247 return;
248 } 248 }
249 249
250 m_object->delegate_->postTask(new StepTask(m_object)); 250 object_->delegate_->postTask(new StepTask(object_));
251 } 251 }
252 252
253 } // namespace content 253 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698