| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/environment/environment.h" | 5 #include "mojo/public/cpp/environment/environment.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "mojo/environment/default_async_waiter.h" | 8 #include "mojo/environment/default_async_waiter.h" |
| 9 #include "mojo/environment/default_logger.h" | 9 #include "mojo/environment/default_logger.h" |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 const MojoAsyncWaiter* Environment::GetDefaultAsyncWaiter() { | 28 const MojoAsyncWaiter* Environment::GetDefaultAsyncWaiter() { |
| 29 return &internal::kDefaultAsyncWaiter; | 29 return &internal::kDefaultAsyncWaiter; |
| 30 } | 30 } |
| 31 | 31 |
| 32 // static | 32 // static |
| 33 const MojoLogger* Environment::GetDefaultLogger() { | 33 const MojoLogger* Environment::GetDefaultLogger() { |
| 34 return &internal::kDefaultLogger; | 34 return &internal::kDefaultLogger; |
| 35 } | 35 } |
| 36 | 36 |
| 37 // static | 37 // static |
| 38 void Environment::SetDefaultLogger(const MojoLogger* logger) {} |
| 39 |
| 40 // static |
| 38 void Environment::InstantiateDefaultRunLoop() { | 41 void Environment::InstantiateDefaultRunLoop() { |
| 39 CHECK(!base::MessageLoop::current()); | 42 CHECK(!base::MessageLoop::current()); |
| 40 // Not leaked: accessible from |base::MessageLoop::current()|. | 43 // Not leaked: accessible from |base::MessageLoop::current()|. |
| 41 base::MessageLoop* message_loop = new base::MessageLoop(); | 44 base::MessageLoop* message_loop = new base::MessageLoop(); |
| 42 CHECK_EQ(message_loop, base::MessageLoop::current()); | 45 CHECK_EQ(message_loop, base::MessageLoop::current()); |
| 43 } | 46 } |
| 44 | 47 |
| 45 // static | 48 // static |
| 46 void Environment::DestroyDefaultRunLoop() { | 49 void Environment::DestroyDefaultRunLoop() { |
| 47 CHECK(base::MessageLoop::current()); | 50 CHECK(base::MessageLoop::current()); |
| 48 delete base::MessageLoop::current(); | 51 delete base::MessageLoop::current(); |
| 49 CHECK(!base::MessageLoop::current()); | 52 CHECK(!base::MessageLoop::current()); |
| 50 } | 53 } |
| 51 | 54 |
| 52 } // namespace mojo | 55 } // namespace mojo |
| OLD | NEW |