cef/libcef/browser/scheme_impl.cc
Marshall Greenblatt dc9e64308a Replace NOTREACHED() with DCHECK(false) (fixes #3500)
Restores the old behavior of assertion in Debug build only.
2023-05-08 18:36:00 +03:00

33 lines
979 B
C++

// Copyright (c) 2015 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 "include/cef_scheme.h"
#include "libcef/browser/context.h"
#include "base/logging.h"
bool CefRegisterSchemeHandlerFactory(
const CefString& scheme_name,
const CefString& domain_name,
CefRefPtr<CefSchemeHandlerFactory> factory) {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
return false;
}
return CefRequestContext::GetGlobalContext()->RegisterSchemeHandlerFactory(
scheme_name, domain_name, factory);
}
bool CefClearSchemeHandlerFactories() {
// Verify that the context is in a valid state.
if (!CONTEXT_STATE_VALID()) {
DCHECK(false) << "context not valid";
return false;
}
return CefRequestContext::GetGlobalContext()->ClearSchemeHandlerFactories();
}