mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-27 10:03:31 +01:00
17fc2b3e3b
- Convert scoped_ptr to std::unique_ptr from <memory> - Convert arraysize to base::size from include/base/cef_cxx17_backports.h - Convert NULL to nullptr - Include include/base/cef_callback.h instead of include/base/cef_bind.h - Implicit conversion of CefRefPtr<T> or scoped_refptr<T> to T* is gone; use .get() instead See the issue for additional details.
46 lines
834 B
C++
46 lines
834 B
C++
// Copyright (c) 2019 The Chromium Embedded Framework 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 "libcef_dll/shutdown_checker.h"
|
|
|
|
#include <atomic>
|
|
|
|
#include "include/base/cef_logging.h"
|
|
|
|
namespace shutdown_checker {
|
|
|
|
#if DCHECK_IS_ON()
|
|
|
|
namespace {
|
|
|
|
std::atomic_bool g_cef_shutdown{false};
|
|
|
|
bool IsCefShutdown() {
|
|
return g_cef_shutdown.load();
|
|
}
|
|
|
|
void SetCefShutdown() {
|
|
g_cef_shutdown.store(true);
|
|
}
|
|
|
|
} // namespace
|
|
|
|
void AssertNotShutdown() {
|
|
DCHECK(!IsCefShutdown())
|
|
<< "Object reference incorrectly held at CefShutdown";
|
|
}
|
|
|
|
void SetIsShutdown() {
|
|
DCHECK(!IsCefShutdown());
|
|
SetCefShutdown();
|
|
}
|
|
|
|
#else // !DCHECK_IS_ON()
|
|
|
|
void AssertNotShutdown() {}
|
|
|
|
#endif // !DCHECK_IS_ON()
|
|
|
|
} // namespace shutdown_checker
|