mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Introduce the use of Chromium types (issue #1336).
- Move include/cef_build.h to include/base/cef_build.h. - Move libcef_dll/cef_macros.h to include/base/cef_macros.h. - Move include/cef_trace_event.h to include/base/cef_trace_event.h and include/internal/cef_trace_event_internal.h. - Remove the "CEF_" prefix from TRACE macros. - Add new include/base/cef_logging.h and include/internal/cef_logging_internal.h for logging support. - Add new include/wrapper/cef_helpers.h for CEF_REQUIRE_*_THREAD macros and CefScopedArgArray. - Delete the util.h headers used by tests that duplicated the above functionality. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1767 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
257
libcef_dll/base/cef_logging.cc
Normal file
257
libcef_dll/base/cef_logging.cc
Normal file
@@ -0,0 +1,257 @@
|
||||
// Copyright (c) 2014 The Chromium Embedded Framework Authors.
|
||||
// Portions copyright (c) 2011 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 "include/base/cef_logging.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include <windows.h>
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
#elif defined(OS_POSIX)
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "include/internal/cef_string_types.h"
|
||||
|
||||
namespace cef_logging {
|
||||
|
||||
namespace {
|
||||
|
||||
#if defined(OS_POSIX)
|
||||
// From base/safe_strerror_posix.cc.
|
||||
|
||||
#define USE_HISTORICAL_STRERRO_R (defined(__GLIBC__) || defined(OS_NACL))
|
||||
|
||||
#if USE_HISTORICAL_STRERRO_R && defined(__GNUC__)
|
||||
// GCC will complain about the unused second wrap function unless we tell it
|
||||
// that we meant for them to be potentially unused, which is exactly what this
|
||||
// attribute is for.
|
||||
#define POSSIBLY_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define POSSIBLY_UNUSED
|
||||
#endif
|
||||
|
||||
#if USE_HISTORICAL_STRERRO_R
|
||||
// glibc has two strerror_r functions: a historical GNU-specific one that
|
||||
// returns type char *, and a POSIX.1-2001 compliant one available since 2.3.4
|
||||
// that returns int. This wraps the GNU-specific one.
|
||||
static void POSSIBLY_UNUSED wrap_posix_strerror_r(
|
||||
char *(*strerror_r_ptr)(int, char *, size_t),
|
||||
int err,
|
||||
char *buf,
|
||||
size_t len) {
|
||||
// GNU version.
|
||||
char *rc = (*strerror_r_ptr)(err, buf, len);
|
||||
if (rc != buf) {
|
||||
// glibc did not use buf and returned a static string instead. Copy it
|
||||
// into buf.
|
||||
buf[0] = '\0';
|
||||
strncat(buf, rc, len - 1);
|
||||
}
|
||||
// The GNU version never fails. Unknown errors get an "unknown error" message.
|
||||
// The result is always null terminated.
|
||||
}
|
||||
#endif // USE_HISTORICAL_STRERRO_R
|
||||
|
||||
// Wrapper for strerror_r functions that implement the POSIX interface. POSIX
|
||||
// does not define the behaviour for some of the edge cases, so we wrap it to
|
||||
// guarantee that they are handled. This is compiled on all POSIX platforms, but
|
||||
// it will only be used on Linux if the POSIX strerror_r implementation is
|
||||
// being used (see below).
|
||||
static void POSSIBLY_UNUSED wrap_posix_strerror_r(
|
||||
int (*strerror_r_ptr)(int, char *, size_t),
|
||||
int err,
|
||||
char *buf,
|
||||
size_t len) {
|
||||
int old_errno = errno;
|
||||
// Have to cast since otherwise we get an error if this is the GNU version
|
||||
// (but in such a scenario this function is never called). Sadly we can't use
|
||||
// C++-style casts because the appropriate one is reinterpret_cast but it's
|
||||
// considered illegal to reinterpret_cast a type to itself, so we get an
|
||||
// error in the opposite case.
|
||||
int result = (*strerror_r_ptr)(err, buf, len);
|
||||
if (result == 0) {
|
||||
// POSIX is vague about whether the string will be terminated, although
|
||||
// it indirectly implies that typically ERANGE will be returned, instead
|
||||
// of truncating the string. We play it safe by always terminating the
|
||||
// string explicitly.
|
||||
buf[len - 1] = '\0';
|
||||
} else {
|
||||
// Error. POSIX is vague about whether the return value is itself a system
|
||||
// error code or something else. On Linux currently it is -1 and errno is
|
||||
// set. On BSD-derived systems it is a system error and errno is unchanged.
|
||||
// We try and detect which case it is so as to put as much useful info as
|
||||
// we can into our message.
|
||||
int strerror_error; // The error encountered in strerror
|
||||
int new_errno = errno;
|
||||
if (new_errno != old_errno) {
|
||||
// errno was changed, so probably the return value is just -1 or something
|
||||
// else that doesn't provide any info, and errno is the error.
|
||||
strerror_error = new_errno;
|
||||
} else {
|
||||
// Either the error from strerror_r was the same as the previous value, or
|
||||
// errno wasn't used. Assume the latter.
|
||||
strerror_error = result;
|
||||
}
|
||||
// snprintf truncates and always null-terminates.
|
||||
snprintf(buf,
|
||||
len,
|
||||
"Error %d while retrieving error %d",
|
||||
strerror_error,
|
||||
err);
|
||||
}
|
||||
errno = old_errno;
|
||||
}
|
||||
|
||||
void safe_strerror_r(int err, char *buf, size_t len) {
|
||||
if (buf == NULL || len <= 0) {
|
||||
return;
|
||||
}
|
||||
// If using glibc (i.e., Linux), the compiler will automatically select the
|
||||
// appropriate overloaded function based on the function type of strerror_r.
|
||||
// The other one will be elided from the translation unit since both are
|
||||
// static.
|
||||
wrap_posix_strerror_r(&strerror_r, err, buf, len);
|
||||
}
|
||||
|
||||
std::string safe_strerror(int err) {
|
||||
const int buffer_size = 256;
|
||||
char buf[buffer_size];
|
||||
safe_strerror_r(err, buf, sizeof(buf));
|
||||
return std::string(buf);
|
||||
}
|
||||
#endif // defined(OS_POSIX)
|
||||
|
||||
} // namespace
|
||||
|
||||
// MSVC doesn't like complex extern templates and DLLs.
|
||||
#if !defined(COMPILER_MSVC)
|
||||
// Explicit instantiations for commonly used comparisons.
|
||||
template std::string* MakeCheckOpString<int, int>(
|
||||
const int&, const int&, const char* names);
|
||||
template std::string* MakeCheckOpString<unsigned long, unsigned long>(
|
||||
const unsigned long&, const unsigned long&, const char* names);
|
||||
template std::string* MakeCheckOpString<unsigned long, unsigned int>(
|
||||
const unsigned long&, const unsigned int&, const char* names);
|
||||
template std::string* MakeCheckOpString<unsigned int, unsigned long>(
|
||||
const unsigned int&, const unsigned long&, const char* names);
|
||||
template std::string* MakeCheckOpString<std::string, std::string>(
|
||||
const std::string&, const std::string&, const char* name);
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
LogMessage::SaveLastError::SaveLastError() : last_error_(::GetLastError()) {
|
||||
}
|
||||
|
||||
LogMessage::SaveLastError::~SaveLastError() {
|
||||
::SetLastError(last_error_);
|
||||
}
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
LogMessage::LogMessage(const char* file, int line, LogSeverity severity)
|
||||
: severity_(severity), file_(file), line_(line) {
|
||||
}
|
||||
|
||||
LogMessage::LogMessage(const char* file, int line, std::string* result)
|
||||
: severity_(LOG_FATAL), file_(file), line_(line) {
|
||||
stream_ << "Check failed: " << *result;
|
||||
delete result;
|
||||
}
|
||||
|
||||
LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
|
||||
std::string* result)
|
||||
: severity_(severity), file_(file), line_(line) {
|
||||
stream_ << "Check failed: " << *result;
|
||||
delete result;
|
||||
}
|
||||
|
||||
LogMessage::~LogMessage() {
|
||||
stream_ << std::endl;
|
||||
std::string str_newline(stream_.str());
|
||||
cef_log(file_, line_, severity_, str_newline.c_str());
|
||||
}
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// This has already been defined in the header, but defining it again as DWORD
|
||||
// ensures that the type used in the header is equivalent to DWORD. If not,
|
||||
// the redefinition is a compile error.
|
||||
typedef DWORD SystemErrorCode;
|
||||
#endif
|
||||
|
||||
SystemErrorCode GetLastSystemErrorCode() {
|
||||
#if defined(OS_WIN)
|
||||
return ::GetLastError();
|
||||
#elif defined(OS_POSIX)
|
||||
return errno;
|
||||
#else
|
||||
#error Not implemented
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(OS_WIN)
|
||||
std::string SystemErrorCodeToString(SystemErrorCode error_code) {
|
||||
const int error_message_buffer_size = 256;
|
||||
char msgbuf[error_message_buffer_size];
|
||||
DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS;
|
||||
DWORD len = FormatMessageA(flags, NULL, error_code, 0, msgbuf,
|
||||
arraysize(msgbuf), NULL);
|
||||
std::stringstream ss;
|
||||
if (len) {
|
||||
std::string s(msgbuf);
|
||||
// Messages returned by system end with line breaks.
|
||||
s.erase(std::remove_if(s.begin(), s.end(), ::isspace), s.end());
|
||||
ss << s << " (0x" << std::hex << error_code << ")";
|
||||
} else {
|
||||
ss << "Error (0x" << std::hex << GetLastError() <<
|
||||
") while retrieving error. (0x" << error_code << ")";
|
||||
}
|
||||
return ss.str();
|
||||
}
|
||||
#elif defined(OS_POSIX)
|
||||
std::string SystemErrorCodeToString(SystemErrorCode error_code) {
|
||||
return safe_strerror(error_code);
|
||||
}
|
||||
#else
|
||||
#error Not implemented
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
Win32ErrorLogMessage::Win32ErrorLogMessage(const char* file,
|
||||
int line,
|
||||
LogSeverity severity,
|
||||
SystemErrorCode err)
|
||||
: err_(err),
|
||||
log_message_(file, line, severity) {
|
||||
}
|
||||
|
||||
Win32ErrorLogMessage::~Win32ErrorLogMessage() {
|
||||
stream() << ": " << SystemErrorCodeToString(err_);
|
||||
}
|
||||
#elif defined(OS_POSIX)
|
||||
ErrnoLogMessage::ErrnoLogMessage(const char* file,
|
||||
int line,
|
||||
LogSeverity severity,
|
||||
SystemErrorCode err)
|
||||
: err_(err),
|
||||
log_message_(file, line, severity) {
|
||||
}
|
||||
|
||||
ErrnoLogMessage::~ErrnoLogMessage() {
|
||||
stream() << ": " << SystemErrorCodeToString(err_);
|
||||
}
|
||||
#endif // OS_WIN
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
|
||||
cef_string_utf8_t str = {0};
|
||||
std::wstring tmp_str(wstr);
|
||||
cef_string_wide_to_utf8(wstr, tmp_str.size(), &str);
|
||||
out << str.str;
|
||||
cef_string_utf8_clear(&str);
|
||||
return out;
|
||||
}
|
||||
|
||||
} // namespace cef_logging
|
@@ -1,35 +0,0 @@
|
||||
// Copyright (c) 2014 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.
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CEF_LOGGING_H_
|
||||
#define CEF_LIBCEF_DLL_CEF_LOGGING_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_task.h"
|
||||
|
||||
#ifdef BUILDING_CEF_SHARED
|
||||
#include "base/logging.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#include <assert.h> // NOLINT(build/include_order)
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define DCHECK(condition) assert(condition)
|
||||
#else
|
||||
#define DCHECK(condition) ((void)0)
|
||||
#endif
|
||||
|
||||
#define DCHECK_EQ(val1, val2) DCHECK(val1 == val2)
|
||||
#define DCHECK_NE(val1, val2) DCHECK(val1 != val2)
|
||||
#define DCHECK_LE(val1, val2) DCHECK(val1 <= val2)
|
||||
#define DCHECK_LT(val1, val2) DCHECK(val1 < val2)
|
||||
#define DCHECK_GE(val1, val2) DCHECK(val1 >= val2)
|
||||
#define DCHECK_GT(val1, val2) DCHECK(val1 > val2)
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
|
||||
#define CEF_REQUIRE_UI_THREAD() DCHECK(CefCurrentlyOn(TID_UI));
|
||||
#define CEF_REQUIRE_IO_THREAD() DCHECK(CefCurrentlyOn(TID_IO));
|
||||
#define CEF_REQUIRE_FILE_THREAD() DCHECK(CefCurrentlyOn(TID_FILE));
|
||||
#define CEF_REQUIRE_RENDERER_THREAD() DCHECK(CefCurrentlyOn(TID_RENDERER));
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CEF_LOGGING_H_
|
@@ -1,21 +0,0 @@
|
||||
// Copyright (c) 2014 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.
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CEF_MACROS_H_
|
||||
#define CEF_LIBCEF_DLL_CEF_MACROS_H_
|
||||
#pragma once
|
||||
|
||||
#ifdef BUILDING_CEF_SHARED
|
||||
#include "base/macros.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
|
||||
// A macro to disallow the copy constructor and operator= functions
|
||||
// This should be used in the private: declarations for a class
|
||||
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||
TypeName(const TypeName&); \
|
||||
void operator=(const TypeName&)
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CEF_MACROS_H_
|
@@ -6,10 +6,10 @@
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "libcef_dll/cef_logging.h"
|
||||
|
||||
|
||||
// CefCppToC implementation for CefBase.
|
||||
class CefBaseCppToC : public CefBase {
|
||||
@@ -137,10 +137,11 @@ class CefBaseCppToC : public CefBase {
|
||||
return impl->class_->GetRefCt();
|
||||
}
|
||||
|
||||
protected:
|
||||
CefRefCount refct_;
|
||||
Struct struct_;
|
||||
CefBase* class_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefBaseCppToC);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_
|
||||
|
@@ -6,9 +6,10 @@
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "libcef_dll/cef_logging.h"
|
||||
|
||||
|
||||
// Wrap a C++ class with a C structure. This is used when the class
|
||||
@@ -123,6 +124,11 @@ class CefCppToC : public CefBase {
|
||||
static long DebugObjCt; // NOLINT(runtime/int)
|
||||
#endif
|
||||
|
||||
protected:
|
||||
CefRefCount refct_;
|
||||
Struct struct_;
|
||||
BaseName* class_;
|
||||
|
||||
private:
|
||||
static int CEF_CALLBACK struct_add_ref(struct _cef_base_t* base) {
|
||||
DCHECK(base);
|
||||
@@ -151,10 +157,7 @@ class CefCppToC : public CefBase {
|
||||
return impl->class_->GetRefCt();
|
||||
}
|
||||
|
||||
protected:
|
||||
CefRefCount refct_;
|
||||
Struct struct_;
|
||||
BaseName* class_;
|
||||
DISALLOW_COPY_AND_ASSIGN(CefCppToC);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_
|
||||
|
@@ -6,9 +6,10 @@
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "libcef_dll/cef_logging.h"
|
||||
|
||||
|
||||
// CefCToCpp implementation for CefBase.
|
||||
@@ -89,9 +90,11 @@ class CefBaseCToCpp : public CefBase {
|
||||
return struct_->get_refct(struct_);
|
||||
}
|
||||
|
||||
protected:
|
||||
private:
|
||||
CefRefCount refct_;
|
||||
cef_base_t* struct_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefBaseCToCpp);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -21,7 +21,7 @@ CefRefPtr<CefCommandLine> CefCommandLine::CreateCommandLine() {
|
||||
const char* api_hash = cef_api_hash(0);
|
||||
if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) {
|
||||
// The libcef API hash does not match the current header API hash.
|
||||
DCHECK(false);
|
||||
NOTREACHED();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ CefRefPtr<CefCommandLine> CefCommandLine::GetGlobalCommandLine() {
|
||||
const char* api_hash = cef_api_hash(0);
|
||||
if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) {
|
||||
// The libcef API hash does not match the current header API hash.
|
||||
DCHECK(false);
|
||||
NOTREACHED();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -6,10 +6,10 @@
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "libcef_dll/cef_logging.h"
|
||||
|
||||
|
||||
// Wrap a C structure with a C++ class. This is used when the implementation
|
||||
// exists on the other side of the DLL boundary but will have methods called on
|
||||
@@ -108,6 +108,9 @@ class CefCToCpp : public BaseName {
|
||||
protected:
|
||||
CefRefCount refct_;
|
||||
StructName* struct_;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(CefCToCpp);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_
|
||||
|
@@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
#include "include/cef_version.h"
|
||||
#include "cef_logging.h"
|
||||
#include <cstddef>
|
||||
|
||||
CEF_EXPORT int cef_build_revision() {
|
||||
return CEF_REVISION;
|
||||
|
@@ -7,8 +7,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include "libcef_dll/cef_logging.h"
|
||||
#include "libcef_dll/cef_macros.h"
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
|
||||
// Default traits for CefBrowserInfoMap. Override to provide different object
|
||||
// destruction behavior.
|
||||
@@ -61,7 +62,7 @@ class CefBrowserInfoMap {
|
||||
} else {
|
||||
info_map = it_browser->second;
|
||||
// The specified ID should not already exist in the map.
|
||||
DCHECK_EQ(info_map->find(info_id), info_map->end());
|
||||
DCHECK(info_map->find(info_id) == info_map->end());
|
||||
}
|
||||
|
||||
info_map->insert(std::make_pair(info_id, info));
|
||||
|
@@ -3,10 +3,10 @@
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#include "include/wrapper/cef_byte_read_handler.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include "libcef_dll/cef_logging.h"
|
||||
|
||||
CefByteReadHandler::CefByteReadHandler(const unsigned char* bytes, size_t size,
|
||||
CefRefPtr<CefBase> source)
|
||||
|
@@ -7,10 +7,10 @@
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_runnable.h"
|
||||
#include "include/cef_task.h"
|
||||
#include "libcef_dll/cef_logging.h"
|
||||
#include "libcef_dll/cef_macros.h"
|
||||
#include "include/wrapper/cef_helpers.h"
|
||||
#include "libcef_dll/wrapper/cef_browser_info_map.h"
|
||||
|
||||
namespace {
|
||||
|
@@ -3,12 +3,16 @@
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#include "include/wrapper/cef_stream_resource_handler.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_callback.h"
|
||||
#include "include/cef_request.h"
|
||||
#include "include/cef_runnable.h"
|
||||
#include "include/cef_stream.h"
|
||||
#include "libcef_dll/cef_logging.h"
|
||||
#include "include/wrapper/cef_helpers.h"
|
||||
|
||||
// Class that represents a readable/writable character buffer.
|
||||
class CefStreamResourceHandler::Buffer {
|
||||
@@ -77,6 +81,8 @@ class CefStreamResourceHandler::Buffer {
|
||||
int bytes_requested_;
|
||||
int bytes_written_;
|
||||
int bytes_read_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Buffer);
|
||||
};
|
||||
|
||||
CefStreamResourceHandler::CefStreamResourceHandler(
|
||||
|
@@ -3,10 +3,13 @@
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#include "include/wrapper/cef_xml_object.h"
|
||||
#include "include/cef_stream.h"
|
||||
#include "libcef_dll/cef_logging.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_stream.h"
|
||||
|
||||
namespace {
|
||||
|
||||
class CefXmlObjectLoader {
|
||||
@@ -102,7 +105,7 @@ class CefXmlObjectLoader {
|
||||
cur_object->GetName() != reader->GetQualifiedName()) {
|
||||
// Open tag without close tag or close tag without open tag should
|
||||
// never occur (the parser catches this error).
|
||||
DCHECK(false);
|
||||
NOTREACHED();
|
||||
std::stringstream ss;
|
||||
ss << "Mismatched end tag for " <<
|
||||
std::string(cur_object->GetName()) <<
|
||||
@@ -149,6 +152,8 @@ class CefXmlObjectLoader {
|
||||
private:
|
||||
CefString load_error_;
|
||||
CefRefPtr<CefXmlObject> root_object_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefXmlObjectLoader);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
@@ -2,17 +2,20 @@
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "include/wrapper/cef_zip_archive.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include "include/wrapper/cef_zip_archive.h"
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_stream.h"
|
||||
#include "include/cef_zip_reader.h"
|
||||
#include "include/wrapper/cef_byte_read_handler.h"
|
||||
#include "libcef_dll/cef_logging.h"
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
|
@@ -122,7 +122,7 @@ CEF_GLOBAL int CefExecuteProcess(const CefMainArgs& args,
|
||||
const char* api_hash = cef_api_hash(0);
|
||||
if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) {
|
||||
// The libcef API hash does not match the current header API hash.
|
||||
DCHECK(false);
|
||||
NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ CEF_GLOBAL bool CefInitialize(const CefMainArgs& args,
|
||||
const char* api_hash = cef_api_hash(0);
|
||||
if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) {
|
||||
// The libcef API hash does not match the current header API hash.
|
||||
DCHECK(false);
|
||||
NOTREACHED();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user