From 9f0f8e5feb546d82099f85d311a96f34c35e7389 Mon Sep 17 00:00:00 2001 From: LSuper <120311070@qq.com> Date: Sat, 2 Sep 2023 17:39:46 +0800 Subject: [PATCH] fixed: use int64_t instead of int64 --- include/CefViewBrowserApp.h | 2 +- include/CefViewQueryHandler.h | 6 +++--- .../CefBrowserApp/CefViewBrowserApp.cpp | 2 +- .../CefBrowserApp/CefViewQueryHandler.cpp | 4 ++-- .../CefViewDefaultSchemeHandler.cpp | 4 ++-- .../CefViewDefaultSchemeHandler.h | 4 ++-- .../CefViewDefaultRenderDelegate.cpp | 6 +++--- .../CefViewDefaultRenderDelegate.h | 2 +- src/Shared/Common/CefViewDebug.cpp | 18 ++++++++---------- 9 files changed, 23 insertions(+), 25 deletions(-) diff --git a/include/CefViewBrowserApp.h b/include/CefViewBrowserApp.h index 88cc05d..7bb7ac4 100644 --- a/include/CefViewBrowserApp.h +++ b/include/CefViewBrowserApp.h @@ -73,7 +73,7 @@ class CefViewBrowserApp virtual void OnBeforeChildProcessLaunch(CefRefPtr command_line) override; - virtual void OnScheduleMessagePumpWork(int64 delay_ms) override; + virtual void OnScheduleMessagePumpWork(int64_t delay_ms) override; #pragma endregion CefBrowserProcessHandler }; diff --git a/include/CefViewQueryHandler.h b/include/CefViewQueryHandler.h index f9d0299..c16558c 100644 --- a/include/CefViewQueryHandler.h +++ b/include/CefViewQueryHandler.h @@ -49,7 +49,7 @@ class CefViewQueryHandler /// virtual bool OnQuery(CefRefPtr browser, CefRefPtr frame, - int64 query_id, + int64_t query_id, const CefString& request, bool persistent, CefRefPtr callback) override; @@ -60,7 +60,7 @@ class CefViewQueryHandler /// /// /// - virtual void OnQueryCanceled(CefRefPtr browser, CefRefPtr frame, int64 query_id) override; + virtual void OnQueryCanceled(CefRefPtr browser, CefRefPtr frame, int64_t query_id) override; /// /// @@ -81,7 +81,7 @@ class CefViewQueryHandler /// /// /// - std::map> mapCallback_; + std::map> mapCallback_; /// /// diff --git a/src/CefView/CefBrowserApp/CefViewBrowserApp.cpp b/src/CefView/CefBrowserApp/CefViewBrowserApp.cpp index fe6f6ca..e941f17 100644 --- a/src/CefView/CefBrowserApp/CefViewBrowserApp.cpp +++ b/src/CefView/CefBrowserApp/CefViewBrowserApp.cpp @@ -95,7 +95,7 @@ CefViewBrowserApp::OnBeforeChildProcessLaunch(CefRefPtr command_ } void -CefViewBrowserApp::OnScheduleMessagePumpWork(int64 delay_ms) +CefViewBrowserApp::OnScheduleMessagePumpWork(int64_t delay_ms) { auto delegate = app_delegate_.lock(); diff --git a/src/CefView/CefBrowserApp/CefViewQueryHandler.cpp b/src/CefView/CefBrowserApp/CefViewQueryHandler.cpp index eb6475f..db46a39 100644 --- a/src/CefView/CefBrowserApp/CefViewQueryHandler.cpp +++ b/src/CefView/CefBrowserApp/CefViewQueryHandler.cpp @@ -9,7 +9,7 @@ CefViewQueryHandler::~CefViewQueryHandler() {} bool CefViewQueryHandler::OnQuery(CefRefPtr browser, CefRefPtr frame, - int64 query_id, + int64_t query_id, const CefString& request, bool persistent, CefRefPtr callback) @@ -29,7 +29,7 @@ CefViewQueryHandler::OnQuery(CefRefPtr browser, } void -CefViewQueryHandler::OnQueryCanceled(CefRefPtr browser, CefRefPtr frame, int64 query_id) +CefViewQueryHandler::OnQueryCanceled(CefRefPtr browser, CefRefPtr frame, int64_t query_id) { mtxCallbackMap_.lock(); auto it = mapCallback_.find(query_id); diff --git a/src/CefView/CefBrowserApp/SchemeHandlers/CefViewDefaultSchemeHandler.cpp b/src/CefView/CefBrowserApp/SchemeHandlers/CefViewDefaultSchemeHandler.cpp index ebca8ac..9aca1e4 100644 --- a/src/CefView/CefBrowserApp/SchemeHandlers/CefViewDefaultSchemeHandler.cpp +++ b/src/CefView/CefBrowserApp/SchemeHandlers/CefViewDefaultSchemeHandler.cpp @@ -44,7 +44,7 @@ SchemeHandler::Open(CefRefPtr request, bool& handle_request, CefRefP } void -SchemeHandler::GetResponseHeaders(CefRefPtr response, int64& response_length, CefString& redirectUrl) +SchemeHandler::GetResponseHeaders(CefRefPtr response, int64_t& response_length, CefString& redirectUrl) { CEF_REQUIRE_IO_THREAD(); DCHECK(!data_.empty()); @@ -55,7 +55,7 @@ SchemeHandler::GetResponseHeaders(CefRefPtr response, int64& respon } bool -SchemeHandler::Skip(int64 bytes_to_skip, int64& bytes_skipped, CefRefPtr callback) +SchemeHandler::Skip(int64_t bytes_to_skip, int64_t& bytes_skipped, CefRefPtr callback) { bytes_skipped = 0; diff --git a/src/CefView/CefBrowserApp/SchemeHandlers/CefViewDefaultSchemeHandler.h b/src/CefView/CefBrowserApp/SchemeHandlers/CefViewDefaultSchemeHandler.h index 94663d3..2c12875 100644 --- a/src/CefView/CefBrowserApp/SchemeHandlers/CefViewDefaultSchemeHandler.h +++ b/src/CefView/CefBrowserApp/SchemeHandlers/CefViewDefaultSchemeHandler.h @@ -28,10 +28,10 @@ class SchemeHandler : public CefResourceHandler virtual bool Open(CefRefPtr request, bool& handle_request, CefRefPtr callback) override; virtual void GetResponseHeaders(CefRefPtr response, - int64& response_length, + int64_t& response_length, CefString& redirectUrl) override; - virtual bool Skip(int64 bytes_to_skip, int64& bytes_skipped, CefRefPtr callback) override; + virtual bool Skip(int64_t bytes_to_skip, int64_t& bytes_skipped, CefRefPtr callback) override; virtual bool Read(void* data_out, int bytes_to_read, diff --git a/src/CefWing/CefRenderApp/RenderDelegates/CefViewDefaultRenderDelegate.cpp b/src/CefWing/CefRenderApp/RenderDelegates/CefViewDefaultRenderDelegate.cpp index 1123444..375bee0 100644 --- a/src/CefWing/CefRenderApp/RenderDelegates/CefViewDefaultRenderDelegate.cpp +++ b/src/CefWing/CefRenderApp/RenderDelegates/CefViewDefaultRenderDelegate.cpp @@ -41,7 +41,7 @@ RenderDelegate::OnContextCreated(CefRefPtr app, frame->ExecuteJavaScript("console.info('[JSRuntime]:frame context created')", frame->GetURL(), 0); // binding bridge object and functions - int64 frameId = frame->GetIdentifier(); + auto frameId = frame->GetIdentifier(); auto it = frame_id_to_client_map_.find(frameId); if (it == frame_id_to_client_map_.end()) { // create and insert the bridge Object into this frame.window object @@ -63,7 +63,7 @@ RenderDelegate::OnContextReleased(CefRefPtr app, { render_message_router_->OnContextReleased(browser, frame, context); - int64 frameId = frame->GetIdentifier(); + auto frameId = frame->GetIdentifier(); auto it = frame_id_to_client_map_.find(frameId); if (it != frame_id_to_client_map_.end()) { frame_id_to_client_map_.erase(it); @@ -151,7 +151,7 @@ RenderDelegate::ExecuteEventListener(CefRefPtr browser, CefRefPtr args) { if (browser && frame) { - int64 frameId = frame->GetIdentifier(); + auto frameId = frame->GetIdentifier(); auto it = frame_id_to_client_map_.find(frameId); if (it != frame_id_to_client_map_.end()) { const CefRefPtr& objClient = it->second; diff --git a/src/CefWing/CefRenderApp/RenderDelegates/CefViewDefaultRenderDelegate.h b/src/CefWing/CefRenderApp/RenderDelegates/CefViewDefaultRenderDelegate.h index f555416..81e69cd 100644 --- a/src/CefWing/CefRenderApp/RenderDelegates/CefViewDefaultRenderDelegate.h +++ b/src/CefWing/CefRenderApp/RenderDelegates/CefViewDefaultRenderDelegate.h @@ -27,7 +27,7 @@ class RenderDelegate : public CefViewRenderApp::RenderDelegate /// /// /// - typedef std::unordered_map> FrameID2CefClientMap; + typedef std::unordered_map> FrameID2CefClientMap; public: /// diff --git a/src/Shared/Common/CefViewDebug.cpp b/src/Shared/Common/CefViewDebug.cpp index b88bef6..d09928b 100644 --- a/src/Shared/Common/CefViewDebug.cpp +++ b/src/Shared/Common/CefViewDebug.cpp @@ -7,9 +7,7 @@ #include "CefViewDebug.h" -#include #include -#include std::string toString(CefRefPtr browser) { @@ -17,19 +15,19 @@ std::string toString(CefRefPtr browser) msg += "( "; msg += "CefBrowser:"; - msg += ", ptr=" + std::to_string((int64)browser.get()); + msg += ", ptr=" + std::to_string((int64_t)browser.get()); #if CEF_VERSION_MAJOR > 91 msg += ", IsValid=" + std::to_string(browser->IsValid()); #endif - msg += ", GetHost=" + std::to_string((int64)browser->GetHost().get()); + msg += ", GetHost=" + std::to_string((int64_t)browser->GetHost().get()); msg += ", CanGoBack=" + std::to_string(browser->CanGoBack()); msg += ", CanGoForward=" + std::to_string(browser->CanGoForward()); msg += ", IsLoading=" + std::to_string(browser->IsLoading()); msg += ", GetIdentifier=" + std::to_string(browser->GetIdentifier()); msg += ", IsPopup=" + std::to_string(browser->IsPopup()); msg += ", HasDocument=" + std::to_string(browser->HasDocument()); - msg += ", GetMainFrame=" + std::to_string((int64)browser->GetMainFrame().get()); - msg += ", GetFocusedFrame=" + std::to_string((int64)browser->GetFocusedFrame().get()); + msg += ", GetMainFrame=" + std::to_string((int64_t)browser->GetMainFrame().get()); + msg += ", GetFocusedFrame=" + std::to_string((int64_t)browser->GetFocusedFrame().get()); msg += ", GetFrameCount=" + std::to_string(browser->GetFrameCount()); msg += " )"; @@ -42,16 +40,16 @@ std::string toString(CefRefPtr frame) msg += "( "; msg += "CefFrame:"; - msg += ", ptr=" + std::to_string((int64)frame.get()); + msg += ", ptr=" + std::to_string((int64_t)frame.get()); msg += ", IsValid=" + std::to_string(frame->IsValid()); msg += ", IsMain=" + std::to_string(frame->IsMain()); msg += ", IsFocused=" + std::to_string(frame->IsFocused()); msg += ", GetName=" + frame->GetName().ToString(); msg += ", GetIdentifier=" + std::to_string(frame->GetIdentifier()); - msg += ", GetParent=" + std::to_string((int64)frame->GetParent().get()); + msg += ", GetParent=" + std::to_string((int64_t)frame->GetParent().get()); msg += ", GetURL=" + frame->GetURL().ToString(); - msg += ", GetBrowser=" + std::to_string((int64)frame->GetBrowser().get()); - //msg += ", GetV8Context=" + std::to_string((int64)frame->GetV8Context().get()); + msg += ", GetBrowser=" + std::to_string((int64_t)frame->GetBrowser().get()); + //msg += ", GetV8Context=" + std::to_string((int64_t)frame->GetV8Context().get()); msg += " )"; return msg;