Remove CEF-specific integer and char16 typedef's (see #3507)

This commit is contained in:
Marshall Greenblatt 2023-06-01 17:06:15 +03:00
parent 695ee2a041
commit 5042d71408
150 changed files with 597 additions and 621 deletions

View File

@ -37,50 +37,4 @@
#include "include/base/cef_build.h"
// The NSPR system headers define 64-bit as |long| when possible, except on
// Mac OS X. In order to not have typedef mismatches, we do the same on LP64.
//
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
// <inttypes.h> format macros even in the LP64 model.
#if defined(__LP64__) && !defined(OS_MAC) && !defined(OS_OPENBSD)
typedef long int64;
typedef unsigned long uint64;
#else
typedef long long int64;
typedef unsigned long long uint64;
#endif
// TODO: Remove these type guards. These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _INT32
#define _INT32
typedef int int32;
#endif
// TODO: Remove these type guards. These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _UINT32
#define _UINT32
typedef unsigned int uint32;
#endif
#ifndef _INT16
#define _INT16
typedef short int16;
#endif
#ifndef _UINT16
#define _UINT16
typedef unsigned short uint16;
#endif
// UTF-16 character type.
#ifndef char16
#if defined(WCHAR_T_IS_UTF16)
typedef wchar_t char16;
#elif defined(WCHAR_T_IS_UTF32)
typedef unsigned short char16;
#endif
#endif
#endif // CEF_INCLUDE_BASE_CEF_BASICTYPES_H_

View File

@ -253,7 +253,7 @@
// The compiler thinks std::string::const_iterator and "const char*" are
// equivalent types.
#define STD_STRING_ITERATOR_IS_CHAR_POINTER
// The compiler thinks std::u16string::const_iterator and "char16*" are
// The compiler thinks std::u16string::const_iterator and "char16_t*" are
// equivalent types.
#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
#endif

View File

@ -723,6 +723,13 @@ std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
return out << wstr.c_str();
}
#if defined(WCHAR_T_IS_UTF32)
std::ostream& operator<<(std::ostream& out, const char16_t* wstr);
#elif defined(WCHAR_T_IS_UTF16)
inline std::ostream& operator<<(std::ostream& out, const char16_t* wstr) {
return operator<<(out, reinterpret_cast<const wchar_t*>(wstr));
}
#endif
// The NOTIMPLEMENTED() macro annotates codepaths which have
// not been implemented yet.

View File

@ -87,7 +87,7 @@ class CefAudioHandler : public virtual CefBaseRefCounted {
virtual void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser,
const float** data,
int frames,
int64 pts) = 0;
int64_t pts) = 0;
///
/// Called on the UI thread when the stream has stopped. OnAudioSteamStopped

View File

@ -170,7 +170,7 @@ class CefBrowser : public virtual CefBaseRefCounted {
/// Returns the frame with the specified identifier, or NULL if not found.
///
/*--cef(capi_name=get_frame_byident)--*/
virtual CefRefPtr<CefFrame> GetFrame(int64 identifier) = 0;
virtual CefRefPtr<CefFrame> GetFrame(int64_t identifier) = 0;
///
/// Returns the frame with the specified name, or NULL if not found.
@ -188,7 +188,7 @@ class CefBrowser : public virtual CefBaseRefCounted {
/// Returns the identifiers of all existing frames.
///
/*--cef(count_func=identifiers:GetFrameCount)--*/
virtual void GetFrameIdentifiers(std::vector<int64>& identifiers) = 0;
virtual void GetFrameIdentifiers(std::vector<int64_t>& identifiers) = 0;
///
/// Returns the names of all existing frames.
@ -456,7 +456,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual void DownloadImage(const CefString& image_url,
bool is_favicon,
uint32 max_image_size,
uint32_t max_image_size,
bool bypass_cache,
CefRefPtr<CefDownloadImageCallback> callback) = 0;

View File

@ -111,7 +111,7 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted {
/// pending scheduled call should be cancelled.
///
/*--cef()--*/
virtual void OnScheduleMessagePumpWork(int64 delay_ms) {}
virtual void OnScheduleMessagePumpWork(int64_t delay_ms) {}
///
/// Return the default client for use with a newly created browser window. If

View File

@ -87,7 +87,7 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
/// Returns a simple speed estimate in bytes/s.
///
/*--cef()--*/
virtual int64 GetCurrentSpeed() = 0;
virtual int64_t GetCurrentSpeed() = 0;
///
/// Returns the rough percent complete or -1 if the receive total size is
@ -100,13 +100,13 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
/// Returns the total number of bytes.
///
/*--cef()--*/
virtual int64 GetTotalBytes() = 0;
virtual int64_t GetTotalBytes() = 0;
///
/// Returns the number of received bytes.
///
/*--cef()--*/
virtual int64 GetReceivedBytes() = 0;
virtual int64_t GetReceivedBytes() = 0;
///
/// Returns the time that the download started.
@ -130,7 +130,7 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
/// Returns the unique identifier for this download.
///
/*--cef()--*/
virtual uint32 GetId() = 0;
virtual uint32_t GetId() = 0;
///
/// Returns the URL.

View File

@ -184,7 +184,7 @@ class CefFrame : public virtual CefBaseRefCounted {
/// underlying frame does not yet exist.
///
/*--cef()--*/
virtual int64 GetIdentifier() = 0;
virtual int64_t GetIdentifier() = 0;
///
/// Returns the parent of this frame or NULL if this is the main (top-level)

View File

@ -57,7 +57,7 @@ class CefMediaAccessCallback : public virtual CefBaseRefCounted {
/// OnRequestMediaAccessPermission.
///
/*--cef(capi_name=cont)--*/
virtual void Continue(uint32 allowed_permissions) = 0;
virtual void Continue(uint32_t allowed_permissions) = 0;
///
/// Cancel the media access request.
@ -104,7 +104,7 @@ class CefPermissionHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& requesting_origin,
uint32 requested_permissions,
uint32_t requested_permissions,
CefRefPtr<CefMediaAccessCallback> callback) {
return false;
}
@ -123,9 +123,9 @@ class CefPermissionHandler : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual bool OnShowPermissionPrompt(
CefRefPtr<CefBrowser> browser,
uint64 prompt_id,
uint64_t prompt_id,
const CefString& requesting_origin,
uint32 requested_permissions,
uint32_t requested_permissions,
CefRefPtr<CefPermissionPromptCallback> callback) {
return false;
}
@ -142,7 +142,7 @@ class CefPermissionHandler : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual void OnDismissPermissionPrompt(
CefRefPtr<CefBrowser> browser,
uint64 prompt_id,
uint64_t prompt_id,
cef_permission_request_result_t result) {}
};

View File

@ -217,7 +217,7 @@ class CefRequest : public virtual CefBaseRefCounted {
/// browser process to track a single request across multiple callbacks.
///
/*--cef()--*/
virtual uint64 GetIdentifier() = 0;
virtual uint64_t GetIdentifier() = 0;
};
///

View File

@ -58,7 +58,7 @@ class CefResourceSkipCallback : public virtual CefBaseRefCounted {
/// <= 0 the request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE.
///
/*--cef(capi_name=cont)--*/
virtual void Continue(int64 bytes_skipped) = 0;
virtual void Continue(int64_t bytes_skipped) = 0;
};
///
@ -136,7 +136,7 @@ class CefResourceHandler : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length,
int64_t& response_length,
CefString& redirectUrl) = 0;
///
@ -149,8 +149,8 @@ class CefResourceHandler : public virtual CefBaseRefCounted {
/// method will be called in sequence but not from a dedicated thread.
///
/*--cef()--*/
virtual bool Skip(int64 bytes_to_skip,
int64& bytes_skipped,
virtual bool Skip(int64_t bytes_to_skip,
int64_t& bytes_skipped,
CefRefPtr<CefResourceSkipCallback> callback) {
bytes_skipped = -2;
return false;

View File

@ -187,7 +187,7 @@ class CefResourceRequestHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefRequest> request,
CefRefPtr<CefResponse> response,
URLRequestStatus status,
int64 received_content_length) {}
int64_t received_content_length) {}
///
/// Called on the IO thread to handle requests for URLs with an unknown

View File

@ -74,7 +74,7 @@ class CefServer : public CefBaseRefCounted {
///
/*--cef()--*/
static void CreateServer(const CefString& address,
uint16 port,
uint16_t port,
int backlog,
CefRefPtr<CefServerHandler> handler);
@ -170,7 +170,7 @@ class CefServer : public CefBaseRefCounted {
virtual void SendHttpResponse(int connection_id,
int response_code,
const CefString& content_type,
int64 content_length,
int64_t content_length,
const HeaderMap& extra_headers) = 0;
///

View File

@ -58,13 +58,13 @@ class CefReadHandler : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64 offset, int whence) = 0;
virtual int Seek(int64_t offset, int whence) = 0;
///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64 Tell() = 0;
virtual int64_t Tell() = 0;
///
/// Return non-zero if at end of file.
@ -119,13 +119,13 @@ class CefStreamReader : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64 offset, int whence) = 0;
virtual int Seek(int64_t offset, int whence) = 0;
///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64 Tell() = 0;
virtual int64_t Tell() = 0;
///
/// Return non-zero if at end of file.
@ -161,13 +161,13 @@ class CefWriteHandler : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64 offset, int whence) = 0;
virtual int Seek(int64_t offset, int whence) = 0;
///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64 Tell() = 0;
virtual int64_t Tell() = 0;
///
/// Flush the stream.
@ -215,13 +215,13 @@ class CefStreamWriter : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64 offset, int whence) = 0;
virtual int Seek(int64_t offset, int whence) = 0;
///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64 Tell() = 0;
virtual int64_t Tell() = 0;
///
/// Flush the stream.

View File

@ -118,7 +118,7 @@ class CefTaskRunner : public virtual CefBaseRefCounted {
/// specified delay.
///
/*--cef()--*/
virtual bool PostDelayedTask(CefRefPtr<CefTask> task, int64 delay_ms) = 0;
virtual bool PostDelayedTask(CefRefPtr<CefTask> task, int64_t delay_ms) = 0;
};
///
@ -143,6 +143,6 @@ bool CefPostTask(CefThreadId threadId, CefRefPtr<CefTask> task);
/*--cef()--*/
bool CefPostDelayedTask(CefThreadId threadId,
CefRefPtr<CefTask> task,
int64 delay_ms);
int64_t delay_ms);
#endif // CEF_INCLUDE_CEF_TASK_H_

View File

@ -106,6 +106,6 @@ bool CefEndTracing(const CefString& tracing_file,
/// information in trace events.
///
/*--cef()--*/
int64 CefNowFromSystemTraceTime();
int64_t CefNowFromSystemTraceTime();
#endif // CEF_INCLUDE_CEF_TRACE_H_

View File

@ -152,8 +152,8 @@ class CefURLRequestClient : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void OnUploadProgress(CefRefPtr<CefURLRequest> request,
int64 current,
int64 total) = 0;
int64_t current,
int64_t total) = 0;
///
/// Notifies the client of download progress. |current| denotes the number of
@ -162,8 +162,8 @@ class CefURLRequestClient : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void OnDownloadProgress(CefRefPtr<CefURLRequest> request,
int64 current,
int64 total) = 0;
int64_t current,
int64_t total) = 0;
///
/// Called when some part of the response is read. |data| contains the current

View File

@ -459,13 +459,13 @@ class CefV8Value : public virtual CefBaseRefCounted {
/// Create a new CefV8Value object of type int.
///
/*--cef()--*/
static CefRefPtr<CefV8Value> CreateInt(int32 value);
static CefRefPtr<CefV8Value> CreateInt(int32_t value);
///
/// Create a new CefV8Value object of type unsigned int.
///
/*--cef()--*/
static CefRefPtr<CefV8Value> CreateUInt(uint32 value);
static CefRefPtr<CefV8Value> CreateUInt(uint32_t value);
///
/// Create a new CefV8Value object of type double.
@ -648,13 +648,13 @@ class CefV8Value : public virtual CefBaseRefCounted {
/// Return an int value.
///
/*--cef()--*/
virtual int32 GetIntValue() = 0;
virtual int32_t GetIntValue() = 0;
///
/// Return an unsigned int value.
///
/*--cef()--*/
virtual uint32 GetUIntValue() = 0;
virtual uint32_t GetUIntValue() = 0;
///
/// Return a double value.

View File

@ -103,7 +103,7 @@ class CefWaitableEvent : public CefBaseRefCounted {
/// called on the browser process UI or IO threads.
///
/*--cef()--*/
virtual bool TimedWait(int64 max_ms) = 0;
virtual bool TimedWait(int64_t max_ms) = 0;
};
#endif // CEF_INCLUDE_CEF_WAITABLE_EVENT_H_

View File

@ -96,7 +96,7 @@ class CefZipReader : public virtual CefBaseRefCounted {
/// Returns the uncompressed size of the file.
///
/*--cef()--*/
virtual int64 GetFileSize() = 0;
virtual int64_t GetFileSize() = 0;
///
/// Returns the last modified timestamp for the file.
@ -128,7 +128,7 @@ class CefZipReader : public virtual CefBaseRefCounted {
/// Returns the current offset in the uncompressed file contents.
///
/*--cef()--*/
virtual int64 Tell() = 0;
virtual int64_t Tell() = 0;
///
/// Returns true if at end of the file contents.

View File

@ -74,7 +74,7 @@ typedef cef_string_userfree_utf8_t cef_string_userfree_t;
#define cef_string_to_wide cef_string_utf8_to_wide
#define cef_string_from_wide cef_string_wide_to_utf8
#elif defined(CEF_STRING_TYPE_UTF16)
typedef char16 cef_char_t;
typedef char16_t cef_char_t;
typedef cef_string_userfree_utf16_t cef_string_userfree_t;
typedef cef_string_utf16_t cef_string_t;
#define cef_string_set cef_string_utf16_set

View File

@ -70,9 +70,9 @@ typedef struct _cef_string_utf8_t {
} cef_string_utf8_t;
typedef struct _cef_string_utf16_t {
char16* str;
char16_t* str;
size_t length;
void (*dtor)(char16* str);
void (*dtor)(char16_t* str);
} cef_string_utf16_t;
///
@ -89,7 +89,7 @@ CEF_EXPORT int cef_string_utf8_set(const char* src,
size_t src_len,
cef_string_utf8_t* output,
int copy);
CEF_EXPORT int cef_string_utf16_set(const char16* src,
CEF_EXPORT int cef_string_utf16_set(const char16_t* src,
size_t src_len,
cef_string_utf16_t* output,
int copy);
@ -141,14 +141,14 @@ CEF_EXPORT int cef_string_utf8_to_wide(const char* src,
CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src,
size_t src_len,
cef_string_utf16_t* output);
CEF_EXPORT int cef_string_utf16_to_wide(const char16* src,
CEF_EXPORT int cef_string_utf16_to_wide(const char16_t* src,
size_t src_len,
cef_string_wide_t* output);
CEF_EXPORT int cef_string_utf8_to_utf16(const char* src,
size_t src_len,
cef_string_utf16_t* output);
CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src,
CEF_EXPORT int cef_string_utf16_to_utf8(const char16_t* src,
size_t src_len,
cef_string_utf8_t* output);
@ -198,10 +198,10 @@ CEF_EXPORT void cef_string_userfree_utf16_free(cef_string_userfree_utf16_t str);
/// may change the length of the string in some cases.
///
CEF_EXPORT int cef_string_utf16_to_lower(const char16* src,
CEF_EXPORT int cef_string_utf16_to_lower(const char16_t* src,
size_t src_len,
cef_string_utf16_t* output);
CEF_EXPORT int cef_string_utf16_to_upper(const char16* src,
CEF_EXPORT int cef_string_utf16_to_upper(const char16_t* src,
size_t src_len,
cef_string_utf16_t* output);

View File

@ -115,7 +115,7 @@ struct CefStringTraitsWide {
static inline bool from_string16(const std::u16string::value_type* data,
size_t length,
struct_type* s) {
return cef_string_utf16_to_wide(reinterpret_cast<const char16*>(data),
return cef_string_utf16_to_wide(reinterpret_cast<const char16_t*>(data),
length, s)
? true
: false;
@ -213,7 +213,7 @@ struct CefStringTraitsUTF8 {
static inline bool from_string16(const std::u16string::value_type* data,
size_t length,
struct_type* s) {
return cef_string_utf16_to_utf8(reinterpret_cast<const char16*>(data),
return cef_string_utf16_to_utf8(reinterpret_cast<const char16_t*>(data),
length, s)
? true
: false;
@ -227,7 +227,7 @@ struct CefStringTraitsUTF8 {
/// Traits implementation for utf16 character strings.
///
struct CefStringTraitsUTF16 {
typedef char16 char_type;
typedef char16_t char_type;
typedef cef_string_utf16_t struct_type;
typedef cef_string_userfree_utf16_t userfree_struct_type;
@ -290,12 +290,15 @@ struct CefStringTraitsUTF16 {
}
#else // WCHAR_T_IS_UTF32
static inline std::wstring to_wstring(const struct_type* s) {
return std::wstring(s->str, s->length);
return std::wstring(reinterpret_cast<wchar_t*>(s->str), s->length);
}
static inline bool from_wstring(const std::wstring::value_type* data,
size_t length,
struct_type* s) {
return cef_string_utf16_set(data, length, s, true) ? true : false;
return cef_string_utf16_set(reinterpret_cast<const char16_t*>(data), length,
s, true)
? true
: false;
}
#endif // WCHAR_T_IS_UTF32
static inline bool from_wstring(const std::wstring& str, struct_type* s) {
@ -308,7 +311,7 @@ struct CefStringTraitsUTF16 {
static inline bool from_string16(const std::u16string::value_type* data,
size_t length,
struct_type* s) {
return cef_string_utf16_set(reinterpret_cast<const char16*>(data), length,
return cef_string_utf16_set(reinterpret_cast<const char16_t*>(data), length,
s, true)
? true
: false;
@ -412,15 +415,6 @@ class CefStringBase {
FromString16(src, length);
}
}
#if defined(WCHAR_T_IS_UTF32)
CefStringBase(const char16* src, size_t length = 0)
: string_(NULL), owner_(false) {
if (src) {
FromString16(reinterpret_cast<const std::u16string::value_type*>(src),
length);
}
}
#endif // WCHAR_T_IS_UTF32
///
/// Create a new string from an existing character array. If |copy| is true
@ -826,12 +820,6 @@ class CefStringBase {
FromString16(str);
return *this;
}
#if defined(WCHAR_T_IS_UTF32)
CefStringBase& operator=(const char16* str) {
FromString16(reinterpret_cast<const std::u16string::value_type*>(str));
return *this;
}
#endif // WCHAR_T_IS_UTF32
#if defined(USING_CHROMIUM_INCLUDES)
// The base::FilePath constructor is marked as explicit so provide the
// conversion here for convenience.

View File

@ -35,7 +35,9 @@
extern "C" {
#endif
#include <stdint.h>
#include <time.h>
#include "include/base/cef_basictypes.h"
#include "include/internal/cef_export.h"
@ -47,7 +49,7 @@ extern "C" {
/// This is equivalent of Chromium `base::Time` (see base/time/time.h).
///
typedef struct _cef_basetime_t {
int64 val;
int64_t val;
} cef_basetime_t;
///

View File

@ -51,60 +51,60 @@ extern "C" {
CEF_EXPORT void cef_trace_event_instant(const char* category,
const char* name,
const char* arg1_name,
uint64 arg1_val,
uint64_t arg1_val,
const char* arg2_name,
uint64 arg2_val);
uint64_t arg2_val);
CEF_EXPORT void cef_trace_event_begin(const char* category,
const char* name,
const char* arg1_name,
uint64 arg1_val,
uint64_t arg1_val,
const char* arg2_name,
uint64 arg2_val);
uint64_t arg2_val);
CEF_EXPORT void cef_trace_event_end(const char* category,
const char* name,
const char* arg1_name,
uint64 arg1_val,
uint64_t arg1_val,
const char* arg2_name,
uint64 arg2_val);
uint64_t arg2_val);
CEF_EXPORT void cef_trace_counter(const char* category,
const char* name,
const char* value1_name,
uint64 value1_val,
uint64_t value1_val,
const char* value2_name,
uint64 value2_val);
uint64_t value2_val);
CEF_EXPORT void cef_trace_counter_id(const char* category,
const char* name,
uint64 id,
uint64_t id,
const char* value1_name,
uint64 value1_val,
uint64_t value1_val,
const char* value2_name,
uint64 value2_val);
uint64_t value2_val);
CEF_EXPORT void cef_trace_event_async_begin(const char* category,
const char* name,
uint64 id,
uint64_t id,
const char* arg1_name,
uint64 arg1_val,
uint64_t arg1_val,
const char* arg2_name,
uint64 arg2_val);
uint64_t arg2_val);
CEF_EXPORT void cef_trace_event_async_step_into(const char* category,
const char* name,
uint64 id,
uint64 step,
uint64_t id,
uint64_t step,
const char* arg1_name,
uint64 arg1_val);
uint64_t arg1_val);
CEF_EXPORT void cef_trace_event_async_step_past(const char* category,
const char* name,
uint64 id,
uint64 step,
uint64_t id,
uint64_t step,
const char* arg1_name,
uint64 arg1_val);
uint64_t arg1_val);
CEF_EXPORT void cef_trace_event_async_end(const char* category,
const char* name,
uint64 id,
uint64_t id,
const char* arg1_name,
uint64 arg1_val,
uint64_t arg1_val,
const char* arg2_name,
uint64 arg2_val);
uint64_t arg2_val);
#ifdef __cplusplus
}

View File

@ -49,7 +49,7 @@
// 32-bit ARGB color value, not premultiplied. The color components are always
// in a known order. Equivalent to the SkColor type.
typedef uint32 cef_color_t;
typedef uint32_t cef_color_t;
// Return the alpha byte from a cef_color_t value.
#define CefColorGetA(color) (((color) >> 24) & 0xFF)
@ -66,17 +66,18 @@ typedef uint32 cef_color_t;
(static_cast<unsigned>(a) << 24) | (static_cast<unsigned>(r) << 16) | \
(static_cast<unsigned>(g) << 8) | (static_cast<unsigned>(b) << 0))
// Return an int64 value with the specified low and high int32 component values.
#define CefInt64Set(int32_low, int32_high) \
static_cast<int64>((static_cast<uint32>(int32_low)) | \
(static_cast<int64>(static_cast<int32>(int32_high))) \
<< 32)
// Return an int64_t value with the specified low and high int32_t component
// values.
#define CefInt64Set(int32_low, int32_high) \
static_cast<int64_t>( \
(static_cast<uint32_t>(int32_low)) | \
(static_cast<int64_t>(static_cast<int32_t>(int32_high))) << 32)
// Return the low int32 value from an int64 value.
#define CefInt64GetLow(int64_val) static_cast<int32>(int64_val)
// Return the high int32 value from an int64 value.
// Return the low int32_t value from an int64_t value.
#define CefInt64GetLow(int64_val) static_cast<int32_t>(int64_val)
// Return the high int32_t value from an int64_t value.
#define CefInt64GetHigh(int64_val) \
static_cast<int32>((static_cast<int64>(int64_val) >> 32) & 0xFFFFFFFFL)
static_cast<int32_t>((static_cast<int64_t>(int64_val) >> 32) & 0xFFFFFFFFL)
#ifdef __cplusplus
extern "C" {
@ -1779,7 +1780,7 @@ typedef struct _cef_mouse_event_t {
/// Bit flags describing any pressed modifier keys. See
/// cef_event_flags_t for values.
///
uint32 modifiers;
uint32_t modifiers;
} cef_mouse_event_t;
///
@ -1857,7 +1858,7 @@ typedef struct _cef_touch_event_t {
/// Bit flags describing any pressed modifier keys. See
/// cef_event_flags_t for values.
///
uint32 modifiers;
uint32_t modifiers;
///
/// The device type that caused the event.
@ -2070,7 +2071,7 @@ typedef struct _cef_key_event_t {
/// Bit flags describing any pressed modifier keys. See
/// cef_event_flags_t for values.
///
uint32 modifiers;
uint32_t modifiers;
///
/// The Windows key code for the key event. This value is used by the DOM
@ -2095,13 +2096,13 @@ typedef struct _cef_key_event_t {
///
/// The character generated by the keystroke.
///
char16 character;
char16_t character;
///
/// Same as |character| but unmodified by any concurrently-held modifiers
/// (except shift). This is useful for working out shortcut keys.
///
char16 unmodified_character;
char16_t unmodified_character;
///
/// True if the focus is currently on an editable field on the page. This is
@ -3348,7 +3349,7 @@ typedef struct _cef_touch_handle_state_t {
/// Combination of cef_touch_handle_state_flags_t values indicating what state
/// is set.
///
uint32 flags;
uint32_t flags;
///
/// Enabled state. Only set if |flags| contains CEF_THS_FLAG_ENABLED.

View File

@ -86,7 +86,7 @@ class CefTestServer : public CefBaseRefCounted {
///
/*--cef()--*/
static CefRefPtr<CefTestServer> CreateAndStart(
uint16 port,
uint16_t port,
bool https_server,
cef_test_cert_type_t https_cert_type,
CefRefPtr<CefTestServerHandler> handler);

View File

@ -123,7 +123,7 @@ class CefDisplay : public CefBaseRefCounted {
/// Returns the unique identifier for this Display.
///
/*--cef()--*/
virtual int64 GetID() = 0;
virtual int64_t GetID() = 0;
///
/// Returns this Display's device pixel scale factor. This specifies how much

View File

@ -300,7 +300,7 @@ class CefWindow : public CefPanel {
/// primarily for testing purposes.
///
/*--cef()--*/
virtual void SendKeyPress(int key_code, uint32 event_flags) = 0;
virtual void SendKeyPress(int key_code, uint32_t event_flags) = 0;
///
/// Simulate a mouse move. The mouse cursor will be moved to the specified

View File

@ -61,15 +61,15 @@ class CefByteReadHandler : public CefReadHandler {
// CefReadHandler methods.
virtual size_t Read(void* ptr, size_t size, size_t n) override;
virtual int Seek(int64 offset, int whence) override;
virtual int64 Tell() override;
virtual int Seek(int64_t offset, int whence) override;
virtual int64_t Tell() override;
virtual int Eof() override;
virtual bool MayBlock() override { return false; }
private:
const unsigned char* bytes_;
int64 size_;
int64 offset_;
int64_t size_;
int64_t offset_;
CefRefPtr<CefBaseRefCounted> source_;
base::Lock lock_;

View File

@ -109,9 +109,9 @@ bool CefPostTask(CefThreadId threadId, const base::RepeatingClosure& closure);
///
bool CefPostDelayedTask(CefThreadId threadId,
base::OnceClosure closure,
int64 delay_ms);
int64_t delay_ms);
bool CefPostDelayedTask(CefThreadId threadId,
const base::RepeatingClosure& closure,
int64 delay_ms);
int64_t delay_ms);
#endif // CEF_INCLUDE_WRAPPER_CEF_CLOSURE_TASK_H_

View File

@ -177,7 +177,7 @@
// 8. Handle the query in your Handler::OnQuery implementation and execute the
// appropriate callback either immediately or asynchronously.
//
// void MyHandler::OnQuery(int64 query_id,
// void MyHandler::OnQuery(int64_t query_id,
// CefRefPtr<CefBrowser> browser,
// CefRefPtr<CefFrame> frame,
// const CefString& request,
@ -269,7 +269,7 @@ class CefMessageRouterBrowserSide
///
virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) {
@ -287,7 +287,7 @@ class CefMessageRouterBrowserSide
///
virtual void OnQueryCanceled(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id) {}
int64_t query_id) {}
virtual ~Handler() {}
};

View File

@ -361,7 +361,7 @@ class CefResourceManager
ProviderEntryList providers_;
// Map of response ID to pending CefResourceHandler object.
using PendingHandlersMap = std::map<uint64, CefRefPtr<CefResourceHandler>>;
using PendingHandlersMap = std::map<uint64_t, CefRefPtr<CefResourceHandler>>;
PendingHandlersMap pending_handlers_;
UrlFilter url_filter_;

View File

@ -68,7 +68,7 @@ class CefStreamResourceHandler : public CefResourceHandler {
bool& handle_request,
CefRefPtr<CefCallback> callback) override;
void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length,
int64_t& response_length,
CefString& redirectUrl) override;
bool Read(void* data_out,
int bytes_to_read,

View File

@ -316,7 +316,7 @@ void CefBrowserHostBase::StartDownload(const CefString& url) {
void CefBrowserHostBase::DownloadImage(
const CefString& image_url,
bool is_favicon,
uint32 max_image_size,
uint32_t max_image_size,
bool bypass_cache,
CefRefPtr<CefDownloadImageCallback> callback) {
if (!CEF_CURRENTLY_ON_UIT()) {
@ -346,7 +346,7 @@ void CefBrowserHostBase::DownloadImage(
gurl, is_favicon, gfx::Size(max_image_size, max_image_size),
max_image_size * scale, bypass_cache,
base::BindOnce(
[](uint32 max_image_size,
[](uint32_t max_image_size,
CefRefPtr<CefDownloadImageCallback> callback, int id,
int http_status_code, const GURL& image_url,
const std::vector<SkBitmap>& bitmaps,
@ -765,7 +765,7 @@ CefRefPtr<CefFrame> CefBrowserHostBase::GetFocusedFrame() {
return GetFrame(CefFrameHostImpl::kFocusedFrameId);
}
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrame(int64 identifier) {
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrame(int64_t identifier) {
if (identifier == CefFrameHostImpl::kInvalidFrameId) {
return nullptr;
} else if (identifier == CefFrameHostImpl::kMainFrameId) {
@ -796,7 +796,8 @@ size_t CefBrowserHostBase::GetFrameCount() {
return browser_info_->GetAllFrames().size();
}
void CefBrowserHostBase::GetFrameIdentifiers(std::vector<int64>& identifiers) {
void CefBrowserHostBase::GetFrameIdentifiers(
std::vector<int64_t>& identifiers) {
if (identifiers.size() > 0) {
identifiers.clear();
}

View File

@ -179,7 +179,7 @@ class CefBrowserHostBase : public CefBrowserHost,
void StartDownload(const CefString& url) override;
void DownloadImage(const CefString& image_url,
bool is_favicon,
uint32 max_image_size,
uint32_t max_image_size,
bool bypass_cache,
CefRefPtr<CefDownloadImageCallback> callback) override;
void Print() override;
@ -225,10 +225,10 @@ class CefBrowserHostBase : public CefBrowserHost,
bool IsPopup() override;
CefRefPtr<CefFrame> GetMainFrame() override;
CefRefPtr<CefFrame> GetFocusedFrame() override;
CefRefPtr<CefFrame> GetFrame(int64 identifier) override;
CefRefPtr<CefFrame> GetFrame(int64_t identifier) override;
CefRefPtr<CefFrame> GetFrame(const CefString& name) override;
size_t GetFrameCount() override;
void GetFrameIdentifiers(std::vector<int64>& identifiers) override;
void GetFrameIdentifiers(std::vector<int64_t>& identifiers) override;
void GetFrameNames(std::vector<CefString>& names) override;
// CefBrowserContentsDelegate::Observer methods:

View File

@ -408,7 +408,7 @@ void CefBrowserPlatformDelegate::StopFinding(bool clearSelection) {
// static
int CefBrowserPlatformDelegate::TranslateWebEventModifiers(
uint32 cef_modifiers) {
uint32_t cef_modifiers) {
int result = 0;
// Set modifiers based on key state.
if (cef_modifiers & EVENTFLAG_CAPS_LOCK_ON) {

View File

@ -379,7 +379,7 @@ class CefBrowserPlatformDelegate {
CefBrowserPlatformDelegate();
virtual ~CefBrowserPlatformDelegate();
static int TranslateWebEventModifiers(uint32 cef_modifiers);
static int TranslateWebEventModifiers(uint32_t cef_modifiers);
// Not owned by this object.
content::WebContents* web_contents_ = nullptr;

View File

@ -50,7 +50,7 @@ cef_download_interrupt_reason_t CefDownloadItemImpl::GetInterruptReason() {
const_value().GetLastReason());
}
int64 CefDownloadItemImpl::GetCurrentSpeed() {
int64_t CefDownloadItemImpl::GetCurrentSpeed() {
CEF_VALUE_VERIFY_RETURN(false, 0);
return const_value().CurrentSpeed();
}
@ -60,12 +60,12 @@ int CefDownloadItemImpl::GetPercentComplete() {
return const_value().PercentComplete();
}
int64 CefDownloadItemImpl::GetTotalBytes() {
int64_t CefDownloadItemImpl::GetTotalBytes() {
CEF_VALUE_VERIFY_RETURN(false, 0);
return const_value().GetTotalBytes();
}
int64 CefDownloadItemImpl::GetReceivedBytes() {
int64_t CefDownloadItemImpl::GetReceivedBytes() {
CEF_VALUE_VERIFY_RETURN(false, 0);
return const_value().GetReceivedBytes();
}
@ -85,7 +85,7 @@ CefString CefDownloadItemImpl::GetFullPath() {
return const_value().GetFullPath().value();
}
uint32 CefDownloadItemImpl::GetId() {
uint32_t CefDownloadItemImpl::GetId() {
CEF_VALUE_VERIFY_RETURN(false, 0);
return const_value().GetId();
}

View File

@ -29,14 +29,14 @@ class CefDownloadItemImpl
bool IsCanceled() override;
bool IsInterrupted() override;
cef_download_interrupt_reason_t GetInterruptReason() override;
int64 GetCurrentSpeed() override;
int64_t GetCurrentSpeed() override;
int GetPercentComplete() override;
int64 GetTotalBytes() override;
int64 GetReceivedBytes() override;
int64_t GetTotalBytes() override;
int64_t GetReceivedBytes() override;
CefBaseTime GetStartTime() override;
CefBaseTime GetEndTime() override;
CefString GetFullPath() override;
uint32 GetId() override;
uint32_t GetId() override;
CefString GetURL() override;
CefString GetOriginalUrl() override;
CefString GetSuggestedFileName() override;

View File

@ -45,7 +45,7 @@ CefRefPtr<CefDownloadHandler> GetDownloadHandler(
class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
public:
CefBeforeDownloadCallbackImpl(const base::WeakPtr<DownloadManager>& manager,
uint32 download_id,
uint32_t download_id,
const base::FilePath& suggested_name,
content::DownloadTargetCallback callback)
: manager_(manager),
@ -81,7 +81,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
private:
static void GenerateFilename(base::WeakPtr<DownloadManager> manager,
uint32 download_id,
uint32_t download_id,
const base::FilePath& suggested_name,
const base::FilePath& download_path,
bool show_dialog,
@ -117,7 +117,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
}
static void ChooseDownloadPath(base::WeakPtr<DownloadManager> manager,
uint32 download_id,
uint32_t download_id,
const base::FilePath& suggested_path,
bool show_dialog,
content::DownloadTargetCallback callback) {
@ -188,7 +188,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
}
base::WeakPtr<DownloadManager> manager_;
uint32 download_id_;
uint32_t download_id_;
base::FilePath suggested_name_;
content::DownloadTargetCallback callback_;
@ -200,7 +200,7 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback {
public:
explicit CefDownloadItemCallbackImpl(
const base::WeakPtr<DownloadManager>& manager,
uint32 download_id)
uint32_t download_id)
: manager_(manager), download_id_(download_id) {}
CefDownloadItemCallbackImpl(const CefDownloadItemCallbackImpl&) = delete;
@ -265,7 +265,7 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback {
}
base::WeakPtr<DownloadManager> manager_;
uint32 download_id_;
uint32_t download_id_;
IMPLEMENT_REFCOUNTING(CefDownloadItemCallbackImpl);
};
@ -416,7 +416,7 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget(
void CefDownloadManagerDelegate::GetNextId(
content::DownloadIdCallback callback) {
static uint32 next_id = DownloadItem::kInvalidId + 1;
static uint32_t next_id = DownloadItem::kInvalidId + 1;
std::move(callback).Run(next_id++);
}

View File

@ -98,7 +98,7 @@ class CefGetExtensionLoadFileCallbackImpl
// Move to the end of the stream.
stream->Seek(0, SEEK_END);
const int64 size = stream->Tell();
const int64_t size = stream->Tell();
if (size == 0) {
LOG(WARNING) << "Extension resource " << file << " is empty.";
return nullptr;
@ -111,7 +111,7 @@ class CefGetExtensionLoadFileCallbackImpl
stream->Seek(0, SEEK_SET);
// Read all stream contents into the string.
int64 read, offset = 0;
int64_t read, offset = 0;
do {
read =
static_cast<int>(stream->Read(&(*result)[offset], 1, size - offset));

View File

@ -193,13 +193,13 @@ CefString CefFrameHostImpl::GetName() {
return name_;
}
int64 CefFrameHostImpl::GetIdentifier() {
int64_t CefFrameHostImpl::GetIdentifier() {
base::AutoLock lock_scope(state_lock_);
return frame_id_;
}
CefRefPtr<CefFrame> CefFrameHostImpl::GetParent() {
int64 parent_frame_id;
int64_t parent_frame_id;
{
base::AutoLock lock_scope(state_lock_);
@ -574,7 +574,7 @@ const ui::PageTransition CefFrameHostImpl::kPageTransitionExplicit =
static_cast<ui::PageTransition>(ui::PAGE_TRANSITION_TYPED |
ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
int64 CefFrameHostImpl::GetFrameId() const {
int64_t CefFrameHostImpl::GetFrameId() const {
base::AutoLock lock_scope(state_lock_);
return is_main_frame_ ? kMainFrameId : frame_id_;
}

View File

@ -65,7 +65,7 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
bool IsMain() override;
bool IsFocused() override;
CefString GetName() override;
int64 GetIdentifier() override;
int64_t GetIdentifier() override;
CefRefPtr<CefFrame> GetParent() override;
CefString GetURL() override;
CefRefPtr<CefBrowser> GetBrowser() override;
@ -156,7 +156,7 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
static const ui::PageTransition kPageTransitionExplicit;
private:
int64 GetFrameId() const;
int64_t GetFrameId() const;
scoped_refptr<CefBrowserInfo> GetBrowserInfo() const;
CefRefPtr<CefBrowserHostBase> GetBrowserHostBase() const;
@ -176,12 +176,12 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
// The following members may be read/modified from any thread. All access must
// be protected by |state_lock_|.
mutable base::Lock state_lock_;
int64 frame_id_;
int64_t frame_id_;
scoped_refptr<CefBrowserInfo> browser_info_;
bool is_focused_;
CefString url_;
CefString name_;
int64 parent_frame_id_;
int64_t parent_frame_id_;
// The following members are only accessed on the UI thread.
content::RenderFrameHost* render_frame_host_ = nullptr;

View File

@ -229,7 +229,7 @@ base::TimeTicks CefBrowserPlatformDelegateNativeAura::GetEventTimeStamp() {
// static
int CefBrowserPlatformDelegateNativeAura::TranslateUiEventModifiers(
uint32 cef_modifiers) {
uint32_t cef_modifiers) {
int result = 0;
// Set modifiers based on key state.
if (cef_modifiers & EVENTFLAG_CAPS_LOCK_ON) {
@ -273,7 +273,7 @@ int CefBrowserPlatformDelegateNativeAura::TranslateUiEventModifiers(
// static
int CefBrowserPlatformDelegateNativeAura::TranslateUiChangedButtonFlags(
uint32 cef_modifiers) {
uint32_t cef_modifiers) {
int result = 0;
if (cef_modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON) {
result |= ui::EF_LEFT_MOUSE_BUTTON;

View File

@ -75,8 +75,8 @@ class CefBrowserPlatformDelegateNativeAura
base::OnceClosure GetWidgetDeleteCallback();
static base::TimeTicks GetEventTimeStamp();
static int TranslateUiEventModifiers(uint32 cef_modifiers);
static int TranslateUiChangedButtonFlags(uint32 cef_modifiers);
static int TranslateUiEventModifiers(uint32_t cef_modifiers);
static int TranslateUiChangedButtonFlags(uint32_t cef_modifiers);
// Widget hosting the web contents. It will be deleted automatically when the
// associated root window is destroyed.

View File

@ -513,10 +513,12 @@ CefBrowserPlatformDelegateNativeMac::TranslateWebKeyEvent(
}
NSString* charactersIgnoringModifiers =
[[NSString alloc] initWithCharacters:&key_event.unmodified_character
[[NSString alloc] initWithCharacters:reinterpret_cast<const unichar*>(
&key_event.unmodified_character)
length:1];
NSString* characters =
[[NSString alloc] initWithCharacters:&key_event.character length:1];
NSString* characters = [[NSString alloc]
initWithCharacters:reinterpret_cast<const unichar*>(&key_event.character)
length:1];
NSEvent* synthetic_event =
[NSEvent keyEventWithType:event_type

View File

@ -70,7 +70,7 @@ class RedirectHandler : public CefResourceHandler {
}
void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length,
int64_t& response_length,
CefString& redirectUrl) override {
response_length = 0;
redirectUrl = url_.spec();
@ -111,7 +111,7 @@ class InternalHandler : public CefResourceHandler {
}
void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length,
int64_t& response_length,
CefString& redirectUrl) override {
response_length = size_;

View File

@ -600,8 +600,8 @@ class CefBrowserURLRequest::Context
CefURLRequest::Status status_ = UR_IO_PENDING;
CefRefPtr<CefResponseImpl> response_;
bool response_was_cached_ = false;
int64 upload_data_size_ = 0;
int64 download_data_size_ = -1;
int64_t upload_data_size_ = 0;
int64_t download_data_size_ = -1;
bool got_upload_progress_complete_ = false;
bool cleanup_immediately_ = false;

View File

@ -34,7 +34,7 @@ class SkipCallbackWrapper : public CefResourceSkipCallback {
}
}
void Continue(int64 bytes_skipped) override {
void Continue(int64_t bytes_skipped) override {
if (!work_thread_task_runner_->RunsTasksInCurrentSequence()) {
work_thread_task_runner_->PostTask(
FROM_HERE,

View File

@ -1278,7 +1278,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
static CefRefPtr<CefRequestImpl> MakeRequest(
const network::ResourceRequest* request,
int64 request_id,
int64_t request_id,
bool read_only) {
CefRefPtr<CefRequestImpl> requestPtr = new CefRequestImpl();
requestPtr->Set(request, request_id);

View File

@ -155,7 +155,7 @@ class AcceptWebSocketCallback : public CefCallback {
// static
void CefServer::CreateServer(const CefString& address,
uint16 port,
uint16_t port,
int backlog,
CefRefPtr<CefServerHandler> handler) {
CefRefPtr<CefServerImpl> server(new CefServerImpl(handler));
@ -178,7 +178,7 @@ CefServerImpl::CefServerImpl(CefRefPtr<CefServerHandler> handler)
}
void CefServerImpl::Start(const std::string& address,
uint16 port,
uint16_t port,
int backlog) {
DCHECK(!address.empty());
CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefServerImpl::StartOnUIThread, this,
@ -280,7 +280,7 @@ void CefServerImpl::SendHttp500Response(int connection_id,
void CefServerImpl::SendHttpResponse(int connection_id,
int response_code,
const CefString& content_type,
int64 content_length,
int64_t content_length,
const HeaderMap& extra_headers) {
if (!CEF_CURRENTLY_ON_HT()) {
CEF_POST_TASK_HT(base::BindOnce(&CefServerImpl::SendHttpResponse, this,
@ -540,7 +540,7 @@ void CefServerImpl::OnClose(int connection_id) {
}
void CefServerImpl::StartOnUIThread(const std::string& address,
uint16 port,
uint16_t port,
int backlog) {
CEF_REQUIRE_UIT();
DCHECK(!thread_);
@ -562,7 +562,7 @@ void CefServerImpl::StartOnUIThread(const std::string& address,
}
void CefServerImpl::StartOnHandlerThread(const std::string& address,
uint16 port,
uint16_t port,
int backlog) {
CEF_REQUIRE_HT();

View File

@ -25,7 +25,7 @@ class CefServerImpl : public CefServer, net::HttpServer::Delegate {
CefServerImpl(const CefServerImpl&) = delete;
CefServerImpl& operator=(const CefServerImpl&) = delete;
void Start(const std::string& address, uint16 port, int backlog);
void Start(const std::string& address, uint16_t port, int backlog);
// CefServer methods:
CefRefPtr<CefTaskRunner> GetTaskRunner() override;
@ -44,7 +44,7 @@ class CefServerImpl : public CefServer, net::HttpServer::Delegate {
void SendHttpResponse(int connection_id,
int response_code,
const CefString& content_type,
int64 content_length,
int64_t content_length,
const HeaderMap& extra_headers) override;
void SendRawData(int connection_id,
const void* data,
@ -77,9 +77,9 @@ class CefServerImpl : public CefServer, net::HttpServer::Delegate {
void OnWebSocketMessage(int connection_id, std::string data) override;
void OnClose(int connection_id) override;
void StartOnUIThread(const std::string& address, uint16 port, int backlog);
void StartOnUIThread(const std::string& address, uint16_t port, int backlog);
void StartOnHandlerThread(const std::string& address,
uint16 port,
uint16_t port,
int backlog);
void ShutdownOnHandlerThread();

View File

@ -88,7 +88,7 @@ size_t CefFileReader::Read(void* ptr, size_t size, size_t n) {
return fread(ptr, size, n, file_);
}
int CefFileReader::Seek(int64 offset, int whence) {
int CefFileReader::Seek(int64_t offset, int whence) {
base::AutoLock lock_scope(lock_);
#if BUILDFLAG(IS_WIN)
return _fseeki64(file_, offset, whence);
@ -97,7 +97,7 @@ int CefFileReader::Seek(int64 offset, int whence) {
#endif
}
int64 CefFileReader::Tell() {
int64_t CefFileReader::Tell() {
base::AutoLock lock_scope(lock_);
#if BUILDFLAG(IS_WIN)
return _ftelli64(file_);
@ -128,12 +128,12 @@ size_t CefFileWriter::Write(const void* ptr, size_t size, size_t n) {
return (size_t)fwrite(ptr, size, n, file_);
}
int CefFileWriter::Seek(int64 offset, int whence) {
int CefFileWriter::Seek(int64_t offset, int whence) {
base::AutoLock lock_scope(lock_);
return fseek(file_, offset, whence);
}
int64 CefFileWriter::Tell() {
int64_t CefFileWriter::Tell() {
base::AutoLock lock_scope(lock_);
return ftell(file_);
}
@ -145,7 +145,7 @@ int CefFileWriter::Flush() {
// CefBytesReader
CefBytesReader::CefBytesReader(void* data, int64 datasize, bool copy)
CefBytesReader::CefBytesReader(void* data, int64_t datasize, bool copy)
: data_(nullptr), datasize_(0), copy_(false), offset_(0) {
SetData(data, datasize, copy);
}
@ -163,7 +163,7 @@ size_t CefBytesReader::Read(void* ptr, size_t size, size_t n) {
return ret;
}
int CefBytesReader::Seek(int64 offset, int whence) {
int CefBytesReader::Seek(int64_t offset, int whence) {
int rv = -1L;
base::AutoLock lock_scope(lock_);
switch (whence) {
@ -175,7 +175,7 @@ int CefBytesReader::Seek(int64 offset, int whence) {
rv = 0;
break;
case SEEK_END: {
int64 offset_abs = std::abs(offset);
int64_t offset_abs = std::abs(offset);
if (offset_abs > datasize_) {
break;
}
@ -195,7 +195,7 @@ int CefBytesReader::Seek(int64 offset, int whence) {
return rv;
}
int64 CefBytesReader::Tell() {
int64_t CefBytesReader::Tell() {
base::AutoLock lock_scope(lock_);
return offset_;
}
@ -205,7 +205,7 @@ int CefBytesReader::Eof() {
return (offset_ >= datasize_);
}
void CefBytesReader::SetData(void* data, int64 datasize, bool copy) {
void CefBytesReader::SetData(void* data, int64_t datasize, bool copy) {
base::AutoLock lock_scope(lock_);
if (copy_) {
free(data_);
@ -245,7 +245,7 @@ CefBytesWriter::~CefBytesWriter() {
size_t CefBytesWriter::Write(const void* ptr, size_t size, size_t n) {
base::AutoLock lock_scope(lock_);
size_t rv;
if (offset_ + static_cast<int64>(size * n) >= datasize_ &&
if (offset_ + static_cast<int64_t>(size * n) >= datasize_ &&
Grow(size * n) == 0) {
rv = 0;
} else {
@ -257,7 +257,7 @@ size_t CefBytesWriter::Write(const void* ptr, size_t size, size_t n) {
return rv;
}
int CefBytesWriter::Seek(int64 offset, int whence) {
int CefBytesWriter::Seek(int64_t offset, int whence) {
int rv = -1L;
base::AutoLock lock_scope(lock_);
switch (whence) {
@ -269,7 +269,7 @@ int CefBytesWriter::Seek(int64 offset, int whence) {
rv = 0;
break;
case SEEK_END: {
int64 offset_abs = std::abs(offset);
int64_t offset_abs = std::abs(offset);
if (offset_abs > datasize_) {
break;
}
@ -289,7 +289,7 @@ int CefBytesWriter::Seek(int64 offset, int whence) {
return rv;
}
int64 CefBytesWriter::Tell() {
int64_t CefBytesWriter::Tell() {
base::AutoLock lock_scope(lock_);
return offset_;
}

View File

@ -20,8 +20,8 @@ class CefFileReader : public CefStreamReader {
~CefFileReader() override;
size_t Read(void* ptr, size_t size, size_t n) override;
int Seek(int64 offset, int whence) override;
int64 Tell() override;
int Seek(int64_t offset, int whence) override;
int64_t Tell() override;
int Eof() override;
bool MayBlock() override { return true; }
@ -41,8 +41,8 @@ class CefFileWriter : public CefStreamWriter {
~CefFileWriter() override;
size_t Write(const void* ptr, size_t size, size_t n) override;
int Seek(int64 offset, int whence) override;
int64 Tell() override;
int Seek(int64_t offset, int whence) override;
int64_t Tell() override;
int Flush() override;
bool MayBlock() override { return true; }
@ -58,25 +58,25 @@ class CefFileWriter : public CefStreamWriter {
// Implementation of CefStreamReader for byte buffers.
class CefBytesReader : public CefStreamReader {
public:
CefBytesReader(void* data, int64 datasize, bool copy);
CefBytesReader(void* data, int64_t datasize, bool copy);
~CefBytesReader() override;
size_t Read(void* ptr, size_t size, size_t n) override;
int Seek(int64 offset, int whence) override;
int64 Tell() override;
int Seek(int64_t offset, int whence) override;
int64_t Tell() override;
int Eof() override;
bool MayBlock() override { return false; }
void SetData(void* data, int64 datasize, bool copy);
void SetData(void* data, int64_t datasize, bool copy);
void* GetData() { return data_; }
size_t GetDataSize() { return offset_; }
protected:
void* data_;
int64 datasize_;
int64_t datasize_;
bool copy_;
int64 offset_;
int64_t offset_;
base::Lock lock_;
@ -90,13 +90,13 @@ class CefBytesWriter : public CefStreamWriter {
~CefBytesWriter() override;
size_t Write(const void* ptr, size_t size, size_t n) override;
int Seek(int64 offset, int whence) override;
int64 Tell() override;
int Seek(int64_t offset, int whence) override;
int64_t Tell() override;
int Flush() override;
bool MayBlock() override { return false; }
void* GetData() { return data_; }
int64 GetDataSize() { return offset_; }
int64_t GetDataSize() { return offset_; }
std::string GetDataString();
protected:
@ -104,8 +104,8 @@ class CefBytesWriter : public CefStreamWriter {
size_t grow_;
void* data_;
int64 datasize_;
int64 offset_;
int64_t datasize_;
int64_t offset_;
base::Lock lock_;
@ -121,10 +121,10 @@ class CefHandlerReader : public CefStreamReader {
size_t Read(void* ptr, size_t size, size_t n) override {
return handler_->Read(ptr, size, n);
}
int Seek(int64 offset, int whence) override {
int Seek(int64_t offset, int whence) override {
return handler_->Seek(offset, whence);
}
int64 Tell() override { return handler_->Tell(); }
int64_t Tell() override { return handler_->Tell(); }
int Eof() override { return handler_->Eof(); }
bool MayBlock() override { return handler_->MayBlock(); }
@ -143,10 +143,10 @@ class CefHandlerWriter : public CefStreamWriter {
size_t Write(const void* ptr, size_t size, size_t n) override {
return handler_->Write(ptr, size, n);
}
int Seek(int64 offset, int whence) override {
int Seek(int64_t offset, int whence) override {
return handler_->Seek(offset, whence);
}
int64 Tell() override { return handler_->Tell(); }
int64_t Tell() override { return handler_->Tell(); }
int Flush() override { return handler_->Flush(); }
bool MayBlock() override { return handler_->MayBlock(); }

View File

@ -175,7 +175,7 @@ class CefTestServerImpl::Context {
DCHECK(!test_server_);
}
bool Start(uint16 port,
bool Start(uint16_t port,
bool https_server,
cef_test_cert_type_t https_cert_type) {
DCHECK(thread_checker_.CalledOnValidThread());
@ -252,7 +252,7 @@ class CefTestServerImpl::Context {
EmbeddedTestServerHandle test_server_handle_;
};
bool CefTestServerImpl::Start(uint16 port,
bool CefTestServerImpl::Start(uint16_t port,
bool https_server,
cef_test_cert_type_t https_cert_type,
CefRefPtr<CefTestServerHandler> handler) {
@ -281,7 +281,7 @@ CefString CefTestServerImpl::GetOrigin() {
// static
CefRefPtr<CefTestServer> CefTestServer::CreateAndStart(
uint16 port,
uint16_t port,
bool https_server,
cef_test_cert_type_t https_cert_type,
CefRefPtr<CefTestServerHandler> handler) {

View File

@ -17,7 +17,7 @@ class CefTestServerImpl : public CefTestServer {
CefTestServerImpl(const CefTestServerImpl&) = delete;
CefTestServerImpl& operator=(const CefTestServerImpl&) = delete;
bool Start(uint16 port,
bool Start(uint16_t port,
bool https_server,
cef_test_cert_type_t https_cert_type,
CefRefPtr<CefTestServerHandler> handler);

View File

@ -49,6 +49,6 @@ bool CefEndTracing(const CefString& tracing_file,
return subscriber->EndTracing(base::FilePath(tracing_file), callback);
}
int64 CefNowFromSystemTraceTime() {
int64_t CefNowFromSystemTraceTime() {
return base::TimeTicks::Now().ToInternalValue();
}

View File

@ -111,7 +111,7 @@ CefDisplayImpl::~CefDisplayImpl() {
CEF_REQUIRE_UIT();
}
int64 CefDisplayImpl::GetID() {
int64_t CefDisplayImpl::GetID() {
CEF_REQUIRE_UIT_RETURN(-1);
return display_.id();
}

View File

@ -21,7 +21,7 @@ class CefDisplayImpl : public CefDisplay {
~CefDisplayImpl() override;
// CefDisplay methods:
int64 GetID() override;
int64_t GetID() override;
float GetDeviceScaleFactor() override;
void ConvertPointToPixels(CefPoint& point) override;
void ConvertPointFromPixels(CefPoint& point) override;

View File

@ -554,7 +554,7 @@ CefWindowHandle CefWindowImpl::GetWindowHandle() {
return view_util::GetWindowHandle(widget_);
}
void CefWindowImpl::SendKeyPress(int key_code, uint32 event_flags) {
void CefWindowImpl::SendKeyPress(int key_code, uint32_t event_flags) {
CEF_REQUIRE_VALID_RETURN_VOID();
InitializeUITesting();

View File

@ -75,7 +75,7 @@ class CefWindowImpl
void SetDraggableRegions(
const std::vector<CefDraggableRegion>& regions) override;
CefWindowHandle GetWindowHandle() override;
void SendKeyPress(int key_code, uint32 event_flags) override;
void SendKeyPress(int key_code, uint32_t event_flags) override;
void SendMouseMove(int screen_x, int screen_y) override;
void SendMouseEvents(cef_mouse_button_type_t button,
bool mouse_down,

View File

@ -185,7 +185,7 @@ CefString CefZipReaderImpl::GetFileName() {
return filename_;
}
int64 CefZipReaderImpl::GetFileSize() {
int64_t CefZipReaderImpl::GetFileSize() {
if (!VerifyContext() || !GetFileInfo()) {
return -1;
}
@ -244,7 +244,7 @@ int CefZipReaderImpl::ReadFile(void* buffer, size_t bufferSize) {
return unzReadCurrentFile(reader_, buffer, bufferSize);
}
int64 CefZipReaderImpl::Tell() {
int64_t CefZipReaderImpl::Tell() {
if (!VerifyContext() || !has_fileopen_) {
return -1;
}

View File

@ -26,12 +26,12 @@ class CefZipReaderImpl : public CefZipReader {
bool MoveToFile(const CefString& fileName, bool caseSensitive) override;
bool Close() override;
CefString GetFileName() override;
int64 GetFileSize() override;
int64_t GetFileSize() override;
CefBaseTime GetFileLastModified() override;
bool OpenFile(const CefString& password) override;
bool CloseFile() override;
int ReadFile(void* buffer, size_t bufferSize) override;
int64 Tell() override;
int64_t Tell() override;
bool Eof() override;
bool GetFileInfo();
@ -46,7 +46,7 @@ class CefZipReaderImpl : public CefZipReader {
bool has_fileopen_;
bool has_fileinfo_;
CefString filename_;
int64 filesize_;
int64_t filesize_;
time_t filemodified_;
IMPLEMENT_REFCOUNTING(CefZipReaderImpl);

View File

@ -21,9 +21,9 @@ constexpr const char kCategory[] = "cef.client";
CEF_EXPORT void cef_trace_event_instant(const char* /* category */,
const char* name,
const char* arg1_name,
uint64 arg1_val,
uint64_t arg1_val,
const char* arg2_name,
uint64 arg2_val) {
uint64_t arg2_val) {
DCHECK(name);
if (!name) {
return;
@ -43,9 +43,9 @@ CEF_EXPORT void cef_trace_event_instant(const char* /* category */,
CEF_EXPORT void cef_trace_event_begin(const char* /* category */,
const char* name,
const char* arg1_name,
uint64 arg1_val,
uint64_t arg1_val,
const char* arg2_name,
uint64 arg2_val) {
uint64_t arg2_val) {
DCHECK(name);
if (!name) {
return;
@ -64,9 +64,9 @@ CEF_EXPORT void cef_trace_event_begin(const char* /* category */,
CEF_EXPORT void cef_trace_event_end(const char* /* category */,
const char* name,
const char* arg1_name,
uint64 arg1_val,
uint64_t arg1_val,
const char* arg2_name,
uint64 arg2_val) {
uint64_t arg2_val) {
DCHECK(name);
if (!name) {
return;
@ -84,9 +84,9 @@ CEF_EXPORT void cef_trace_event_end(const char* /* category */,
CEF_EXPORT void cef_trace_counter(const char* /* category */,
const char* name,
const char* value1_name,
uint64 value1_val,
uint64_t value1_val,
const char* value2_name,
uint64 value2_val) {
uint64_t value2_val) {
DCHECK(name);
if (!name) {
return;
@ -102,11 +102,11 @@ CEF_EXPORT void cef_trace_counter(const char* /* category */,
CEF_EXPORT void cef_trace_counter_id(const char* /* category */,
const char* name,
uint64 id,
uint64_t id,
const char* value1_name,
uint64 value1_val,
uint64_t value1_val,
const char* value2_name,
uint64 value2_val) {
uint64_t value2_val) {
DCHECK(name);
if (!name) {
return;
@ -122,11 +122,11 @@ CEF_EXPORT void cef_trace_counter_id(const char* /* category */,
CEF_EXPORT void cef_trace_event_async_begin(const char* /* category */,
const char* name,
uint64 id,
uint64_t id,
const char* arg1_name,
uint64 arg1_val,
uint64_t arg1_val,
const char* arg2_name,
uint64 arg2_val) {
uint64_t arg2_val) {
DCHECK(name);
if (!name) {
return;
@ -144,10 +144,10 @@ CEF_EXPORT void cef_trace_event_async_begin(const char* /* category */,
CEF_EXPORT void cef_trace_event_async_step_into(const char* /* category */,
const char* name,
uint64 id,
uint64 step,
uint64_t id,
uint64_t step,
const char* arg1_name,
uint64 arg1_val) {
uint64_t arg1_val) {
DCHECK(name);
if (!name) {
return;
@ -163,10 +163,10 @@ CEF_EXPORT void cef_trace_event_async_step_into(const char* /* category */,
CEF_EXPORT void cef_trace_event_async_step_past(const char* /* category */,
const char* name,
uint64 id,
uint64 step,
uint64_t id,
uint64_t step,
const char* arg1_name,
uint64 arg1_val) {
uint64_t arg1_val) {
DCHECK(name);
if (!name) {
return;
@ -182,11 +182,11 @@ CEF_EXPORT void cef_trace_event_async_step_past(const char* /* category */,
CEF_EXPORT void cef_trace_event_async_end(const char* /* category */,
const char* name,
uint64 id,
uint64_t id,
const char* arg1_name,
uint64 arg1_val,
uint64_t arg1_val,
const char* arg2_name,
uint64 arg2_val) {
uint64_t arg2_val) {
DCHECK(name);
if (!name) {
return;

View File

@ -389,13 +389,13 @@ CefRequestImpl::TransitionType CefRequestImpl::GetTransitionType() {
return transition_type_;
}
uint64 CefRequestImpl::GetIdentifier() {
uint64_t CefRequestImpl::GetIdentifier() {
base::AutoLock lock_scope(lock_);
return identifier_;
}
void CefRequestImpl::Set(const network::ResourceRequest* request,
uint64 identifier) {
uint64_t identifier) {
base::AutoLock lock_scope(lock_);
CHECK_READONLY_RETURN_VOID();

View File

@ -80,10 +80,10 @@ class CefRequestImpl : public CefRequest {
void SetFirstPartyForCookies(const CefString& url) override;
ResourceType GetResourceType() override;
TransitionType GetTransitionType() override;
uint64 GetIdentifier() override;
uint64_t GetIdentifier() override;
// Populate this object from the ResourceRequest object.
void Set(const network::ResourceRequest* request, uint64 identifier);
void Set(const network::ResourceRequest* request, uint64_t identifier);
// Populate the ResourceRequest object from this object.
// If |changed_only| is true then only the changed fields will be updated.
@ -145,7 +145,7 @@ class CefRequestImpl : public CefRequest {
HeaderMap headermap_;
ResourceType resource_type_;
TransitionType transition_type_;
uint64 identifier_;
uint64_t identifier_;
// The below members are used by CefURLRequest.
int flags_;

View File

@ -21,7 +21,7 @@ void string_utf8_dtor(char* str) {
delete[] str;
}
void string_utf16_dtor(char16* str) {
void string_utf16_dtor(char16_t* str) {
delete[] str;
}
@ -84,7 +84,7 @@ CEF_EXPORT int cef_string_utf8_set(const char* src,
return 1;
}
CEF_EXPORT int cef_string_utf16_set(const char16* src,
CEF_EXPORT int cef_string_utf16_set(const char16_t* src,
size_t src_len,
cef_string_utf16_t* output,
int copy) {
@ -92,18 +92,18 @@ CEF_EXPORT int cef_string_utf16_set(const char16* src,
if (copy) {
if (src && src_len > 0) {
output->str = new char16[src_len + 1];
output->str = new char16_t[src_len + 1];
if (!output->str) {
return 0;
}
memcpy(output->str, src, src_len * sizeof(char16));
memcpy(output->str, src, src_len * sizeof(char16_t));
output->str[src_len] = 0;
output->length = src_len;
output->dtor = string_utf16_dtor;
}
} else {
output->str = const_cast<char16*>(src);
output->str = const_cast<char16_t*>(src);
output->length = src_len;
output->dtor = nullptr;
}
@ -186,7 +186,9 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1,
reinterpret_cast<std::u16string::value_type*>(str2->str),
std::min(str1->length, str2->length));
#else
int r = wcsncmp(str1->str, str2->str, std::min(str1->length, str2->length));
int r = wcsncmp(reinterpret_cast<wchar_t*>(str1->str),
reinterpret_cast<wchar_t*>(str2->str),
std::min(str1->length, str2->length));
#endif
if (r == 0) {
if (str1->length > str2->length) {
@ -225,14 +227,14 @@ CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src,
cef_string_utf16_t* output) {
std::u16string str;
bool ret = base::WideToUTF16(src, src_len, &str);
if (!cef_string_utf16_set(reinterpret_cast<const char16*>(str.c_str()),
if (!cef_string_utf16_set(reinterpret_cast<const char16_t*>(str.c_str()),
str.length(), output, true)) {
return false;
}
return ret;
}
CEF_EXPORT int cef_string_utf16_to_wide(const char16* src,
CEF_EXPORT int cef_string_utf16_to_wide(const char16_t* src,
size_t src_len,
cef_string_wide_t* output) {
std::wstring str;
@ -249,14 +251,14 @@ CEF_EXPORT int cef_string_utf8_to_utf16(const char* src,
cef_string_utf16_t* output) {
std::u16string str;
bool ret = base::UTF8ToUTF16(src, src_len, &str);
if (!cef_string_utf16_set(reinterpret_cast<const char16*>(str.c_str()),
if (!cef_string_utf16_set(reinterpret_cast<const char16_t*>(str.c_str()),
str.length(), output, true)) {
return false;
}
return ret;
}
CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src,
CEF_EXPORT int cef_string_utf16_to_utf8(const char16_t* src,
size_t src_len,
cef_string_utf8_t* output) {
std::string str;
@ -279,7 +281,7 @@ CEF_EXPORT int cef_string_ascii_to_utf16(const char* src,
size_t src_len,
cef_string_utf16_t* output) {
const std::u16string& str = base::ASCIIToUTF16(std::string(src, src_len));
return cef_string_utf16_set(reinterpret_cast<const char16*>(str.c_str()),
return cef_string_utf16_set(reinterpret_cast<const char16_t*>(str.c_str()),
str.length(), output, true);
}
@ -317,20 +319,20 @@ CEF_EXPORT void cef_string_userfree_utf16_free(
delete str;
}
CEF_EXPORT int cef_string_utf16_to_lower(const char16* src,
CEF_EXPORT int cef_string_utf16_to_lower(const char16_t* src,
size_t src_len,
cef_string_utf16_t* output) {
const std::u16string& str = base::i18n::ToLower(std::u16string(
reinterpret_cast<const std::u16string::value_type*>(src), src_len));
return cef_string_utf16_set(reinterpret_cast<const char16*>(str.c_str()),
return cef_string_utf16_set(reinterpret_cast<const char16_t*>(str.c_str()),
str.length(), output, true);
}
CEF_EXPORT int cef_string_utf16_to_upper(const char16* src,
CEF_EXPORT int cef_string_utf16_to_upper(const char16_t* src,
size_t src_len,
cef_string_utf16_t* output) {
const std::u16string& str = base::i18n::ToUpper(std::u16string(
reinterpret_cast<const std::u16string::value_type*>(src), src_len));
return cef_string_utf16_set(reinterpret_cast<const char16*>(str.c_str()),
return cef_string_utf16_set(reinterpret_cast<const char16_t*>(str.c_str()),
str.length(), output, true);
}

View File

@ -35,7 +35,7 @@ bool CefPostTask(CefThreadId threadId, CefRefPtr<CefTask> task) {
bool CefPostDelayedTask(CefThreadId threadId,
CefRefPtr<CefTask> task,
int64 delay_ms) {
int64_t delay_ms) {
scoped_refptr<base::SequencedTaskRunner> task_runner =
CefTaskRunnerImpl::GetTaskRunner(threadId);
if (task_runner.get()) {

View File

@ -139,7 +139,7 @@ bool CefTaskRunnerImpl::PostTask(CefRefPtr<CefTask> task) {
}
bool CefTaskRunnerImpl::PostDelayedTask(CefRefPtr<CefTask> task,
int64 delay_ms) {
int64_t delay_ms) {
return task_runner_->PostDelayedTask(
FROM_HERE, base::BindOnce(&CefTask::Execute, task.get()),
base::Milliseconds(delay_ms));

View File

@ -29,7 +29,7 @@ class CefTaskRunnerImpl : public CefTaskRunner {
bool BelongsToCurrentThread() override;
bool BelongsToThread(CefThreadId threadId) override;
bool PostTask(CefRefPtr<CefTask> task) override;
bool PostDelayedTask(CefRefPtr<CefTask> task, int64 delay_ms) override;
bool PostDelayedTask(CefRefPtr<CefTask> task, int64_t delay_ms) override;
private:
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;

View File

@ -55,7 +55,7 @@ void CefWaitableEventImpl::Wait() {
event_.Wait();
}
bool CefWaitableEventImpl::TimedWait(int64 max_ms) {
bool CefWaitableEventImpl::TimedWait(int64_t max_ms) {
if (!AllowWait()) {
return false;
}

View File

@ -22,7 +22,7 @@ class CefWaitableEventImpl : public CefWaitableEvent {
void Signal() override;
bool IsSignaled() override;
void Wait() override;
bool TimedWait(int64 max_ms) override;
bool TimedWait(int64_t max_ms) override;
private:
base::WaitableEvent event_;

View File

@ -180,7 +180,7 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetFocusedFrame() {
return nullptr;
}
CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(int64 identifier) {
CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(int64_t identifier) {
CEF_REQUIRE_RT_RETURN(nullptr);
return GetWebFrameImpl(identifier).get();
@ -234,7 +234,7 @@ size_t CefBrowserImpl::GetFrameCount() {
return count;
}
void CefBrowserImpl::GetFrameIdentifiers(std::vector<int64>& identifiers) {
void CefBrowserImpl::GetFrameIdentifiers(std::vector<int64_t>& identifiers) {
CEF_REQUIRE_RT_RETURN_VOID();
if (identifiers.size() > 0) {

View File

@ -57,10 +57,10 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
bool HasDocument() override;
CefRefPtr<CefFrame> GetMainFrame() override;
CefRefPtr<CefFrame> GetFocusedFrame() override;
CefRefPtr<CefFrame> GetFrame(int64 identifier) override;
CefRefPtr<CefFrame> GetFrame(int64_t identifier) override;
CefRefPtr<CefFrame> GetFrame(const CefString& name) override;
size_t GetFrameCount() override;
void GetFrameIdentifiers(std::vector<int64>& identifiers) override;
void GetFrameIdentifiers(std::vector<int64_t>& identifiers) override;
void GetFrameNames(std::vector<CefString>& names) override;
CefBrowserImpl(blink::WebView* web_view,
@ -100,7 +100,7 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
bool is_windowless_;
// Map of unique frame ids to CefFrameImpl references.
using FrameMap = std::map<int64, CefRefPtr<CefFrameImpl>>;
using FrameMap = std::map<int64_t, CefRefPtr<CefFrameImpl>>;
FrameMap frames_;
// True if the browser was in the BFCache.
@ -108,7 +108,7 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
// Map of unique frame ids to CefTrackManager objects that need to be cleaned
// up when the frame is deleted.
using FrameObjectMap = std::map<int64, CefRefPtr<CefTrackManager>>;
using FrameObjectMap = std::map<int64_t, CefRefPtr<CefTrackManager>>;
FrameObjectMap frame_objects_;
struct LoadingState {

View File

@ -185,7 +185,7 @@ CefString CefFrameImpl::GetName() {
return name;
}
int64 CefFrameImpl::GetIdentifier() {
int64_t CefFrameImpl::GetIdentifier() {
CEF_REQUIRE_RT_RETURN(0);
return frame_id_;

View File

@ -70,7 +70,7 @@ class CefFrameImpl
bool IsMain() override;
bool IsFocused() override;
CefString GetName() override;
int64 GetIdentifier() override;
int64_t GetIdentifier() override;
CefRefPtr<CefFrame> GetParent() override;
CefString GetURL() override;
CefRefPtr<CefBrowser> GetBrowser() override;
@ -166,7 +166,7 @@ class CefFrameImpl
CefBrowserImpl* browser_;
blink::WebLocalFrame* frame_;
const int64 frame_id_;
const int64_t frame_id_;
bool did_commit_provisional_load_ = false;
bool did_initialize_script_context_ = false;

View File

@ -444,7 +444,7 @@ v8::Local<v8::String> GetV8String(v8::Isolate* isolate, const CefString& str) {
}
#if defined(CEF_STRING_TYPE_UTF16)
void v8impl_string_dtor(char16* str) {
void v8impl_string_dtor(char16_t* str) {
delete[] str;
}
#elif defined(CEF_STRING_TYPE_UTF8)
@ -481,7 +481,7 @@ void GetCefString(v8::Isolate* isolate,
if (len == 0) {
return;
}
char16* buf = new char16[len + 1];
char16_t* buf = new char16_t[len + 1];
str->Write(isolate, reinterpret_cast<uint16_t*>(buf), 0, len + 1);
#else
// Allocate enough space for a worst-case conversion.
@ -1274,7 +1274,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateBool(bool value) {
}
// static
CefRefPtr<CefV8Value> CefV8Value::CreateInt(int32 value) {
CefRefPtr<CefV8Value> CefV8Value::CreateInt(int32_t value) {
CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
@ -1283,7 +1283,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateInt(int32 value) {
}
// static
CefRefPtr<CefV8Value> CefV8Value::CreateUInt(uint32 value) {
CefRefPtr<CefV8Value> CefV8Value::CreateUInt(uint32_t value) {
CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
@ -1597,13 +1597,13 @@ void CefV8ValueImpl::InitBool(bool value) {
bool_value_ = value;
}
void CefV8ValueImpl::InitInt(int32 value) {
void CefV8ValueImpl::InitInt(int32_t value) {
DCHECK_EQ(type_, TYPE_INVALID);
type_ = TYPE_INT;
int_value_ = value;
}
void CefV8ValueImpl::InitUInt(uint32 value) {
void CefV8ValueImpl::InitUInt(uint32_t value) {
DCHECK_EQ(type_, TYPE_INVALID);
type_ = TYPE_UINT;
uint_value_ = value;
@ -1814,7 +1814,7 @@ bool CefV8ValueImpl::GetBoolValue() {
return false;
}
int32 CefV8ValueImpl::GetIntValue() {
int32_t CefV8ValueImpl::GetIntValue() {
CEF_V8_REQUIRE_ISOLATE_RETURN(0);
if (type_ == TYPE_INT || type_ == TYPE_UINT) {
return int_value_;
@ -1822,7 +1822,7 @@ int32 CefV8ValueImpl::GetIntValue() {
return 0;
}
uint32 CefV8ValueImpl::GetUIntValue() {
uint32_t CefV8ValueImpl::GetUIntValue() {
CEF_V8_REQUIRE_ISOLATE_RETURN(0);
if (type_ == TYPE_INT || type_ == TYPE_UINT) {
return uint_value_;

View File

@ -214,8 +214,8 @@ class CefV8ValueImpl : public CefV8Value {
void InitUndefined();
void InitNull();
void InitBool(bool value);
void InitInt(int32 value);
void InitUInt(uint32 value);
void InitInt(int32_t value);
void InitUInt(uint32_t value);
void InitDouble(double value);
void InitDate(CefBaseTime value);
void InitString(CefString& value);
@ -241,8 +241,8 @@ class CefV8ValueImpl : public CefV8Value {
bool IsPromise() override;
bool IsSame(CefRefPtr<CefV8Value> value) override;
bool GetBoolValue() override;
int32 GetIntValue() override;
uint32 GetUIntValue() override;
int32_t GetIntValue() override;
uint32_t GetUIntValue() override;
double GetDoubleValue() override;
CefBaseTime GetDateValue() override;
CefString GetStringValue() override;
@ -348,8 +348,8 @@ class CefV8ValueImpl : public CefV8Value {
union {
bool bool_value_;
int32 int_value_;
uint32 uint_value_;
int32_t int_value_;
uint32_t uint_value_;
double double_value_;
cef_basetime_t date_value_;
cef_string_t string_value_;

View File

@ -256,12 +256,25 @@ ErrnoLogMessage::~ErrnoLogMessage() {
} // namespace cef
std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
std::wstring tmp_str(wstr);
if (!tmp_str.empty()) {
const auto length = wstr ? std::char_traits<wchar_t>::length(wstr) : 0U;
if (length > 0) {
cef_string_utf8_t str = {0};
cef_string_wide_to_utf8(wstr, tmp_str.size(), &str);
cef_string_wide_to_utf8(wstr, length, &str);
out << str.str;
cef_string_utf8_clear(&str);
}
return out;
}
#if defined(WCHAR_T_IS_UTF32)
std::ostream& operator<<(std::ostream& out, const char16_t* wstr) {
const auto length = wstr ? std::char_traits<char16_t>::length(wstr) : 0U;
if (length > 0) {
cef_string_utf8_t str = {0};
cef_string_utf16_to_utf8(wstr, length, &str);
out << str.str;
cef_string_utf8_clear(&str);
}
return out;
}
#endif

View File

@ -25,7 +25,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
// Called due to cefQuery execution in binding.html.
virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) override {

View File

@ -654,7 +654,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
mouseEvent.x = client::DeviceToLogical(point.x, device_scale_factor);
mouseEvent.y = client::DeviceToLogical(point.y, device_scale_factor);
mouseEvent.modifiers = static_cast<uint32>([NSEvent modifierFlags]);
mouseEvent.modifiers = static_cast<uint32_t>([NSEvent modifierFlags]);
}
- (int)getModifiersForEvent:(NSEvent*)event {
@ -1023,7 +1023,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
CefRefPtr<CefStreamWriter> writer =
CefStreamWriter::CreateForHandler(handler.get());
current_drag_data_->GetFileContents(writer);
DCHECK_EQ(handler->GetDataSize(), static_cast<int64>(size));
DCHECK_EQ(handler->GetDataSize(), static_cast<int64_t>(size));
[pboard setData:[NSData dataWithBytes:handler->GetData()
length:handler->GetDataSize()]

View File

@ -27,7 +27,7 @@ BytesWriteHandler::~BytesWriteHandler() {
size_t BytesWriteHandler::Write(const void* ptr, size_t size, size_t n) {
base::AutoLock lock_scope(lock_);
size_t rv;
if (offset_ + static_cast<int64>(size * n) >= datasize_ &&
if (offset_ + static_cast<int64_t>(size * n) >= datasize_ &&
Grow(size * n) == 0) {
rv = 0;
} else {
@ -39,7 +39,7 @@ size_t BytesWriteHandler::Write(const void* ptr, size_t size, size_t n) {
return rv;
}
int BytesWriteHandler::Seek(int64 offset, int whence) {
int BytesWriteHandler::Seek(int64_t offset, int whence) {
int rv = -1L;
base::AutoLock lock_scope(lock_);
switch (whence) {
@ -51,7 +51,7 @@ int BytesWriteHandler::Seek(int64 offset, int whence) {
rv = 0;
break;
case SEEK_END: {
int64 offset_abs = std::abs(offset);
int64_t offset_abs = std::abs(offset);
if (offset_abs > datasize_) {
break;
}
@ -71,7 +71,7 @@ int BytesWriteHandler::Seek(int64 offset, int whence) {
return rv;
}
int64 BytesWriteHandler::Tell() {
int64_t BytesWriteHandler::Tell() {
base::AutoLock lock_scope(lock_);
return offset_;
}

View File

@ -17,21 +17,21 @@ class BytesWriteHandler : public CefWriteHandler {
~BytesWriteHandler();
size_t Write(const void* ptr, size_t size, size_t n) override;
int Seek(int64 offset, int whence) override;
int64 Tell() override;
int Seek(int64_t offset, int whence) override;
int64_t Tell() override;
int Flush() override;
bool MayBlock() override { return false; }
void* GetData() { return data_; }
int64 GetDataSize() { return offset_; }
int64_t GetDataSize() { return offset_; }
private:
size_t Grow(size_t size);
size_t grow_;
void* data_;
int64 datasize_;
int64 offset_;
int64_t datasize_;
int64_t offset_;
base::Lock lock_;

View File

@ -1057,7 +1057,7 @@ bool ClientHandler::OnRequestMediaAccessPermission(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& requesting_origin,
uint32 requested_permissions,
uint32_t requested_permissions,
CefRefPtr<CefMediaAccessCallback> callback) {
callback->Continue(media_handling_disabled_ ? CEF_MEDIA_PERMISSION_NONE
: requested_permissions);

View File

@ -244,7 +244,7 @@ class ClientHandler : public CefClient,
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& requesting_origin,
uint32 requested_permissions,
uint32_t requested_permissions,
CefRefPtr<CefMediaAccessCallback> callback) override;
// CefRequestHandler methods

View File

@ -93,7 +93,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
// Called due to cefQuery execution in dialogs.html.
virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) override {

View File

@ -383,7 +383,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
// Called due to cefQuery execution in media_router.html.
bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) override {
@ -497,7 +497,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
void OnQueryCanceled(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id) override {
int64_t query_id) override {
CEF_REQUIRE_UI_THREAD();
RemoveSubscription(browser->GetIdentifier(), query_id);
}
@ -535,13 +535,13 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
// Subscription state associated with a single browser.
struct SubscriptionState {
int64 query_id;
int64_t query_id;
CefRefPtr<MediaObserver> observer;
CefRefPtr<CefRegistration> registration;
};
bool CreateSubscription(CefRefPtr<CefBrowser> browser,
int64 query_id,
int64_t query_id,
CefRefPtr<Callback> callback) {
const int browser_id = browser->GetIdentifier();
if (subscription_state_map_.find(browser_id) !=
@ -566,7 +566,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
return true;
}
void RemoveSubscription(int browser_id, int64 query_id) {
void RemoveSubscription(int browser_id, int64_t query_id) {
SubscriptionStateMap::iterator it =
subscription_state_map_.find(browser_id);
if (it != subscription_state_map_.end() &&

View File

@ -262,7 +262,7 @@ bool DragDataToDataObject(CefRefPtr<CefDragData> drag_data,
CefRefPtr<CefStreamWriter> writer =
CefStreamWriter::CreateForHandler(handler.get());
drag_data->GetFileContents(writer);
DCHECK_EQ(handler->GetDataSize(), static_cast<int64>(bufferSize));
DCHECK_EQ(handler->GetDataSize(), static_cast<int64_t>(bufferSize));
CefString fileName = drag_data->GetFileName();
GetStorageForFileDescriptor(&stgmeds[curr_index], fileName.ToWString());
fmtetc.cfFormat = file_desc_format;

View File

@ -70,7 +70,7 @@ void GetCompositionUnderlines(
uint32_t target_end,
std::vector<CefCompositionUnderline>& underlines) {
int clause_size = ::ImmGetCompositionString(imc, GCS_COMPCLAUSE, nullptr, 0);
int clause_length = clause_size / sizeof(uint32);
int clause_length = clause_size / sizeof(uint32_t);
if (clause_length) {
std::vector<uint32_t> clause_data(clause_length);

View File

@ -71,7 +71,7 @@ void OsrRenderHandlerWin::TriggerBeginFrame(uint64_t last_time_us,
CefPostDelayedTask(TID_UI,
base::BindOnce(&OsrRenderHandlerWin::TriggerBeginFrame,
weak_factory_.GetWeakPtr(), now, delay_us),
int64(offset / 1000.0));
static_cast<int64_t>(offset / 1000.0));
if (settings_.external_begin_frame_enabled && browser_) {
// We're running the BeginFrame timer. Trigger rendering via

View File

@ -46,7 +46,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
// Called due to cefQuery execution in preferences.html.
bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) override {

View File

@ -78,7 +78,7 @@ class ClientSchemeHandler : public CefResourceHandler {
}
void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length,
int64_t& response_length,
CefString& redirectUrl) override {
CEF_REQUIRE_IO_THREAD();

View File

@ -180,7 +180,7 @@ class ServerHandler : public CefServerHandler {
CefResponse::HeaderMap extra_headers) {
// Determine the stream size.
stream->Seek(0, SEEK_END);
int64 content_length = stream->Tell();
int64_t content_length = stream->Tell();
stream->Seek(0, SEEK_SET);
// Send response headers.
@ -226,7 +226,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
// Called due to cefQuery execution in server.html.
virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) override {

View File

@ -167,7 +167,7 @@ class PromptHandler : public CefMessageRouterBrowserSide::Handler {
// Called due to cefQuery execution.
virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) override {

View File

@ -50,12 +50,12 @@ class RequestClient : public CefURLRequestClient {
}
void OnUploadProgress(CefRefPtr<CefURLRequest> request,
int64 current,
int64 total) override {}
int64_t current,
int64_t total) override {}
void OnDownloadProgress(CefRefPtr<CefURLRequest> request,
int64 current,
int64 total) override {}
int64_t current,
int64_t total) override {}
void OnDownloadData(CefRefPtr<CefURLRequest> request,
const void* data,
@ -91,7 +91,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
// Called due to cefQuery execution in urlrequest.html.
bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) override {

View File

@ -20,7 +20,7 @@ const int kMenuBarGroupId = 100;
// If the mnemonic is capital I and the UI language is Turkish, lowercasing it
// results in 'small dotless i', which is different from a 'dotted i'. Similar
// issues may exist for az and lt locales.
char16 ToLower(char16 c) {
char16_t ToLower(char16_t c) {
CefStringUTF16 str16;
cef_string_utf16_to_lower(&c, 1, str16.GetWritableStruct());
return str16.length() > 0 ? str16.c_str()[0] : 0;
@ -28,7 +28,7 @@ char16 ToLower(char16 c) {
// Extract the mnemonic character from |title|. For example, if |title| is
// "&Test" then the mnemonic character is 'T'.
char16 GetMnemonic(const std::u16string& title) {
char16_t GetMnemonic(const std::u16string& title) {
size_t index = 0;
do {
index = title.find('&', index);
@ -92,7 +92,7 @@ CefRefPtr<CefMenuModel> ViewsMenuBar::CreateMenuModel(const CefString& label,
panel_->AddChildView(button);
// Extract the mnemonic that triggers the menu, if any.
char16 mnemonic = GetMnemonic(label);
char16_t mnemonic = GetMnemonic(label);
if (mnemonic != 0) {
mnemonics_.insert(std::make_pair(mnemonic, new_menu_id));
}

View File

@ -112,7 +112,7 @@ class ViewsMenuBar : public CefMenuButtonDelegate, public CefMenuModelDelegate {
bool last_nav_with_keyboard_;
// Map of mnemonic to MenuButton ID.
typedef std::map<char16, int> MnemonicMap;
typedef std::map<char16_t, int> MnemonicMap;
MnemonicMap mnemonics_;
IMPLEMENT_REFCOUNTING(ViewsMenuBar);

View File

@ -87,7 +87,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
// Called due to cefBroadcast execution in window.html.
virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
int64_t query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) override {

View File

@ -45,9 +45,9 @@ class V8Handler : public CefV8Handler {
for (int i = 0; i < kPerfTestsCount; ++i) {
if (test == kPerfTests[i].name) {
// Execute the test.
int64 delta = kPerfTests[i].test(kPerfTests[i].iterations);
int64_t delta = kPerfTests[i].test(kPerfTests[i].iterations);
retval = CefV8Value::CreateInt(static_cast<int32>(delta));
retval = CefV8Value::CreateInt(static_cast<int32_t>(delta));
found = true;
break;
}
@ -74,7 +74,7 @@ class V8Handler : public CefV8Handler {
if (arguments.size() == 0) {
retval = CefV8Value::CreateInt(1);
} else if (arguments.size() == 1 && arguments[0]->IsInt()) {
int32 type = arguments[0]->GetIntValue();
int32_t type = arguments[0]->GetIntValue();
switch (type) {
case 0:
retval = CefV8Value::CreateUndefined();

Some files were not shown because too many files have changed in this diff Show More