From 9f45038464e91c45396b176fcb021ebeb8a7610c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 3 May 2024 13:01:30 -0400 Subject: [PATCH] Add Alloy bootstrap deprecation warnings (see #3685) Alloy bootstrap is deprecated and will be removed in ~M127. --- include/capi/cef_browser_capi.h | 6 +++++- include/capi/cef_extension_capi.h | 4 +++- include/capi/cef_extension_handler_capi.h | 4 +++- include/capi/cef_request_context_capi.h | 12 +++++++++++- include/cef_browser.h | 4 ++++ include/cef_extension.h | 2 ++ include/cef_extension_handler.h | 2 ++ include/cef_request_context.h | 10 ++++++++++ libcef/browser/main_runner.cc | 4 ++++ 9 files changed, 44 insertions(+), 4 deletions(-) diff --git a/include/capi/cef_browser_capi.h b/include/capi/cef_browser_capi.h index 45089a447..e692e7bc2 100644 --- a/include/capi/cef_browser_capi.h +++ b/include/capi/cef_browser_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=7733ed87ade32dfd311c24c51263d20b9b469868$ +// $hash=6ee74f31d37a1b5ab3c9c5ccbe2dce9841329b38$ // #ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ @@ -911,6 +911,8 @@ typedef struct _cef_browser_host_t { /// Returns the extension hosted in this browser or NULL if no extension is /// hosted. See cef_request_context_t::LoadExtension for details. /// + /// WARNING: This function is deprecated and will be removed in ~M127. + /// struct _cef_extension_t*(CEF_CALLBACK* get_extension)( struct _cef_browser_host_t* self); @@ -919,6 +921,8 @@ typedef struct _cef_browser_host_t { /// script. Background hosts do not have a window and are not displayable. See /// cef_request_context_t::LoadExtension for details. /// + /// WARNING: This function is deprecated and will be removed in ~M127. + /// int(CEF_CALLBACK* is_background_host)(struct _cef_browser_host_t* self); /// diff --git a/include/capi/cef_extension_capi.h b/include/capi/cef_extension_capi.h index cedb0206c..116e5ff6c 100644 --- a/include/capi/cef_extension_capi.h +++ b/include/capi/cef_extension_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=0ca2b788f70f8c9f5b2706d691d8e063be00ed19$ +// $hash=634054ad25154c30fb4ec630fe7fb79b0cf1f9b3$ // #ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_ @@ -54,6 +54,8 @@ struct _cef_request_context_t; /// Object representing an extension. Methods may be called on any thread unless /// otherwise indicated. /// +/// WARNING: This API is deprecated and will be removed in ~M127. +/// typedef struct _cef_extension_t { /// /// Base structure. diff --git a/include/capi/cef_extension_handler_capi.h b/include/capi/cef_extension_handler_capi.h index 533cc1910..be6261fe8 100644 --- a/include/capi/cef_extension_handler_capi.h +++ b/include/capi/cef_extension_handler_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=5cfff4465a586d2b2ea7b54a9549096faec415f6$ +// $hash=ebac34c9b85de780ce7524211c5dd61a80d4576c$ // #ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_ @@ -80,6 +80,8 @@ typedef struct _cef_get_extension_resource_callback_t { /// cef_request_context_t::LoadExtension for information about extension /// loading. /// +/// WARNING: This API is deprecated and will be removed in ~M127. +/// typedef struct _cef_extension_handler_t { /// /// Base structure. diff --git a/include/capi/cef_request_context_capi.h b/include/capi/cef_request_context_capi.h index 8f31267ef..0ac2fe531 100644 --- a/include/capi/cef_request_context_capi.h +++ b/include/capi/cef_request_context_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=7df03921b2ee743fb059f13e545ccf89904eb060$ +// $hash=2c496139ca9a59303b1493ee93d2c3ae96a956c0$ // #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ @@ -253,6 +253,8 @@ typedef struct _cef_request_context_t { /// See https://developer.chrome.com/extensions for extension implementation /// and usage documentation. /// + /// WARNING: This function is deprecated and will be removed in ~M127. + /// void(CEF_CALLBACK* load_extension)(struct _cef_request_context_t* self, const cef_string_t* root_directory, struct _cef_dictionary_value_t* manifest, @@ -264,6 +266,8 @@ typedef struct _cef_request_context_t { /// access to the extension (see HasExtension). This function must be called /// on the browser process UI thread. /// + /// WARNING: This function is deprecated and will be removed in ~M127. + /// int(CEF_CALLBACK* did_load_extension)(struct _cef_request_context_t* self, const cef_string_t* extension_id); @@ -273,6 +277,8 @@ typedef struct _cef_request_context_t { /// extension (see DidLoadExtension). This function must be called on the /// browser process UI thread. /// + /// WARNING: This function is deprecated and will be removed in ~M127. + /// int(CEF_CALLBACK* has_extension)(struct _cef_request_context_t* self, const cef_string_t* extension_id); @@ -282,6 +288,8 @@ typedef struct _cef_request_context_t { /// extension ID values. Returns true (1) on success. This function must be /// called on the browser process UI thread. /// + /// WARNING: This function is deprecated and will be removed in ~M127. + /// int(CEF_CALLBACK* get_extensions)(struct _cef_request_context_t* self, cef_string_list_t extension_ids); @@ -290,6 +298,8 @@ typedef struct _cef_request_context_t { /// extension is accessible in this context (see HasExtension). This function /// must be called on the browser process UI thread. /// + /// WARNING: This function is deprecated and will be removed in ~M127. + /// struct _cef_extension_t*(CEF_CALLBACK* get_extension)( struct _cef_request_context_t* self, const cef_string_t* extension_id); diff --git a/include/cef_browser.h b/include/cef_browser.h index 70f291225..ee7492e32 100644 --- a/include/cef_browser.h +++ b/include/cef_browser.h @@ -942,6 +942,8 @@ class CefBrowserHost : public virtual CefBaseRefCounted { /// Returns the extension hosted in this browser or NULL if no extension is /// hosted. See CefRequestContext::LoadExtension for details. /// + /// WARNING: This method is deprecated and will be removed in ~M127. + /// /*--cef()--*/ virtual CefRefPtr GetExtension() = 0; @@ -950,6 +952,8 @@ class CefBrowserHost : public virtual CefBaseRefCounted { /// Background hosts do not have a window and are not displayable. See /// CefRequestContext::LoadExtension for details. /// + /// WARNING: This method is deprecated and will be removed in ~M127. + /// /*--cef()--*/ virtual bool IsBackgroundHost() = 0; diff --git a/include/cef_extension.h b/include/cef_extension.h index 5d94192f5..5f78d8158 100644 --- a/include/cef_extension.h +++ b/include/cef_extension.h @@ -48,6 +48,8 @@ class CefRequestContext; /// Object representing an extension. Methods may be called on any thread unless /// otherwise indicated. /// +/// WARNING: This API is deprecated and will be removed in ~M127. +/// /*--cef(source=library)--*/ class CefExtension : public CefBaseRefCounted { public: diff --git a/include/cef_extension_handler.h b/include/cef_extension_handler.h index 4b34fbc02..e95916891 100644 --- a/include/cef_extension_handler.h +++ b/include/cef_extension_handler.h @@ -70,6 +70,8 @@ class CefGetExtensionResourceCallback : public CefBaseRefCounted { /// The methods of this class will be called on the UI thread. See /// CefRequestContext::LoadExtension for information about extension loading. /// +/// WARNING: This API is deprecated and will be removed in ~M127. +/// /*--cef(source=client)--*/ class CefExtensionHandler : public virtual CefBaseRefCounted { public: diff --git a/include/cef_request_context.h b/include/cef_request_context.h index e977ea3eb..21b2698ac 100644 --- a/include/cef_request_context.h +++ b/include/cef_request_context.h @@ -266,6 +266,8 @@ class CefRequestContext : public CefPreferenceManager { /// See https://developer.chrome.com/extensions for extension implementation /// and usage documentation. /// + /// WARNING: This method is deprecated and will be removed in ~M127. + /// /*--cef(optional_param=manifest,optional_param=handler)--*/ virtual void LoadExtension(const CefString& root_directory, CefRefPtr manifest, @@ -277,6 +279,8 @@ class CefRequestContext : public CefPreferenceManager { /// access to the extension (see HasExtension). This method must be called on /// the browser process UI thread. /// + /// WARNING: This method is deprecated and will be removed in ~M127. + /// /*--cef()--*/ virtual bool DidLoadExtension(const CefString& extension_id) = 0; @@ -286,6 +290,8 @@ class CefRequestContext : public CefPreferenceManager { /// extension (see DidLoadExtension). This method must be called on the /// browser process UI thread. /// + /// WARNING: This method is deprecated and will be removed in ~M127. + /// /*--cef()--*/ virtual bool HasExtension(const CefString& extension_id) = 0; @@ -295,6 +301,8 @@ class CefRequestContext : public CefPreferenceManager { /// extension ID values. Returns true on success. This method must be called /// on the browser process UI thread. /// + /// WARNING: This method is deprecated and will be removed in ~M127. + /// /*--cef()--*/ virtual bool GetExtensions(std::vector& extension_ids) = 0; @@ -303,6 +311,8 @@ class CefRequestContext : public CefPreferenceManager { /// extension is accessible in this context (see HasExtension). This method /// must be called on the browser process UI thread. /// + /// WARNING: This method is deprecated and will be removed in ~M127. + /// /*--cef()--*/ virtual CefRefPtr GetExtension( const CefString& extension_id) = 0; diff --git a/libcef/browser/main_runner.cc b/libcef/browser/main_runner.cc index a30a26a99..c6a633693 100644 --- a/libcef/browser/main_runner.cc +++ b/libcef/browser/main_runner.cc @@ -258,6 +258,10 @@ bool CefMainRunner::Initialize(CefSettings* settings, void* windows_sandbox_info, bool* initialized, base::OnceClosure context_initialized) { + LOG_IF(WARNING, !settings->chrome_runtime) + << "Alloy bootstrap is deprecated and will be removed in ~M127. See " + "https://github.com/chromiumembedded/cef/issues/3685"; + DCHECK(!main_delegate_); main_delegate_ = MakeDelegate( settings->chrome_runtime ? RuntimeType::CHROME : RuntimeType::ALLOY, this,