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

Side by Side Diff: mojo/runner/context.cc

Issue 1501343002: Prepare chrome to use the new Mojo EDK by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable turning on in this cl Created 5 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/runner/context.h" 5 #include "mojo/runner/context.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 void Context::Shutdown() { 281 void Context::Shutdown() {
282 // Actions triggered by ApplicationManager's destructor may require a current 282 // Actions triggered by ApplicationManager's destructor may require a current
283 // message loop, so we should destruct it explicitly now as ~Context() occurs 283 // message loop, so we should destruct it explicitly now as ~Context() occurs
284 // post message loop shutdown. 284 // post message loop shutdown.
285 application_manager_.reset(); 285 application_manager_.reset();
286 286
287 TRACE_EVENT0("mojo_shell", "Context::Shutdown"); 287 TRACE_EVENT0("mojo_shell", "Context::Shutdown");
288 DCHECK_EQ(base::MessageLoop::current()->task_runner(), 288 DCHECK_EQ(base::MessageLoop::current()->task_runner(),
289 task_runners_->shell_runner()); 289 task_runners_->shell_runner());
290 embedder::ShutdownIPCSupport(); 290 // Post a task in case OnShutdownComplete is called synchronously.
291 base::MessageLoop::current()->PostTask(
292 FROM_HERE, base::Bind(embedder::ShutdownIPCSupport));
291 // We'll quit when we get OnShutdownComplete(). 293 // We'll quit when we get OnShutdownComplete().
292 base::MessageLoop::current()->Run(); 294 base::MessageLoop::current()->Run();
293 } 295 }
294 296
295 void Context::OnShutdownComplete() { 297 void Context::OnShutdownComplete() {
296 DCHECK_EQ(base::MessageLoop::current()->task_runner(), 298 DCHECK_EQ(base::MessageLoop::current()->task_runner(),
297 task_runners_->shell_runner()); 299 task_runners_->shell_runner());
298 base::MessageLoop::current()->QuitWhenIdle(); 300 base::MessageLoop::current()->QuitWhenIdle();
299 } 301 }
300 302
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 base::MessageLoop::current()->QuitWhenIdle(); 343 base::MessageLoop::current()->QuitWhenIdle();
342 } else { 344 } else {
343 app_complete_callback_.Run(); 345 app_complete_callback_.Run();
344 } 346 }
345 } 347 }
346 } 348 }
347 } 349 }
348 350
349 } // namespace runner 351 } // namespace runner
350 } // namespace mojo 352 } // namespace mojo
OLDNEW
« content/test/run_all_unittests.cc ('K') | « mojo/message_pump/handle_watcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698