Chromium Code Reviews| Index: mojo/environment/default_run_loop_impl.cc |
| diff --git a/mojo/environment/default_run_loop_impl.cc b/mojo/environment/default_run_loop_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4fa9ffd1f46574b2b593acdf53336ff9fea9e217 |
| --- /dev/null |
| +++ b/mojo/environment/default_run_loop_impl.cc |
| @@ -0,0 +1,27 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "mojo/environment/default_run_loop_impl.h" |
| + |
| +#include "base/logging.h" |
| +#include "base/message_loop/message_loop.h" |
| + |
| +namespace mojo { |
| +namespace internal { |
| + |
| +void InstantiateDefaultRunLoopImpl() { |
| + CHECK(!base::MessageLoop::current()); |
|
jamesr
2014/11/11 22:34:37
there's already a DCHECK in MessageLoop that cover
msw
2014/11/11 23:00:07
Done.
|
| + // Not leaked: accessible from |base::MessageLoop::current()|. |
| + base::MessageLoop* message_loop = new base::MessageLoop(); |
| + CHECK_EQ(message_loop, base::MessageLoop::current()); |
|
jamesr
2014/11/11 22:34:37
this is over-checking. a post-condition of the Mes
msw
2014/11/11 23:00:07
Done.
|
| +} |
| + |
| +void DestroyDefaultRunLoopImpl() { |
| + CHECK(base::MessageLoop::current()); |
|
jamesr
2014/11/11 22:34:37
ditto
msw
2014/11/11 23:00:07
Done.
|
| + delete base::MessageLoop::current(); |
|
jamesr
2014/11/11 22:34:37
this is icky. do you expect people to be calling t
msw
2014/11/11 23:00:07
For now, this is used by ApplicationTestBase and a
|
| + CHECK(!base::MessageLoop::current()); |
|
jamesr
2014/11/11 22:34:37
more over-checking
msw
2014/11/11 23:00:07
Done.
|
| +} |
| + |
| +} // namespace internal |
| +} // namespace mojo |