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" #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_ #endif // CEF_INCLUDE_BASE_CEF_BASICTYPES_H_

View File

@ -253,7 +253,7 @@
// The compiler thinks std::string::const_iterator and "const char*" are // The compiler thinks std::string::const_iterator and "const char*" are
// equivalent types. // equivalent types.
#define STD_STRING_ITERATOR_IS_CHAR_POINTER #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. // equivalent types.
#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER #define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
#endif #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) { inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
return out << wstr.c_str(); 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 // The NOTIMPLEMENTED() macro annotates codepaths which have
// not been implemented yet. // not been implemented yet.

View File

@ -87,7 +87,7 @@ class CefAudioHandler : public virtual CefBaseRefCounted {
virtual void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, virtual void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser,
const float** data, const float** data,
int frames, int frames,
int64 pts) = 0; int64_t pts) = 0;
/// ///
/// Called on the UI thread when the stream has stopped. OnAudioSteamStopped /// 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. /// Returns the frame with the specified identifier, or NULL if not found.
/// ///
/*--cef(capi_name=get_frame_byident)--*/ /*--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. /// 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. /// Returns the identifiers of all existing frames.
/// ///
/*--cef(count_func=identifiers:GetFrameCount)--*/ /*--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. /// Returns the names of all existing frames.
@ -456,7 +456,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
/*--cef()--*/ /*--cef()--*/
virtual void DownloadImage(const CefString& image_url, virtual void DownloadImage(const CefString& image_url,
bool is_favicon, bool is_favicon,
uint32 max_image_size, uint32_t max_image_size,
bool bypass_cache, bool bypass_cache,
CefRefPtr<CefDownloadImageCallback> callback) = 0; CefRefPtr<CefDownloadImageCallback> callback) = 0;

View File

@ -111,7 +111,7 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted {
/// pending scheduled call should be cancelled. /// pending scheduled call should be cancelled.
/// ///
/*--cef()--*/ /*--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 /// 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. /// Returns a simple speed estimate in bytes/s.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual int64 GetCurrentSpeed() = 0; virtual int64_t GetCurrentSpeed() = 0;
/// ///
/// Returns the rough percent complete or -1 if the receive total size is /// 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. /// Returns the total number of bytes.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual int64 GetTotalBytes() = 0; virtual int64_t GetTotalBytes() = 0;
/// ///
/// Returns the number of received bytes. /// Returns the number of received bytes.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual int64 GetReceivedBytes() = 0; virtual int64_t GetReceivedBytes() = 0;
/// ///
/// Returns the time that the download started. /// Returns the time that the download started.
@ -130,7 +130,7 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
/// Returns the unique identifier for this download. /// Returns the unique identifier for this download.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual uint32 GetId() = 0; virtual uint32_t GetId() = 0;
/// ///
/// Returns the URL. /// Returns the URL.

View File

@ -184,7 +184,7 @@ class CefFrame : public virtual CefBaseRefCounted {
/// underlying frame does not yet exist. /// underlying frame does not yet exist.
/// ///
/*--cef()--*/ /*--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) /// 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. /// OnRequestMediaAccessPermission.
/// ///
/*--cef(capi_name=cont)--*/ /*--cef(capi_name=cont)--*/
virtual void Continue(uint32 allowed_permissions) = 0; virtual void Continue(uint32_t allowed_permissions) = 0;
/// ///
/// Cancel the media access request. /// Cancel the media access request.
@ -104,7 +104,7 @@ class CefPermissionHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefBrowser> browser, CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
const CefString& requesting_origin, const CefString& requesting_origin,
uint32 requested_permissions, uint32_t requested_permissions,
CefRefPtr<CefMediaAccessCallback> callback) { CefRefPtr<CefMediaAccessCallback> callback) {
return false; return false;
} }
@ -123,9 +123,9 @@ class CefPermissionHandler : public virtual CefBaseRefCounted {
/*--cef()--*/ /*--cef()--*/
virtual bool OnShowPermissionPrompt( virtual bool OnShowPermissionPrompt(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefBrowser> browser,
uint64 prompt_id, uint64_t prompt_id,
const CefString& requesting_origin, const CefString& requesting_origin,
uint32 requested_permissions, uint32_t requested_permissions,
CefRefPtr<CefPermissionPromptCallback> callback) { CefRefPtr<CefPermissionPromptCallback> callback) {
return false; return false;
} }
@ -142,7 +142,7 @@ class CefPermissionHandler : public virtual CefBaseRefCounted {
/*--cef()--*/ /*--cef()--*/
virtual void OnDismissPermissionPrompt( virtual void OnDismissPermissionPrompt(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefBrowser> browser,
uint64 prompt_id, uint64_t prompt_id,
cef_permission_request_result_t result) {} 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. /// browser process to track a single request across multiple callbacks.
/// ///
/*--cef()--*/ /*--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. /// <= 0 the request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE.
/// ///
/*--cef(capi_name=cont)--*/ /*--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()--*/ /*--cef()--*/
virtual void GetResponseHeaders(CefRefPtr<CefResponse> response, virtual void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length, int64_t& response_length,
CefString& redirectUrl) = 0; CefString& redirectUrl) = 0;
/// ///
@ -149,8 +149,8 @@ class CefResourceHandler : public virtual CefBaseRefCounted {
/// method will be called in sequence but not from a dedicated thread. /// method will be called in sequence but not from a dedicated thread.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual bool Skip(int64 bytes_to_skip, virtual bool Skip(int64_t bytes_to_skip,
int64& bytes_skipped, int64_t& bytes_skipped,
CefRefPtr<CefResourceSkipCallback> callback) { CefRefPtr<CefResourceSkipCallback> callback) {
bytes_skipped = -2; bytes_skipped = -2;
return false; return false;

View File

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

View File

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

View File

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

View File

@ -118,7 +118,7 @@ class CefTaskRunner : public virtual CefBaseRefCounted {
/// specified delay. /// specified delay.
/// ///
/*--cef()--*/ /*--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()--*/ /*--cef()--*/
bool CefPostDelayedTask(CefThreadId threadId, bool CefPostDelayedTask(CefThreadId threadId,
CefRefPtr<CefTask> task, CefRefPtr<CefTask> task,
int64 delay_ms); int64_t delay_ms);
#endif // CEF_INCLUDE_CEF_TASK_H_ #endif // CEF_INCLUDE_CEF_TASK_H_

View File

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

View File

@ -152,8 +152,8 @@ class CefURLRequestClient : public virtual CefBaseRefCounted {
/// ///
/*--cef()--*/ /*--cef()--*/
virtual void OnUploadProgress(CefRefPtr<CefURLRequest> request, virtual void OnUploadProgress(CefRefPtr<CefURLRequest> request,
int64 current, int64_t current,
int64 total) = 0; int64_t total) = 0;
/// ///
/// Notifies the client of download progress. |current| denotes the number of /// Notifies the client of download progress. |current| denotes the number of
@ -162,8 +162,8 @@ class CefURLRequestClient : public virtual CefBaseRefCounted {
/// ///
/*--cef()--*/ /*--cef()--*/
virtual void OnDownloadProgress(CefRefPtr<CefURLRequest> request, virtual void OnDownloadProgress(CefRefPtr<CefURLRequest> request,
int64 current, int64_t current,
int64 total) = 0; int64_t total) = 0;
/// ///
/// Called when some part of the response is read. |data| contains the current /// 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. /// Create a new CefV8Value object of type int.
/// ///
/*--cef()--*/ /*--cef()--*/
static CefRefPtr<CefV8Value> CreateInt(int32 value); static CefRefPtr<CefV8Value> CreateInt(int32_t value);
/// ///
/// Create a new CefV8Value object of type unsigned int. /// Create a new CefV8Value object of type unsigned int.
/// ///
/*--cef()--*/ /*--cef()--*/
static CefRefPtr<CefV8Value> CreateUInt(uint32 value); static CefRefPtr<CefV8Value> CreateUInt(uint32_t value);
/// ///
/// Create a new CefV8Value object of type double. /// Create a new CefV8Value object of type double.
@ -648,13 +648,13 @@ class CefV8Value : public virtual CefBaseRefCounted {
/// Return an int value. /// Return an int value.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual int32 GetIntValue() = 0; virtual int32_t GetIntValue() = 0;
/// ///
/// Return an unsigned int value. /// Return an unsigned int value.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual uint32 GetUIntValue() = 0; virtual uint32_t GetUIntValue() = 0;
/// ///
/// Return a double value. /// Return a double value.

View File

@ -103,7 +103,7 @@ class CefWaitableEvent : public CefBaseRefCounted {
/// called on the browser process UI or IO threads. /// called on the browser process UI or IO threads.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual bool TimedWait(int64 max_ms) = 0; virtual bool TimedWait(int64_t max_ms) = 0;
}; };
#endif // CEF_INCLUDE_CEF_WAITABLE_EVENT_H_ #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. /// Returns the uncompressed size of the file.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual int64 GetFileSize() = 0; virtual int64_t GetFileSize() = 0;
/// ///
/// Returns the last modified timestamp for the file. /// 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. /// Returns the current offset in the uncompressed file contents.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual int64 Tell() = 0; virtual int64_t Tell() = 0;
/// ///
/// Returns true if at end of the file contents. /// 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_to_wide cef_string_utf8_to_wide
#define cef_string_from_wide cef_string_wide_to_utf8 #define cef_string_from_wide cef_string_wide_to_utf8
#elif defined(CEF_STRING_TYPE_UTF16) #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_userfree_utf16_t cef_string_userfree_t;
typedef cef_string_utf16_t cef_string_t; typedef cef_string_utf16_t cef_string_t;
#define cef_string_set cef_string_utf16_set #define cef_string_set cef_string_utf16_set

View File

@ -70,9 +70,9 @@ typedef struct _cef_string_utf8_t {
} cef_string_utf8_t; } cef_string_utf8_t;
typedef struct _cef_string_utf16_t { typedef struct _cef_string_utf16_t {
char16* str; char16_t* str;
size_t length; size_t length;
void (*dtor)(char16* str); void (*dtor)(char16_t* str);
} cef_string_utf16_t; } cef_string_utf16_t;
/// ///
@ -89,7 +89,7 @@ CEF_EXPORT int cef_string_utf8_set(const char* src,
size_t src_len, size_t src_len,
cef_string_utf8_t* output, cef_string_utf8_t* output,
int copy); 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, size_t src_len,
cef_string_utf16_t* output, cef_string_utf16_t* output,
int copy); 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, CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src,
size_t src_len, size_t src_len,
cef_string_utf16_t* output); 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, size_t src_len,
cef_string_wide_t* output); cef_string_wide_t* output);
CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, CEF_EXPORT int cef_string_utf8_to_utf16(const char* src,
size_t src_len, size_t src_len,
cef_string_utf16_t* output); 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, size_t src_len,
cef_string_utf8_t* output); 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. /// 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, size_t src_len,
cef_string_utf16_t* output); 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, size_t src_len,
cef_string_utf16_t* output); cef_string_utf16_t* output);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -123,7 +123,7 @@ class CefDisplay : public CefBaseRefCounted {
/// Returns the unique identifier for this Display. /// Returns the unique identifier for this Display.
/// ///
/*--cef()--*/ /*--cef()--*/
virtual int64 GetID() = 0; virtual int64_t GetID() = 0;
/// ///
/// Returns this Display's device pixel scale factor. This specifies how much /// 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. /// primarily for testing purposes.
/// ///
/*--cef()--*/ /*--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 /// 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. // CefReadHandler methods.
virtual size_t Read(void* ptr, size_t size, size_t n) override; virtual size_t Read(void* ptr, size_t size, size_t n) override;
virtual int Seek(int64 offset, int whence) override; virtual int Seek(int64_t offset, int whence) override;
virtual int64 Tell() override; virtual int64_t Tell() override;
virtual int Eof() override; virtual int Eof() override;
virtual bool MayBlock() override { return false; } virtual bool MayBlock() override { return false; }
private: private:
const unsigned char* bytes_; const unsigned char* bytes_;
int64 size_; int64_t size_;
int64 offset_; int64_t offset_;
CefRefPtr<CefBaseRefCounted> source_; CefRefPtr<CefBaseRefCounted> source_;
base::Lock lock_; base::Lock lock_;

View File

@ -109,9 +109,9 @@ bool CefPostTask(CefThreadId threadId, const base::RepeatingClosure& closure);
/// ///
bool CefPostDelayedTask(CefThreadId threadId, bool CefPostDelayedTask(CefThreadId threadId,
base::OnceClosure closure, base::OnceClosure closure,
int64 delay_ms); int64_t delay_ms);
bool CefPostDelayedTask(CefThreadId threadId, bool CefPostDelayedTask(CefThreadId threadId,
const base::RepeatingClosure& closure, const base::RepeatingClosure& closure,
int64 delay_ms); int64_t delay_ms);
#endif // CEF_INCLUDE_WRAPPER_CEF_CLOSURE_TASK_H_ #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 // 8. Handle the query in your Handler::OnQuery implementation and execute the
// appropriate callback either immediately or asynchronously. // appropriate callback either immediately or asynchronously.
// //
// void MyHandler::OnQuery(int64 query_id, // void MyHandler::OnQuery(int64_t query_id,
// CefRefPtr<CefBrowser> browser, // CefRefPtr<CefBrowser> browser,
// CefRefPtr<CefFrame> frame, // CefRefPtr<CefFrame> frame,
// const CefString& request, // const CefString& request,
@ -269,7 +269,7 @@ class CefMessageRouterBrowserSide
/// ///
virtual bool OnQuery(CefRefPtr<CefBrowser> browser, virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
int64 query_id, int64_t query_id,
const CefString& request, const CefString& request,
bool persistent, bool persistent,
CefRefPtr<Callback> callback) { CefRefPtr<Callback> callback) {
@ -287,7 +287,7 @@ class CefMessageRouterBrowserSide
/// ///
virtual void OnQueryCanceled(CefRefPtr<CefBrowser> browser, virtual void OnQueryCanceled(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
int64 query_id) {} int64_t query_id) {}
virtual ~Handler() {} virtual ~Handler() {}
}; };

View File

@ -361,7 +361,7 @@ class CefResourceManager
ProviderEntryList providers_; ProviderEntryList providers_;
// Map of response ID to pending CefResourceHandler object. // 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_; PendingHandlersMap pending_handlers_;
UrlFilter url_filter_; UrlFilter url_filter_;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -600,8 +600,8 @@ class CefBrowserURLRequest::Context
CefURLRequest::Status status_ = UR_IO_PENDING; CefURLRequest::Status status_ = UR_IO_PENDING;
CefRefPtr<CefResponseImpl> response_; CefRefPtr<CefResponseImpl> response_;
bool response_was_cached_ = false; bool response_was_cached_ = false;
int64 upload_data_size_ = 0; int64_t upload_data_size_ = 0;
int64 download_data_size_ = -1; int64_t download_data_size_ = -1;
bool got_upload_progress_complete_ = false; bool got_upload_progress_complete_ = false;
bool cleanup_immediately_ = 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()) { if (!work_thread_task_runner_->RunsTasksInCurrentSequence()) {
work_thread_task_runner_->PostTask( work_thread_task_runner_->PostTask(
FROM_HERE, FROM_HERE,

View File

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

View File

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

View File

@ -25,7 +25,7 @@ class CefServerImpl : public CefServer, net::HttpServer::Delegate {
CefServerImpl(const CefServerImpl&) = delete; CefServerImpl(const CefServerImpl&) = delete;
CefServerImpl& operator=(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: // CefServer methods:
CefRefPtr<CefTaskRunner> GetTaskRunner() override; CefRefPtr<CefTaskRunner> GetTaskRunner() override;
@ -44,7 +44,7 @@ class CefServerImpl : public CefServer, net::HttpServer::Delegate {
void SendHttpResponse(int connection_id, void SendHttpResponse(int connection_id,
int response_code, int response_code,
const CefString& content_type, const CefString& content_type,
int64 content_length, int64_t content_length,
const HeaderMap& extra_headers) override; const HeaderMap& extra_headers) override;
void SendRawData(int connection_id, void SendRawData(int connection_id,
const void* data, const void* data,
@ -77,9 +77,9 @@ class CefServerImpl : public CefServer, net::HttpServer::Delegate {
void OnWebSocketMessage(int connection_id, std::string data) override; void OnWebSocketMessage(int connection_id, std::string data) override;
void OnClose(int connection_id) 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, void StartOnHandlerThread(const std::string& address,
uint16 port, uint16_t port,
int backlog); int backlog);
void ShutdownOnHandlerThread(); 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_); 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_); base::AutoLock lock_scope(lock_);
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
return _fseeki64(file_, offset, whence); return _fseeki64(file_, offset, whence);
@ -97,7 +97,7 @@ int CefFileReader::Seek(int64 offset, int whence) {
#endif #endif
} }
int64 CefFileReader::Tell() { int64_t CefFileReader::Tell() {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
return _ftelli64(file_); 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_); 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_); base::AutoLock lock_scope(lock_);
return fseek(file_, offset, whence); return fseek(file_, offset, whence);
} }
int64 CefFileWriter::Tell() { int64_t CefFileWriter::Tell() {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
return ftell(file_); return ftell(file_);
} }
@ -145,7 +145,7 @@ int CefFileWriter::Flush() {
// CefBytesReader // 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) { : data_(nullptr), datasize_(0), copy_(false), offset_(0) {
SetData(data, datasize, copy); SetData(data, datasize, copy);
} }
@ -163,7 +163,7 @@ size_t CefBytesReader::Read(void* ptr, size_t size, size_t n) {
return ret; return ret;
} }
int CefBytesReader::Seek(int64 offset, int whence) { int CefBytesReader::Seek(int64_t offset, int whence) {
int rv = -1L; int rv = -1L;
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
switch (whence) { switch (whence) {
@ -175,7 +175,7 @@ int CefBytesReader::Seek(int64 offset, int whence) {
rv = 0; rv = 0;
break; break;
case SEEK_END: { case SEEK_END: {
int64 offset_abs = std::abs(offset); int64_t offset_abs = std::abs(offset);
if (offset_abs > datasize_) { if (offset_abs > datasize_) {
break; break;
} }
@ -195,7 +195,7 @@ int CefBytesReader::Seek(int64 offset, int whence) {
return rv; return rv;
} }
int64 CefBytesReader::Tell() { int64_t CefBytesReader::Tell() {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
return offset_; return offset_;
} }
@ -205,7 +205,7 @@ int CefBytesReader::Eof() {
return (offset_ >= datasize_); 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_); base::AutoLock lock_scope(lock_);
if (copy_) { if (copy_) {
free(data_); free(data_);
@ -245,7 +245,7 @@ CefBytesWriter::~CefBytesWriter() {
size_t CefBytesWriter::Write(const void* ptr, size_t size, size_t n) { size_t CefBytesWriter::Write(const void* ptr, size_t size, size_t n) {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
size_t rv; size_t rv;
if (offset_ + static_cast<int64>(size * n) >= datasize_ && if (offset_ + static_cast<int64_t>(size * n) >= datasize_ &&
Grow(size * n) == 0) { Grow(size * n) == 0) {
rv = 0; rv = 0;
} else { } else {
@ -257,7 +257,7 @@ size_t CefBytesWriter::Write(const void* ptr, size_t size, size_t n) {
return rv; return rv;
} }
int CefBytesWriter::Seek(int64 offset, int whence) { int CefBytesWriter::Seek(int64_t offset, int whence) {
int rv = -1L; int rv = -1L;
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
switch (whence) { switch (whence) {
@ -269,7 +269,7 @@ int CefBytesWriter::Seek(int64 offset, int whence) {
rv = 0; rv = 0;
break; break;
case SEEK_END: { case SEEK_END: {
int64 offset_abs = std::abs(offset); int64_t offset_abs = std::abs(offset);
if (offset_abs > datasize_) { if (offset_abs > datasize_) {
break; break;
} }
@ -289,7 +289,7 @@ int CefBytesWriter::Seek(int64 offset, int whence) {
return rv; return rv;
} }
int64 CefBytesWriter::Tell() { int64_t CefBytesWriter::Tell() {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
return offset_; return offset_;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -554,7 +554,7 @@ CefWindowHandle CefWindowImpl::GetWindowHandle() {
return view_util::GetWindowHandle(widget_); 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(); CEF_REQUIRE_VALID_RETURN_VOID();
InitializeUITesting(); InitializeUITesting();

View File

@ -75,7 +75,7 @@ class CefWindowImpl
void SetDraggableRegions( void SetDraggableRegions(
const std::vector<CefDraggableRegion>& regions) override; const std::vector<CefDraggableRegion>& regions) override;
CefWindowHandle GetWindowHandle() 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 SendMouseMove(int screen_x, int screen_y) override;
void SendMouseEvents(cef_mouse_button_type_t button, void SendMouseEvents(cef_mouse_button_type_t button,
bool mouse_down, bool mouse_down,

View File

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

View File

@ -26,12 +26,12 @@ class CefZipReaderImpl : public CefZipReader {
bool MoveToFile(const CefString& fileName, bool caseSensitive) override; bool MoveToFile(const CefString& fileName, bool caseSensitive) override;
bool Close() override; bool Close() override;
CefString GetFileName() override; CefString GetFileName() override;
int64 GetFileSize() override; int64_t GetFileSize() override;
CefBaseTime GetFileLastModified() override; CefBaseTime GetFileLastModified() override;
bool OpenFile(const CefString& password) override; bool OpenFile(const CefString& password) override;
bool CloseFile() override; bool CloseFile() override;
int ReadFile(void* buffer, size_t bufferSize) override; int ReadFile(void* buffer, size_t bufferSize) override;
int64 Tell() override; int64_t Tell() override;
bool Eof() override; bool Eof() override;
bool GetFileInfo(); bool GetFileInfo();
@ -46,7 +46,7 @@ class CefZipReaderImpl : public CefZipReader {
bool has_fileopen_; bool has_fileopen_;
bool has_fileinfo_; bool has_fileinfo_;
CefString filename_; CefString filename_;
int64 filesize_; int64_t filesize_;
time_t filemodified_; time_t filemodified_;
IMPLEMENT_REFCOUNTING(CefZipReaderImpl); 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 */, CEF_EXPORT void cef_trace_event_instant(const char* /* category */,
const char* name, const char* name,
const char* arg1_name, const char* arg1_name,
uint64 arg1_val, uint64_t arg1_val,
const char* arg2_name, const char* arg2_name,
uint64 arg2_val) { uint64_t arg2_val) {
DCHECK(name); DCHECK(name);
if (!name) { if (!name) {
return; 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 */, CEF_EXPORT void cef_trace_event_begin(const char* /* category */,
const char* name, const char* name,
const char* arg1_name, const char* arg1_name,
uint64 arg1_val, uint64_t arg1_val,
const char* arg2_name, const char* arg2_name,
uint64 arg2_val) { uint64_t arg2_val) {
DCHECK(name); DCHECK(name);
if (!name) { if (!name) {
return; 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 */, CEF_EXPORT void cef_trace_event_end(const char* /* category */,
const char* name, const char* name,
const char* arg1_name, const char* arg1_name,
uint64 arg1_val, uint64_t arg1_val,
const char* arg2_name, const char* arg2_name,
uint64 arg2_val) { uint64_t arg2_val) {
DCHECK(name); DCHECK(name);
if (!name) { if (!name) {
return; return;
@ -84,9 +84,9 @@ CEF_EXPORT void cef_trace_event_end(const char* /* category */,
CEF_EXPORT void cef_trace_counter(const char* /* category */, CEF_EXPORT void cef_trace_counter(const char* /* category */,
const char* name, const char* name,
const char* value1_name, const char* value1_name,
uint64 value1_val, uint64_t value1_val,
const char* value2_name, const char* value2_name,
uint64 value2_val) { uint64_t value2_val) {
DCHECK(name); DCHECK(name);
if (!name) { if (!name) {
return; return;
@ -102,11 +102,11 @@ CEF_EXPORT void cef_trace_counter(const char* /* category */,
CEF_EXPORT void cef_trace_counter_id(const char* /* category */, CEF_EXPORT void cef_trace_counter_id(const char* /* category */,
const char* name, const char* name,
uint64 id, uint64_t id,
const char* value1_name, const char* value1_name,
uint64 value1_val, uint64_t value1_val,
const char* value2_name, const char* value2_name,
uint64 value2_val) { uint64_t value2_val) {
DCHECK(name); DCHECK(name);
if (!name) { if (!name) {
return; 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 */, CEF_EXPORT void cef_trace_event_async_begin(const char* /* category */,
const char* name, const char* name,
uint64 id, uint64_t id,
const char* arg1_name, const char* arg1_name,
uint64 arg1_val, uint64_t arg1_val,
const char* arg2_name, const char* arg2_name,
uint64 arg2_val) { uint64_t arg2_val) {
DCHECK(name); DCHECK(name);
if (!name) { if (!name) {
return; 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 */, CEF_EXPORT void cef_trace_event_async_step_into(const char* /* category */,
const char* name, const char* name,
uint64 id, uint64_t id,
uint64 step, uint64_t step,
const char* arg1_name, const char* arg1_name,
uint64 arg1_val) { uint64_t arg1_val) {
DCHECK(name); DCHECK(name);
if (!name) { if (!name) {
return; 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 */, CEF_EXPORT void cef_trace_event_async_step_past(const char* /* category */,
const char* name, const char* name,
uint64 id, uint64_t id,
uint64 step, uint64_t step,
const char* arg1_name, const char* arg1_name,
uint64 arg1_val) { uint64_t arg1_val) {
DCHECK(name); DCHECK(name);
if (!name) { if (!name) {
return; 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 */, CEF_EXPORT void cef_trace_event_async_end(const char* /* category */,
const char* name, const char* name,
uint64 id, uint64_t id,
const char* arg1_name, const char* arg1_name,
uint64 arg1_val, uint64_t arg1_val,
const char* arg2_name, const char* arg2_name,
uint64 arg2_val) { uint64_t arg2_val) {
DCHECK(name); DCHECK(name);
if (!name) { if (!name) {
return; return;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -70,7 +70,7 @@ class CefFrameImpl
bool IsMain() override; bool IsMain() override;
bool IsFocused() override; bool IsFocused() override;
CefString GetName() override; CefString GetName() override;
int64 GetIdentifier() override; int64_t GetIdentifier() override;
CefRefPtr<CefFrame> GetParent() override; CefRefPtr<CefFrame> GetParent() override;
CefString GetURL() override; CefString GetURL() override;
CefRefPtr<CefBrowser> GetBrowser() override; CefRefPtr<CefBrowser> GetBrowser() override;
@ -166,7 +166,7 @@ class CefFrameImpl
CefBrowserImpl* browser_; CefBrowserImpl* browser_;
blink::WebLocalFrame* frame_; blink::WebLocalFrame* frame_;
const int64 frame_id_; const int64_t frame_id_;
bool did_commit_provisional_load_ = false; bool did_commit_provisional_load_ = false;
bool did_initialize_script_context_ = 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) #if defined(CEF_STRING_TYPE_UTF16)
void v8impl_string_dtor(char16* str) { void v8impl_string_dtor(char16_t* str) {
delete[] str; delete[] str;
} }
#elif defined(CEF_STRING_TYPE_UTF8) #elif defined(CEF_STRING_TYPE_UTF8)
@ -481,7 +481,7 @@ void GetCefString(v8::Isolate* isolate,
if (len == 0) { if (len == 0) {
return; 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); str->Write(isolate, reinterpret_cast<uint16_t*>(buf), 0, len + 1);
#else #else
// Allocate enough space for a worst-case conversion. // Allocate enough space for a worst-case conversion.
@ -1274,7 +1274,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateBool(bool value) {
} }
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateInt(int32 value) { CefRefPtr<CefV8Value> CefV8Value::CreateInt(int32_t value) {
CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
@ -1283,7 +1283,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateInt(int32 value) {
} }
// static // static
CefRefPtr<CefV8Value> CefV8Value::CreateUInt(uint32 value) { CefRefPtr<CefV8Value> CefV8Value::CreateUInt(uint32_t value) {
CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr);
v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate();
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate); CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
@ -1597,13 +1597,13 @@ void CefV8ValueImpl::InitBool(bool value) {
bool_value_ = value; bool_value_ = value;
} }
void CefV8ValueImpl::InitInt(int32 value) { void CefV8ValueImpl::InitInt(int32_t value) {
DCHECK_EQ(type_, TYPE_INVALID); DCHECK_EQ(type_, TYPE_INVALID);
type_ = TYPE_INT; type_ = TYPE_INT;
int_value_ = value; int_value_ = value;
} }
void CefV8ValueImpl::InitUInt(uint32 value) { void CefV8ValueImpl::InitUInt(uint32_t value) {
DCHECK_EQ(type_, TYPE_INVALID); DCHECK_EQ(type_, TYPE_INVALID);
type_ = TYPE_UINT; type_ = TYPE_UINT;
uint_value_ = value; uint_value_ = value;
@ -1814,7 +1814,7 @@ bool CefV8ValueImpl::GetBoolValue() {
return false; return false;
} }
int32 CefV8ValueImpl::GetIntValue() { int32_t CefV8ValueImpl::GetIntValue() {
CEF_V8_REQUIRE_ISOLATE_RETURN(0); CEF_V8_REQUIRE_ISOLATE_RETURN(0);
if (type_ == TYPE_INT || type_ == TYPE_UINT) { if (type_ == TYPE_INT || type_ == TYPE_UINT) {
return int_value_; return int_value_;
@ -1822,7 +1822,7 @@ int32 CefV8ValueImpl::GetIntValue() {
return 0; return 0;
} }
uint32 CefV8ValueImpl::GetUIntValue() { uint32_t CefV8ValueImpl::GetUIntValue() {
CEF_V8_REQUIRE_ISOLATE_RETURN(0); CEF_V8_REQUIRE_ISOLATE_RETURN(0);
if (type_ == TYPE_INT || type_ == TYPE_UINT) { if (type_ == TYPE_INT || type_ == TYPE_UINT) {
return uint_value_; return uint_value_;

View File

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

View File

@ -256,12 +256,25 @@ ErrnoLogMessage::~ErrnoLogMessage() {
} // namespace cef } // namespace cef
std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
std::wstring tmp_str(wstr); const auto length = wstr ? std::char_traits<wchar_t>::length(wstr) : 0U;
if (!tmp_str.empty()) { if (length > 0) {
cef_string_utf8_t str = {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; out << str.str;
cef_string_utf8_clear(&str); cef_string_utf8_clear(&str);
} }
return out; 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. // Called due to cefQuery execution in binding.html.
virtual bool OnQuery(CefRefPtr<CefBrowser> browser, virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
int64 query_id, int64_t query_id,
const CefString& request, const CefString& request,
bool persistent, bool persistent,
CefRefPtr<Callback> callback) override { 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.x = client::DeviceToLogical(point.x, device_scale_factor);
mouseEvent.y = client::DeviceToLogical(point.y, 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 { - (int)getModifiersForEvent:(NSEvent*)event {
@ -1023,7 +1023,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
CefRefPtr<CefStreamWriter> writer = CefRefPtr<CefStreamWriter> writer =
CefStreamWriter::CreateForHandler(handler.get()); CefStreamWriter::CreateForHandler(handler.get());
current_drag_data_->GetFileContents(writer); 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() [pboard setData:[NSData dataWithBytes:handler->GetData()
length:handler->GetDataSize()] length:handler->GetDataSize()]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -262,7 +262,7 @@ bool DragDataToDataObject(CefRefPtr<CefDragData> drag_data,
CefRefPtr<CefStreamWriter> writer = CefRefPtr<CefStreamWriter> writer =
CefStreamWriter::CreateForHandler(handler.get()); CefStreamWriter::CreateForHandler(handler.get());
drag_data->GetFileContents(writer); 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(); CefString fileName = drag_data->GetFileName();
GetStorageForFileDescriptor(&stgmeds[curr_index], fileName.ToWString()); GetStorageForFileDescriptor(&stgmeds[curr_index], fileName.ToWString());
fmtetc.cfFormat = file_desc_format; fmtetc.cfFormat = file_desc_format;

View File

@ -70,7 +70,7 @@ void GetCompositionUnderlines(
uint32_t target_end, uint32_t target_end,
std::vector<CefCompositionUnderline>& underlines) { std::vector<CefCompositionUnderline>& underlines) {
int clause_size = ::ImmGetCompositionString(imc, GCS_COMPCLAUSE, nullptr, 0); 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) { if (clause_length) {
std::vector<uint32_t> clause_data(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, CefPostDelayedTask(TID_UI,
base::BindOnce(&OsrRenderHandlerWin::TriggerBeginFrame, base::BindOnce(&OsrRenderHandlerWin::TriggerBeginFrame,
weak_factory_.GetWeakPtr(), now, delay_us), weak_factory_.GetWeakPtr(), now, delay_us),
int64(offset / 1000.0)); static_cast<int64_t>(offset / 1000.0));
if (settings_.external_begin_frame_enabled && browser_) { if (settings_.external_begin_frame_enabled && browser_) {
// We're running the BeginFrame timer. Trigger rendering via // 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. // Called due to cefQuery execution in preferences.html.
bool OnQuery(CefRefPtr<CefBrowser> browser, bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
int64 query_id, int64_t query_id,
const CefString& request, const CefString& request,
bool persistent, bool persistent,
CefRefPtr<Callback> callback) override { CefRefPtr<Callback> callback) override {

View File

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

View File

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

View File

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

View File

@ -50,12 +50,12 @@ class RequestClient : public CefURLRequestClient {
} }
void OnUploadProgress(CefRefPtr<CefURLRequest> request, void OnUploadProgress(CefRefPtr<CefURLRequest> request,
int64 current, int64_t current,
int64 total) override {} int64_t total) override {}
void OnDownloadProgress(CefRefPtr<CefURLRequest> request, void OnDownloadProgress(CefRefPtr<CefURLRequest> request,
int64 current, int64_t current,
int64 total) override {} int64_t total) override {}
void OnDownloadData(CefRefPtr<CefURLRequest> request, void OnDownloadData(CefRefPtr<CefURLRequest> request,
const void* data, const void* data,
@ -91,7 +91,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
// Called due to cefQuery execution in urlrequest.html. // Called due to cefQuery execution in urlrequest.html.
bool OnQuery(CefRefPtr<CefBrowser> browser, bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
int64 query_id, int64_t query_id,
const CefString& request, const CefString& request,
bool persistent, bool persistent,
CefRefPtr<Callback> callback) override { 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 // 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 // results in 'small dotless i', which is different from a 'dotted i'. Similar
// issues may exist for az and lt locales. // issues may exist for az and lt locales.
char16 ToLower(char16 c) { char16_t ToLower(char16_t c) {
CefStringUTF16 str16; CefStringUTF16 str16;
cef_string_utf16_to_lower(&c, 1, str16.GetWritableStruct()); cef_string_utf16_to_lower(&c, 1, str16.GetWritableStruct());
return str16.length() > 0 ? str16.c_str()[0] : 0; 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 // Extract the mnemonic character from |title|. For example, if |title| is
// "&Test" then the mnemonic character is 'T'. // "&Test" then the mnemonic character is 'T'.
char16 GetMnemonic(const std::u16string& title) { char16_t GetMnemonic(const std::u16string& title) {
size_t index = 0; size_t index = 0;
do { do {
index = title.find('&', index); index = title.find('&', index);
@ -92,7 +92,7 @@ CefRefPtr<CefMenuModel> ViewsMenuBar::CreateMenuModel(const CefString& label,
panel_->AddChildView(button); panel_->AddChildView(button);
// Extract the mnemonic that triggers the menu, if any. // Extract the mnemonic that triggers the menu, if any.
char16 mnemonic = GetMnemonic(label); char16_t mnemonic = GetMnemonic(label);
if (mnemonic != 0) { if (mnemonic != 0) {
mnemonics_.insert(std::make_pair(mnemonic, new_menu_id)); 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_; bool last_nav_with_keyboard_;
// Map of mnemonic to MenuButton ID. // Map of mnemonic to MenuButton ID.
typedef std::map<char16, int> MnemonicMap; typedef std::map<char16_t, int> MnemonicMap;
MnemonicMap mnemonics_; MnemonicMap mnemonics_;
IMPLEMENT_REFCOUNTING(ViewsMenuBar); IMPLEMENT_REFCOUNTING(ViewsMenuBar);

View File

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

View File

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

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