Skip to content

Commit

Permalink
Remove CEF-specific integer and char16 typedef's (see chromiumembedde…
Browse files Browse the repository at this point in the history
  • Loading branch information
magreenblatt committed Jun 1, 2023
1 parent 695ee2a commit 5042d71
Show file tree
Hide file tree
Showing 150 changed files with 597 additions and 621 deletions.
46 changes: 0 additions & 46 deletions include/base/cef_basictypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,50 +37,4 @@

#include "include/base/cef_build.h"

// The NSPR system headers define 64-bit as |long| when possible, except on
// Mac OS X. In order to not have typedef mismatches, we do the same on LP64.
//
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
// <inttypes.h> format macros even in the LP64 model.
#if defined(__LP64__) && !defined(OS_MAC) && !defined(OS_OPENBSD)
typedef long int64;
typedef unsigned long uint64;
#else
typedef long long int64;
typedef unsigned long long uint64;
#endif

// TODO: Remove these type guards. These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _INT32
#define _INT32
typedef int int32;
#endif

// TODO: Remove these type guards. These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _UINT32
#define _UINT32
typedef unsigned int uint32;
#endif

#ifndef _INT16
#define _INT16
typedef short int16;
#endif

#ifndef _UINT16
#define _UINT16
typedef unsigned short uint16;
#endif

// UTF-16 character type.
#ifndef char16
#if defined(WCHAR_T_IS_UTF16)
typedef wchar_t char16;
#elif defined(WCHAR_T_IS_UTF32)
typedef unsigned short char16;
#endif
#endif

#endif // CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
2 changes: 1 addition & 1 deletion include/base/cef_build.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
// The compiler thinks std::string::const_iterator and "const char*" are
// equivalent types.
#define STD_STRING_ITERATOR_IS_CHAR_POINTER
// The compiler thinks std::u16string::const_iterator and "char16*" are
// The compiler thinks std::u16string::const_iterator and "char16_t*" are
// equivalent types.
#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
#endif
Expand Down
7 changes: 7 additions & 0 deletions include/base/cef_logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,13 @@ std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
return out << wstr.c_str();
}
#if defined(WCHAR_T_IS_UTF32)
std::ostream& operator<<(std::ostream& out, const char16_t* wstr);
#elif defined(WCHAR_T_IS_UTF16)
inline std::ostream& operator<<(std::ostream& out, const char16_t* wstr) {
return operator<<(out, reinterpret_cast<const wchar_t*>(wstr));
}
#endif

// The NOTIMPLEMENTED() macro annotates codepaths which have
// not been implemented yet.
Expand Down
2 changes: 1 addition & 1 deletion include/cef_audio_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class CefAudioHandler : public virtual CefBaseRefCounted {
virtual void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser,
const float** data,
int frames,
int64 pts) = 0;
int64_t pts) = 0;

///
/// Called on the UI thread when the stream has stopped. OnAudioSteamStopped
Expand Down
6 changes: 3 additions & 3 deletions include/cef_browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class CefBrowser : public virtual CefBaseRefCounted {
/// Returns the frame with the specified identifier, or NULL if not found.
///
/*--cef(capi_name=get_frame_byident)--*/
virtual CefRefPtr<CefFrame> GetFrame(int64 identifier) = 0;
virtual CefRefPtr<CefFrame> GetFrame(int64_t identifier) = 0;

///
/// Returns the frame with the specified name, or NULL if not found.
Expand All @@ -188,7 +188,7 @@ class CefBrowser : public virtual CefBaseRefCounted {
/// Returns the identifiers of all existing frames.
///
/*--cef(count_func=identifiers:GetFrameCount)--*/
virtual void GetFrameIdentifiers(std::vector<int64>& identifiers) = 0;
virtual void GetFrameIdentifiers(std::vector<int64_t>& identifiers) = 0;

///
/// Returns the names of all existing frames.
Expand Down Expand Up @@ -456,7 +456,7 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual void DownloadImage(const CefString& image_url,
bool is_favicon,
uint32 max_image_size,
uint32_t max_image_size,
bool bypass_cache,
CefRefPtr<CefDownloadImageCallback> callback) = 0;

Expand Down
2 changes: 1 addition & 1 deletion include/cef_browser_process_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted {
/// pending scheduled call should be cancelled.
///
/*--cef()--*/
virtual void OnScheduleMessagePumpWork(int64 delay_ms) {}
virtual void OnScheduleMessagePumpWork(int64_t delay_ms) {}

///
/// Return the default client for use with a newly created browser window. If
Expand Down
8 changes: 4 additions & 4 deletions include/cef_download_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
/// Returns a simple speed estimate in bytes/s.
///
/*--cef()--*/
virtual int64 GetCurrentSpeed() = 0;
virtual int64_t GetCurrentSpeed() = 0;

///
/// Returns the rough percent complete or -1 if the receive total size is
Expand All @@ -100,13 +100,13 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
/// Returns the total number of bytes.
///
/*--cef()--*/
virtual int64 GetTotalBytes() = 0;
virtual int64_t GetTotalBytes() = 0;

///
/// Returns the number of received bytes.
///
/*--cef()--*/
virtual int64 GetReceivedBytes() = 0;
virtual int64_t GetReceivedBytes() = 0;

///
/// Returns the time that the download started.
Expand All @@ -130,7 +130,7 @@ class CefDownloadItem : public virtual CefBaseRefCounted {
/// Returns the unique identifier for this download.
///
/*--cef()--*/
virtual uint32 GetId() = 0;
virtual uint32_t GetId() = 0;

///
/// Returns the URL.
Expand Down
2 changes: 1 addition & 1 deletion include/cef_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class CefFrame : public virtual CefBaseRefCounted {
/// underlying frame does not yet exist.
///
/*--cef()--*/
virtual int64 GetIdentifier() = 0;
virtual int64_t GetIdentifier() = 0;

///
/// Returns the parent of this frame or NULL if this is the main (top-level)
Expand Down
10 changes: 5 additions & 5 deletions include/cef_permission_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class CefMediaAccessCallback : public virtual CefBaseRefCounted {
/// OnRequestMediaAccessPermission.
///
/*--cef(capi_name=cont)--*/
virtual void Continue(uint32 allowed_permissions) = 0;
virtual void Continue(uint32_t allowed_permissions) = 0;

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

Expand Down
2 changes: 1 addition & 1 deletion include/cef_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class CefRequest : public virtual CefBaseRefCounted {
/// browser process to track a single request across multiple callbacks.
///
/*--cef()--*/
virtual uint64 GetIdentifier() = 0;
virtual uint64_t GetIdentifier() = 0;
};

///
Expand Down
8 changes: 4 additions & 4 deletions include/cef_resource_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CefResourceSkipCallback : public virtual CefBaseRefCounted {
/// <= 0 the request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE.
///
/*--cef(capi_name=cont)--*/
virtual void Continue(int64 bytes_skipped) = 0;
virtual void Continue(int64_t bytes_skipped) = 0;
};

///
Expand Down Expand Up @@ -136,7 +136,7 @@ class CefResourceHandler : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length,
int64_t& response_length,
CefString& redirectUrl) = 0;

///
Expand All @@ -149,8 +149,8 @@ class CefResourceHandler : public virtual CefBaseRefCounted {
/// method will be called in sequence but not from a dedicated thread.
///
/*--cef()--*/
virtual bool Skip(int64 bytes_to_skip,
int64& bytes_skipped,
virtual bool Skip(int64_t bytes_to_skip,
int64_t& bytes_skipped,
CefRefPtr<CefResourceSkipCallback> callback) {
bytes_skipped = -2;
return false;
Expand Down
2 changes: 1 addition & 1 deletion include/cef_resource_request_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class CefResourceRequestHandler : public virtual CefBaseRefCounted {
CefRefPtr<CefRequest> request,
CefRefPtr<CefResponse> response,
URLRequestStatus status,
int64 received_content_length) {}
int64_t received_content_length) {}

///
/// Called on the IO thread to handle requests for URLs with an unknown
Expand Down
4 changes: 2 additions & 2 deletions include/cef_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CefServer : public CefBaseRefCounted {
///
/*--cef()--*/
static void CreateServer(const CefString& address,
uint16 port,
uint16_t port,
int backlog,
CefRefPtr<CefServerHandler> handler);

Expand Down Expand Up @@ -170,7 +170,7 @@ class CefServer : public CefBaseRefCounted {
virtual void SendHttpResponse(int connection_id,
int response_code,
const CefString& content_type,
int64 content_length,
int64_t content_length,
const HeaderMap& extra_headers) = 0;

///
Expand Down
16 changes: 8 additions & 8 deletions include/cef_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ class CefReadHandler : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64 offset, int whence) = 0;
virtual int Seek(int64_t offset, int whence) = 0;

///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64 Tell() = 0;
virtual int64_t Tell() = 0;

///
/// Return non-zero if at end of file.
Expand Down Expand Up @@ -119,13 +119,13 @@ class CefStreamReader : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64 offset, int whence) = 0;
virtual int Seek(int64_t offset, int whence) = 0;

///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64 Tell() = 0;
virtual int64_t Tell() = 0;

///
/// Return non-zero if at end of file.
Expand Down Expand Up @@ -161,13 +161,13 @@ class CefWriteHandler : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64 offset, int whence) = 0;
virtual int Seek(int64_t offset, int whence) = 0;

///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64 Tell() = 0;
virtual int64_t Tell() = 0;

///
/// Flush the stream.
Expand Down Expand Up @@ -215,13 +215,13 @@ class CefStreamWriter : public virtual CefBaseRefCounted {
/// failure.
///
/*--cef()--*/
virtual int Seek(int64 offset, int whence) = 0;
virtual int Seek(int64_t offset, int whence) = 0;

///
/// Return the current offset position.
///
/*--cef()--*/
virtual int64 Tell() = 0;
virtual int64_t Tell() = 0;

///
/// Flush the stream.
Expand Down
4 changes: 2 additions & 2 deletions include/cef_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class CefTaskRunner : public virtual CefBaseRefCounted {
/// specified delay.
///
/*--cef()--*/
virtual bool PostDelayedTask(CefRefPtr<CefTask> task, int64 delay_ms) = 0;
virtual bool PostDelayedTask(CefRefPtr<CefTask> task, int64_t delay_ms) = 0;
};

///
Expand All @@ -143,6 +143,6 @@ bool CefPostTask(CefThreadId threadId, CefRefPtr<CefTask> task);
/*--cef()--*/
bool CefPostDelayedTask(CefThreadId threadId,
CefRefPtr<CefTask> task,
int64 delay_ms);
int64_t delay_ms);

#endif // CEF_INCLUDE_CEF_TASK_H_
2 changes: 1 addition & 1 deletion include/cef_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ bool CefEndTracing(const CefString& tracing_file,
/// information in trace events.
///
/*--cef()--*/
int64 CefNowFromSystemTraceTime();
int64_t CefNowFromSystemTraceTime();

#endif // CEF_INCLUDE_CEF_TRACE_H_
8 changes: 4 additions & 4 deletions include/cef_urlrequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ class CefURLRequestClient : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void OnUploadProgress(CefRefPtr<CefURLRequest> request,
int64 current,
int64 total) = 0;
int64_t current,
int64_t total) = 0;

///
/// Notifies the client of download progress. |current| denotes the number of
Expand All @@ -162,8 +162,8 @@ class CefURLRequestClient : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual void OnDownloadProgress(CefRefPtr<CefURLRequest> request,
int64 current,
int64 total) = 0;
int64_t current,
int64_t total) = 0;

///
/// Called when some part of the response is read. |data| contains the current
Expand Down
Loading

0 comments on commit 5042d71

Please sign in to comment.