diff --git a/include/capi/cef_download_item_capi.h b/include/capi/cef_download_item_capi.h index 146697720d55005fedb317ca8853ac7412dd3bfa..f83521a4b8c0686b9760ce6c973d8588412ca7c7 100644 --- a/include/capi/cef_download_item_capi.h +++ b/include/capi/cef_download_item_capi.h @@ -145,7 +145,7 @@ typedef struct _cef_download_item_t { /// Returns the content disposition. /// // The resulting string must be freed by calling cef_string_userfree_free(). - cef_string_userfree_t(CEF_CALLBACK* get_content_disposition)( + struct _cef_value_t*(CEF_CALLBACK* get_content_disposition)( struct _cef_download_item_t* self); /// diff --git a/include/cef_download_item.h b/include/cef_download_item.h index 69cb0be32c55d9fb22a6bfb1395cc52e8680f5a4..9421f74c98cd1006a2ff1918d2b80bf664f2e8ae 100644 --- a/include/cef_download_item.h +++ b/include/cef_download_item.h @@ -39,6 +39,7 @@ #pragma once #include "include/cef_base.h" +#include "include/cef_values.h" /// /// Class used to represent a download item. @@ -142,7 +143,7 @@ class CefDownloadItem : public virtual CefBaseRefCounted { /// Returns the content disposition. /// /*--cef()--*/ - virtual CefString GetContentDisposition() = 0; + virtual CefRefPtr GetContentDisposition() = 0; /// /// Returns the mime type. diff --git a/libcef/browser/download_item_impl.cc b/libcef/browser/download_item_impl.cc index 334865db3db94178968d14f6b55b4302d5164513..8da6266deadcff0a105c0e9176cebbcb78243b91 100644 --- a/libcef/browser/download_item_impl.cc +++ b/libcef/browser/download_item_impl.cc @@ -117,9 +117,11 @@ CefString CefDownloadItemImpl::GetSuggestedFileName() { return const_value().GetSuggestedFilename(); } -CefString CefDownloadItemImpl::GetContentDisposition() { - CEF_VALUE_VERIFY_RETURN(false, CefString()); - return const_value().GetContentDisposition(); +CefRefPtr CefDownloadItemImpl::GetContentDisposition() { + CEF_VALUE_VERIFY_RETURN(false, nullptr); + CefRefPtr data = CefValue::Create(); + data->SetStdString(const_value().GetContentDisposition()); + return data; } CefString CefDownloadItemImpl::GetMimeType() { diff --git a/libcef/browser/download_item_impl.h b/libcef/browser/download_item_impl.h index 25eb44d8845609f4abc4a0b74f4b04352265dd2f..8830621c0a438e229a0f5dade249f72942d38e2a 100644 --- a/libcef/browser/download_item_impl.h +++ b/libcef/browser/download_item_impl.h @@ -38,7 +38,7 @@ class CefDownloadItemImpl CefString GetURL() override; CefString GetOriginalUrl() override; CefString GetSuggestedFileName() override; - CefString GetContentDisposition() override; + CefRefPtr GetContentDisposition() override; CefString GetMimeType() override; CefString GetOriginalMimeType() override; CefString GetGuid() override; diff --git a/libcef_dll/cpptoc/download_item_cpptoc.cc b/libcef_dll/cpptoc/download_item_cpptoc.cc index a401358374b70f7294112b6c07d772c6a03ed6c9..496859b1c053ef301dad0d32c3288858691e0f57 100644 --- a/libcef_dll/cpptoc/download_item_cpptoc.cc +++ b/libcef_dll/cpptoc/download_item_cpptoc.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=8ee1cd1c85cd52069e8344d6f2d28ef4eb0b745c$ +// $hash=5998532dc9d84ad0802b86aaf4d986b77ec124d0$ // #include "libcef_dll/cpptoc/download_item_cpptoc.h" +#include "libcef_dll/cpptoc/value_cpptoc.h" #include "libcef_dll/shutdown_checker.h" namespace { @@ -285,7 +286,7 @@ download_item_get_suggested_file_name(struct _cef_download_item_t* self) { return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK +struct _cef_value_t* CEF_CALLBACK download_item_get_content_disposition(struct _cef_download_item_t* self) { shutdown_checker::AssertNotShutdown(); @@ -297,10 +298,11 @@ download_item_get_content_disposition(struct _cef_download_item_t* self) { } // Execute - CefString _retval = CefDownloadItemCppToC::Get(self)->GetContentDisposition(); + CefRefPtr _retval = + CefDownloadItemCppToC::Get(self)->GetContentDisposition(); - // Return type: string - return _retval.DetachToUserFree(); + // Return type: refptr_same + return CefValueCppToC::Wrap(_retval); } cef_string_userfree_t CEF_CALLBACK diff --git a/libcef_dll/ctocpp/download_item_ctocpp.cc b/libcef_dll/ctocpp/download_item_ctocpp.cc index bd4b604c999eab46a17181f9a550a7e11b52bbf5..0e8bcc7486d05115a80644cc07b14aacd82be9b5 100644 --- a/libcef_dll/ctocpp/download_item_ctocpp.cc +++ b/libcef_dll/ctocpp/download_item_ctocpp.cc @@ -9,10 +9,11 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=4e1a4826a5fc77e2d81cbd8f4d1d721fe416d3d6$ +// $hash=0a0c193ae6e77b98ea8f5945c323819ee91be4ee$ // #include "libcef_dll/ctocpp/download_item_ctocpp.h" +#include "libcef_dll/ctocpp/value_ctocpp.h" #include "libcef_dll/shutdown_checker.h" // VIRTUAL METHODS - Body may be edited by hand. @@ -282,23 +283,21 @@ CefString CefDownloadItemCToCpp::GetSuggestedFileName() { } NO_SANITIZE("cfi-icall") -CefString CefDownloadItemCToCpp::GetContentDisposition() { +CefRefPtr CefDownloadItemCToCpp::GetContentDisposition() { shutdown_checker::AssertNotShutdown(); cef_download_item_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_content_disposition)) { - return CefString(); + return nullptr; } // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = _struct->get_content_disposition(_struct); + cef_value_t* _retval = _struct->get_content_disposition(_struct); - // Return type: string - CefString _retvalStr; - _retvalStr.AttachToUserFree(_retval); - return _retvalStr; + // Return type: refptr_same + return CefValueCToCpp::Wrap(_retval); } NO_SANITIZE("cfi-icall") CefString CefDownloadItemCToCpp::GetMimeType() { diff --git a/libcef_dll/ctocpp/download_item_ctocpp.h b/libcef_dll/ctocpp/download_item_ctocpp.h index 68ef45f32302c2aec59d81c24172515e086c18d9..664faf27efd34cd0aacbe823899672c405a747c9 100644 --- a/libcef_dll/ctocpp/download_item_ctocpp.h +++ b/libcef_dll/ctocpp/download_item_ctocpp.h @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=1fe7226c96b62b2e91dda051fe89ab47077c80e4$ +// $hash=801678582c97c2385f28f59c4967206b527e5539$ // #ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CTOCPP_H_ @@ -23,6 +23,7 @@ #include "include/capi/cef_download_item_capi.h" #include "include/cef_download_item.h" #include "libcef_dll/ctocpp/ctocpp_ref_counted.h" +#include "libcef_dll/ctocpp/value_ctocpp.h" // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. @@ -49,7 +50,7 @@ class CefDownloadItemCToCpp : public CefCToCppRefCounted GetContentDisposition() override; CefString GetMimeType() override; CefString GetOriginalMimeType() override; CefString GetGuid() override;