| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "mojo/public/utility/environment.h" | |
| 6 | |
| 7 #include "mojo/public/utility/bindings_support_impl.h" | |
| 8 #include "mojo/public/utility/run_loop.h" | |
| 9 | |
| 10 namespace mojo { | |
| 11 | |
| 12 Environment::Environment() : bindings_support_(NULL) { | |
| 13 RunLoop::SetUp(); | |
| 14 | |
| 15 internal::BindingsSupportImpl::SetUp(); | |
| 16 bindings_support_ = new internal::BindingsSupportImpl; | |
| 17 BindingsSupport::Set(bindings_support_); | |
| 18 } | |
| 19 | |
| 20 Environment::~Environment() { | |
| 21 // Allow for someone to have replaced BindingsSupport. | |
| 22 if (BindingsSupport::Get() == bindings_support_) | |
| 23 BindingsSupport::Set(NULL); | |
| 24 delete bindings_support_; | |
| 25 internal::BindingsSupportImpl::TearDown(); | |
| 26 | |
| 27 RunLoop::TearDown(); | |
| 28 } | |
| 29 | |
| 30 } // namespace mojo | |
| OLD | NEW |