mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Use DCHECK_IS_ON() instead of !NDEBUG for debug logic (issue #1961)
This commit is contained in:
@@ -15,14 +15,14 @@
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
base::AtomicRefCount CefBrowserContext::DebugObjCt = 0;
|
||||
#endif
|
||||
|
||||
CefBrowserContext::CefBrowserContext(bool is_proxy)
|
||||
: is_proxy_(is_proxy),
|
||||
extension_system_(NULL) {
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
base::AtomicRefCountInc(&DebugObjCt);
|
||||
#endif
|
||||
}
|
||||
@@ -31,7 +31,7 @@ CefBrowserContext::~CefBrowserContext() {
|
||||
// Should be cleared in Shutdown().
|
||||
DCHECK(!resource_context_.get());
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
base::AtomicRefCountDec(&DebugObjCt);
|
||||
#endif
|
||||
}
|
||||
|
@@ -171,7 +171,7 @@ class CefBrowserContext
|
||||
return extension_system_;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
// Simple tracking of allocated objects.
|
||||
static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int)
|
||||
#endif
|
||||
|
@@ -347,7 +347,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
// Verify that no request for the same route is currently queued.
|
||||
{
|
||||
PendingNewBrowserInfoList::const_iterator it =
|
||||
@@ -408,7 +408,7 @@ void CefBrowserInfoManager::DestroyAllBrowsers() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
{
|
||||
// Verify that all browser windows have been destroyed.
|
||||
base::AutoLock lock_scope(browser_info_lock_);
|
||||
|
@@ -229,7 +229,7 @@ void CefBrowserMainParts::PostMainMessageLoopRun() {
|
||||
|
||||
global_browser_context_ = NULL;
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
// No CefBrowserContext instances should exist at this point.
|
||||
DCHECK_EQ(0, CefBrowserContext::DebugObjCt);
|
||||
#endif
|
||||
@@ -241,7 +241,7 @@ void CefBrowserMainParts::PostDestroyThreads() {
|
||||
delete views::ViewsDelegate::GetInstance();
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
// No CefURLRequestContext instances should exist at this point.
|
||||
DCHECK_EQ(0, CefURLRequestContext::DebugObjCt);
|
||||
#endif
|
||||
|
@@ -762,13 +762,13 @@ void CefMenuModelImpl::InsertItemAt(const Item& item, int index) {
|
||||
}
|
||||
|
||||
void CefMenuModelImpl::ValidateItem(const Item& item) {
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
if (item.type_ == MENUITEMTYPE_SEPARATOR) {
|
||||
DCHECK_EQ(item.command_id_, kSeparatorId);
|
||||
} else {
|
||||
DCHECK_GE(item.command_id_, 0);
|
||||
}
|
||||
#endif // NDEBUG
|
||||
#endif
|
||||
}
|
||||
|
||||
void CefMenuModelImpl::OnMenuClosed() {
|
||||
|
@@ -4,18 +4,18 @@
|
||||
|
||||
#include "libcef/browser/net/url_request_context.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
base::AtomicRefCount CefURLRequestContext::DebugObjCt = 0;
|
||||
#endif
|
||||
|
||||
CefURLRequestContext::CefURLRequestContext() {
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
base::AtomicRefCountInc(&DebugObjCt);
|
||||
#endif
|
||||
}
|
||||
|
||||
CefURLRequestContext::~CefURLRequestContext() {
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
base::AtomicRefCountDec(&DebugObjCt);
|
||||
#endif
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#define CEF_LIBCEF_BROWSER_NET_URL_REQUEST_CONTEXT_H_
|
||||
#pragma once
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "net/url_request/url_request_context.h"
|
||||
|
||||
// Owns URLRequest instances and provides access to network-related
|
||||
@@ -18,7 +19,7 @@ class CefURLRequestContext : public net::URLRequestContext {
|
||||
CefURLRequestContext();
|
||||
~CefURLRequestContext() override;
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
// Simple tracking of allocated objects.
|
||||
static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int)
|
||||
#endif
|
||||
|
@@ -274,7 +274,7 @@ net::URLRequestJob* CefURLRequestManager::GetRequestJob(
|
||||
job = GetBuiltinSchemeRequestJob(request, network_delegate, scheme);
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if DCHECK_IS_ON()
|
||||
if (job)
|
||||
DLOG(INFO) << "CefURLRequestManager hit for " << request->url().spec();
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user