| 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/edk/embedder/test_embedder.h" | 5 #include "mojo/edk/embedder/test_embedder.h" | 
| 6 | 6 | 
| 7 #include "base/logging.h" | 7 #include "base/logging.h" | 
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" | 
| 9 #include "mojo/edk/embedder/embedder.h" | 9 #include "mojo/edk/embedder/embedder.h" | 
| 10 #include "mojo/edk/embedder/embedder_internal.h" | 10 #include "mojo/edk/embedder/embedder_internal.h" | 
| 11 #include "mojo/edk/embedder/platform_support.h" | 11 #include "mojo/edk/embedder/platform_support.h" | 
|  | 12 #include "mojo/edk/system/broker.h" | 
| 12 #include "mojo/edk/system/core.h" | 13 #include "mojo/edk/system/core.h" | 
| 13 #include "mojo/edk/system/handle_table.h" | 14 #include "mojo/edk/system/handle_table.h" | 
| 14 | 15 | 
| 15 #if defined(OS_WIN) |  | 
| 16 #include "mojo/edk/system/token_serializer_win.h" |  | 
| 17 #endif |  | 
| 18 |  | 
| 19 namespace mojo { | 16 namespace mojo { | 
| 20 | 17 | 
| 21 namespace edk { | 18 namespace edk { | 
| 22 namespace internal { | 19 namespace internal { | 
| 23 | 20 | 
| 24 bool ShutdownCheckNoLeaks(Core* core) { | 21 bool ShutdownCheckNoLeaks(Core* core) { | 
| 25   // No point in taking the lock. | 22   // No point in taking the lock. | 
| 26   const HandleTable::HandleToEntryMap& handle_to_entry_map = | 23   const HandleTable::HandleToEntryMap& handle_to_entry_map = | 
| 27       core->handle_table_.handle_to_entry_map_; | 24       core->handle_table_.handle_to_entry_map_; | 
| 28 | 25 | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 44 bool Shutdown() { | 41 bool Shutdown() { | 
| 45   CHECK(internal::g_core); | 42   CHECK(internal::g_core); | 
| 46   bool rv = internal::ShutdownCheckNoLeaks(internal::g_core); | 43   bool rv = internal::ShutdownCheckNoLeaks(internal::g_core); | 
| 47   delete internal::g_core; | 44   delete internal::g_core; | 
| 48   internal::g_core = nullptr; | 45   internal::g_core = nullptr; | 
| 49 | 46 | 
| 50   CHECK(internal::g_platform_support); | 47   CHECK(internal::g_platform_support); | 
| 51   delete internal::g_platform_support; | 48   delete internal::g_platform_support; | 
| 52   internal::g_platform_support = nullptr; | 49   internal::g_platform_support = nullptr; | 
| 53 | 50 | 
| 54 #if defined(OS_WIN) | 51   CHECK(internal::g_broker); | 
| 55   CHECK(internal::g_token_serializer); | 52   delete internal::g_broker; | 
| 56   delete internal::g_token_serializer; | 53   internal::g_broker = nullptr; | 
| 57   internal::g_token_serializer = nullptr; |  | 
| 58 #endif |  | 
| 59 | 54 | 
| 60   return rv; | 55   return rv; | 
| 61 } | 56 } | 
| 62 | 57 | 
| 63 }  // namespace test | 58 }  // namespace test | 
| 64 }  // namespace edk | 59 }  // namespace edk | 
| 65 | 60 | 
| 66 }  // namespace mojo | 61 }  // namespace mojo | 
| OLD | NEW | 
|---|