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

Side by Side Diff: content/public/test/test_utils.cc

Issue 1398153002: Don't use base::MessageLoop::{Quit,QuitClosure} in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/public/test/test_utils.h" 5 #include "content/public/test/test_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 private: 67 private:
68 scoped_ptr<base::Value> result_; 68 scoped_ptr<base::Value> result_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(ScriptCallback); 70 DISALLOW_COPY_AND_ASSIGN(ScriptCallback);
71 }; 71 };
72 72
73 void ScriptCallback::ResultCallback(const base::Value* result) { 73 void ScriptCallback::ResultCallback(const base::Value* result) {
74 if (result) 74 if (result)
75 result_.reset(result->DeepCopy()); 75 result_.reset(result->DeepCopy());
76 base::MessageLoop::current()->Quit(); 76 base::MessageLoop::current()->QuitWhenIdle();
77 } 77 }
78 78
79 // Monitors if any task is processed by the message loop. 79 // Monitors if any task is processed by the message loop.
80 class TaskObserver : public base::MessageLoop::TaskObserver { 80 class TaskObserver : public base::MessageLoop::TaskObserver {
81 public: 81 public:
82 TaskObserver() : processed_(false) {} 82 TaskObserver() : processed_(false) {}
83 ~TaskObserver() override {} 83 ~TaskObserver() override {}
84 84
85 // MessageLoop::TaskObserver overrides. 85 // MessageLoop::TaskObserver overrides.
86 void WillProcessTask(const base::PendingTask& pending_task) override {} 86 void WillProcessTask(const base::PendingTask& pending_task) override {}
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 369
370 void WebContentsDestroyedWatcher::Wait() { 370 void WebContentsDestroyedWatcher::Wait() {
371 message_loop_runner_->Run(); 371 message_loop_runner_->Run();
372 } 372 }
373 373
374 void WebContentsDestroyedWatcher::WebContentsDestroyed() { 374 void WebContentsDestroyedWatcher::WebContentsDestroyed() {
375 message_loop_runner_->Quit(); 375 message_loop_runner_->Quit();
376 } 376 }
377 377
378 } // namespace content 378 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/render_view_test.cc ('k') | content/renderer/device_sensors/device_motion_event_pump_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698