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

Side by Side Diff: services/shell/background/background_shell.cc

Issue 2132593002: Remove remaining calls to deprecated MessageLoop methods on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: h264_vt_encoder_unittest.cc Created 4 years, 5 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 "services/shell/background/background_shell.h" 5 #include "services/shell/background/background_shell.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/message_loop/message_pump_default.h" 12 #include "base/message_loop/message_pump_default.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/run_loop.h"
14 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
15 #include "base/synchronization/waitable_event.h" 16 #include "base/synchronization/waitable_event.h"
16 #include "base/threading/simple_thread.h" 17 #include "base/threading/simple_thread.h"
17 #include "services/catalog/store.h" 18 #include "services/catalog/store.h"
18 #include "services/shell/connect_params.h" 19 #include "services/shell/connect_params.h"
19 #include "services/shell/public/cpp/service.h" 20 #include "services/shell/public/cpp/service.h"
20 #include "services/shell/public/cpp/service_context.h" 21 #include "services/shell/public/cpp/service_context.h"
21 #include "services/shell/service_manager.h" 22 #include "services/shell/service_manager.h"
22 #include "services/shell/standalone/context.h" 23 #include "services/shell/standalone/context.h"
23 24
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 104 }
104 if (context_init_params->init_edk) 105 if (context_init_params->init_edk)
105 Context::EnsureEmbedderIsInitialized(); 106 Context::EnsureEmbedderIsInitialized();
106 107
107 message_loop_->BindToCurrentThread(); 108 message_loop_->BindToCurrentThread();
108 109
109 std::unique_ptr<Context> context(new Context); 110 std::unique_ptr<Context> context(new Context);
110 context_ = context.get(); 111 context_ = context.get();
111 context_->Init(std::move(context_init_params)); 112 context_->Init(std::move(context_init_params));
112 113
113 message_loop_->Run(); 114 base::RunLoop().Run();
114 115
115 // Has to happen after run, but while messageloop still valid. 116 // Has to happen after run, but while messageloop still valid.
116 context_->Shutdown(); 117 context_->Shutdown();
117 118
118 // Context has to be destroyed after the MessageLoop has been destroyed. 119 // Context has to be destroyed after the MessageLoop has been destroyed.
119 message_loop.reset(); 120 message_loop.reset();
120 context_ = nullptr; 121 context_ = nullptr;
121 } 122 }
122 123
123 private: 124 private:
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 169 }
169 170
170 void BackgroundShell::ExecuteOnServiceManagerThread( 171 void BackgroundShell::ExecuteOnServiceManagerThread(
171 const ServiceManagerThreadCallback& callback) { 172 const ServiceManagerThreadCallback& callback) {
172 thread_->message_loop()->task_runner()->PostTask( 173 thread_->message_loop()->task_runner()->PostTask(
173 FROM_HERE, base::Bind(&MojoThread::RunServiceManagerCallback, 174 FROM_HERE, base::Bind(&MojoThread::RunServiceManagerCallback,
174 base::Unretained(thread_.get()), callback)); 175 base::Unretained(thread_.get()), callback));
175 } 176 }
176 177
177 } // namespace shell 178 } // namespace shell
OLDNEW
« no previous file with comments | « remoting/host/host_status_logger_unittest.cc ('k') | sync/internal_api/public/attachments/task_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698