flutter_flutter/mojo/edk/embedder/test_embedder.cc
James Robinson 5bb2480bcd Update to Mojo 4e4d51ce28a8edcb32b9c7f555e38e2ae84a825e, update deps
This updates to mojo 4e4d51ce28a and mojo sdk 711a0bcfb141b4 and updates the sky
package's pubspec.yaml dependency to '>=0.1.0 <0.2.0' to be compatible with
the current mojo package. This includes an update to the Mojo Dart generator to
produce real classes for enums and the corresponding updates for users of the
KeyboardType enum in Sky as well as one scoped_ptr->std::unique_ptr in shell
corresponding to a change in the Mojo EDK.

When a new version of the sky and sky_services package are pushed this will fix
domokit/mojo#440.
2015-09-23 17:26:46 -07:00

68 lines
1.7 KiB
C++

// 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/edk/embedder/test_embedder.h"
#include "base/logging.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/embedder_internal.h"
#include "mojo/edk/embedder/simple_platform_support.h"
#include "mojo/edk/system/channel_manager.h"
#include "mojo/edk/system/core.h"
#include "mojo/edk/system/handle_table.h"
#include "mojo/edk/util/make_unique.h"
namespace mojo {
namespace system {
namespace internal {
bool ShutdownCheckNoLeaks(Core* core) {
// No point in taking the lock.
const HandleTable::HandleToEntryMap& handle_to_entry_map =
core->handle_table_.handle_to_entry_map_;
if (handle_to_entry_map.empty())
return true;
for (HandleTable::HandleToEntryMap::const_iterator it =
handle_to_entry_map.begin();
it != handle_to_entry_map.end(); ++it) {
LOG(ERROR) << "Mojo embedder shutdown: Leaking handle " << (*it).first;
}
return false;
}
} // namespace internal
} // namespace system
namespace embedder {
namespace test {
void InitWithSimplePlatformSupport() {
Init(util::MakeUnique<SimplePlatformSupport>());
}
bool Shutdown() {
// If |InitIPCSupport()| was called, then |ShutdownIPCSupport()| must have
// been called first.
CHECK(!internal::g_ipc_support);
CHECK(internal::g_core);
bool rv = system::internal::ShutdownCheckNoLeaks(internal::g_core);
delete internal::g_core;
internal::g_core = nullptr;
CHECK(internal::g_platform_support);
delete internal::g_platform_support;
internal::g_platform_support = nullptr;
return rv;
}
} // namespace test
} // namespace embedder
} // namespace mojo