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

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

Issue 1170623003: Revert "content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/public/test/frame_load_waiter.h" 5 #include "content/public/test/frame_load_waiter.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/thread_task_runner_handle.h"
10 9
11 namespace content { 10 namespace content {
12 11
13 FrameLoadWaiter::FrameLoadWaiter(RenderFrame* frame) 12 FrameLoadWaiter::FrameLoadWaiter(RenderFrame* frame)
14 : RenderFrameObserver(frame) { 13 : RenderFrameObserver(frame) {
15 } 14 }
16 15
17 void FrameLoadWaiter::Wait() { 16 void FrameLoadWaiter::Wait() {
18 // Pump messages until Blink's threaded HTML parser finishes. 17 // Pump messages until Blink's threaded HTML parser finishes.
19 run_loop_.Run(); 18 run_loop_.Run();
20 } 19 }
21 20
22 void FrameLoadWaiter::DidFinishLoad() { 21 void FrameLoadWaiter::DidFinishLoad() {
23 // Post a task to quit instead of quitting directly, since the load completion 22 // Post a task to quit instead of quitting directly, since the load completion
24 // may trigger other IPCs that tests are expecting. 23 // may trigger other IPCs that tests are expecting.
25 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, 24 base::MessageLoop::current()->PostTask(FROM_HERE, run_loop_.QuitClosure());
26 run_loop_.QuitClosure());
27 } 25 }
28 26
29 } // namespace content 27 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/fake_speech_recognition_manager.cc ('k') | content/public/test/mock_blob_url_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698