OLD | NEW |
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 "mojo/public/cpp/application/run_application.h" | 5 #include "mojo/public/cpp/application/run_application.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 TerminateApplication(result); | 79 TerminateApplication(result); |
80 } | 80 } |
81 | 81 |
82 void TerminateApplication(MojoResult result) { | 82 void TerminateApplication(MojoResult result) { |
83 DCHECK(base::MessageLoop::current()->is_running()); | 83 DCHECK(base::MessageLoop::current()->is_running()); |
84 base::MessageLoop::current()->Quit(); | 84 base::MessageLoop::current()->Quit(); |
85 | 85 |
86 ResultHolder* result_holder = | 86 ResultHolder* result_holder = |
87 static_cast<ResultHolder*>(g_current_result_holder.Get()); | 87 static_cast<ResultHolder*>(g_current_result_holder.Get()); |
88 DCHECK(result_holder); | 88 DCHECK(result_holder); |
89 DCHECK(!result_holder->is_set); | |
90 result_holder->result = result; | 89 result_holder->result = result; |
91 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) | 90 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) |
| 91 DCHECK(!result_holder->is_set); |
92 result_holder->is_set = true; | 92 result_holder->is_set = true; |
93 #endif | 93 #endif |
94 } | 94 } |
95 | 95 |
96 } // namespace mojo | 96 } // namespace mojo |
OLD | NEW |