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

Side by Side Diff: components/arc/standalone/arc_standalone_bridge_runner.cc

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/arc/standalone/arc_standalone_bridge_runner.h" 5 #include "components/arc/standalone/arc_standalone_bridge_runner.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/single_thread_task_runner.h"
9 10
10 namespace arc { 11 namespace arc {
11 12
12 ArcStandaloneBridgeRunner::ArcStandaloneBridgeRunner() : exit_code_(0) { 13 ArcStandaloneBridgeRunner::ArcStandaloneBridgeRunner() : exit_code_(0) {
13 } 14 }
14 15
15 ArcStandaloneBridgeRunner::~ArcStandaloneBridgeRunner() { 16 ArcStandaloneBridgeRunner::~ArcStandaloneBridgeRunner() {
16 } 17 }
17 18
18 int ArcStandaloneBridgeRunner::Run() { 19 int ArcStandaloneBridgeRunner::Run() {
19 DCHECK(thread_checker_.CalledOnValidThread()); 20 DCHECK(thread_checker_.CalledOnValidThread());
20 run_loop_.reset(new base::RunLoop()); 21 run_loop_.reset(new base::RunLoop());
21 run_loop_->Run(); 22 run_loop_->Run();
22 run_loop_.reset(nullptr); 23 run_loop_.reset(nullptr);
23 24
24 return exit_code_; 25 return exit_code_;
25 } 26 }
26 27
27 void ArcStandaloneBridgeRunner::Stop(int exit_code) { 28 void ArcStandaloneBridgeRunner::Stop(int exit_code) {
28 DCHECK(thread_checker_.CalledOnValidThread()); 29 DCHECK(thread_checker_.CalledOnValidThread());
29 exit_code_ = exit_code; 30 exit_code_ = exit_code;
30 CHECK(run_loop_); 31 CHECK(run_loop_);
31 message_loop_.PostTask(FROM_HERE, run_loop_->QuitClosure()); 32 message_loop_.task_runner()->PostTask(FROM_HERE, run_loop_->QuitClosure());
32 } 33 }
33 34
34 } // namespace arc 35 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/arc_bridge_service_unittest.cc ('k') | components/arc/standalone/service_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698