sha
stringlengths
40
40
author
stringclasses
155 values
date
stringlengths
19
19
commit_message
stringlengths
24
9.22k
git_diff
stringlengths
110
332k
type
stringclasses
9 values
e1d63794e5ce74006188ed2b7f1c35b5793caf36
Shelley Vohr
2023-08-22 14:56:58
fix: `chrome.tabs` 'url' and 'title' are privileged information (#39595) fix: tabs url and title are privileged information
diff --git a/shell/browser/extensions/api/tabs/tabs_api.cc b/shell/browser/extensions/api/tabs/tabs_api.cc index 0cdc96819f..59a019bf99 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.cc +++ b/shell/browser/extensions/api/tabs/tabs_api.cc @@ -301,6 +301,7 @@ ExtensionFunction::ResponseAction TabsQueryFunction::Run() { tabs::Tab tab; tab.id = contents->ID(); + tab.title = base::UTF16ToUTF8(wc->GetTitle()); tab.url = wc->GetLastCommittedURL().spec(); tab.active = contents->IsFocused(); tab.audible = contents->IsCurrentlyAudible(); @@ -322,12 +323,18 @@ ExtensionFunction::ResponseAction TabsGetFunction::Run() { return RespondNow(Error("No such tab")); tabs::Tab tab; - tab.id = tab_id; - // TODO(nornagon): in Chrome, the tab URL is only available to extensions - // that have the "tabs" (or "activeTab") permission. We should do the same - // permission check here. - tab.url = contents->web_contents()->GetLastCommittedURL().spec(); + + // "title" and "url" properties are considered privileged data and can + // only be checked if the extension has the "tabs" permission or it has + // access to the WebContents's origin. + auto* wc = contents->web_contents(); + if (extension()->permissions_data()->HasAPIPermissionForTab( + contents->ID(), mojom::APIPermissionID::kTab) || + extension()->permissions_data()->HasHostPermission(wc->GetURL())) { + tab.url = wc->GetLastCommittedURL().spec(); + tab.title = base::UTF16ToUTF8(wc->GetTitle()); + } tab.active = contents->IsFocused(); @@ -609,10 +616,16 @@ ExtensionFunction::ResponseValue TabsUpdateFunction::GetResult() { auto* api_web_contents = electron::api::WebContents::From(web_contents_); tab.id = (api_web_contents ? api_web_contents->ID() : -1); - // TODO(nornagon): in Chrome, the tab URL is only available to extensions - // that have the "tabs" (or "activeTab") permission. We should do the same - // permission check here. - tab.url = web_contents_->GetLastCommittedURL().spec(); + // "title" and "url" properties are considered privileged data and can + // only be checked if the extension has the "tabs" permission or it has + // access to the WebContents's origin. + if (extension()->permissions_data()->HasAPIPermissionForTab( + api_web_contents->ID(), mojom::APIPermissionID::kTab) || + extension()->permissions_data()->HasHostPermission( + web_contents_->GetURL())) { + tab.url = web_contents_->GetLastCommittedURL().spec(); + tab.title = base::UTF16ToUTF8(web_contents_->GetTitle()); + } if (api_web_contents) tab.active = api_web_contents->IsFocused(); diff --git a/shell/common/extensions/api/_permission_features.json b/shell/common/extensions/api/_permission_features.json index 01bf003ec9..6f54beac04 100644 --- a/shell/common/extensions/api/_permission_features.json +++ b/shell/common/extensions/api/_permission_features.json @@ -20,5 +20,11 @@ "extension_types": [ "extension" ] + }, + "tabs": { + "channel": "stable", + "extension_types": [ + "extension" + ] } } \ No newline at end of file diff --git a/shell/common/extensions/electron_extensions_api_provider.cc b/shell/common/extensions/electron_extensions_api_provider.cc index 36cf3f8957..242e462f6c 100644 --- a/shell/common/extensions/electron_extensions_api_provider.cc +++ b/shell/common/extensions/electron_extensions_api_provider.cc @@ -39,6 +39,8 @@ constexpr APIPermissionInfo::InitInfo permissions_to_register[] = { {mojom::APIPermissionID::kPdfViewerPrivate, "pdfViewerPrivate"}, #endif {mojom::APIPermissionID::kManagement, "management"}, + {mojom::APIPermissionID::kTab, "tabs", + APIPermissionInfo::kFlagRequiresManagementUIWarning}, }; base::span<const APIPermissionInfo::InitInfo> GetPermissionInfos() { return base::make_span(permissions_to_register); diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index 03da89c715..cf792d97b7 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -842,15 +842,14 @@ describe('chrome extensions', () => { before(async () => { customSession = session.fromPartition(`persist:${uuid.v4()}`); - await customSession.loadExtension(path.join(fixtures, 'extensions', 'tabs-api-async')); + await customSession.loadExtension(path.join(fixtures, 'extensions', 'chrome-tabs', 'api-async')); }); beforeEach(() => { w = new BrowserWindow({ show: false, webPreferences: { - session: customSession, - nodeIntegration: true + session: customSession } }); }); @@ -913,27 +912,55 @@ describe('chrome extensions', () => { }); }); - it('get', async () => { - await w.loadURL(url); + describe('get', () => { + it('returns tab properties', async () => { + await w.loadURL(url); - const message = { method: 'get' }; - w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + const message = { method: 'get' }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [,, responseString] = await once(w.webContents, 'console-message'); - const response = JSON.parse(responseString); - expect(response).to.have.property('active').that.is.a('boolean'); - expect(response).to.have.property('autoDiscardable').that.is.a('boolean'); - expect(response).to.have.property('discarded').that.is.a('boolean'); - expect(response).to.have.property('groupId').that.is.a('number'); - expect(response).to.have.property('highlighted').that.is.a('boolean'); - expect(response).to.have.property('id').that.is.a('number'); - expect(response).to.have.property('incognito').that.is.a('boolean'); - expect(response).to.have.property('index').that.is.a('number'); - expect(response).to.have.property('pinned').that.is.a('boolean'); - expect(response).to.have.property('selected').that.is.a('boolean'); - expect(response).to.have.property('url').that.is.a('string'); - expect(response).to.have.property('windowId').that.is.a('number'); + const response = JSON.parse(responseString); + expect(response).to.have.property('url').that.is.a('string'); + expect(response).to.have.property('title').that.is.a('string'); + expect(response).to.have.property('active').that.is.a('boolean'); + expect(response).to.have.property('autoDiscardable').that.is.a('boolean'); + expect(response).to.have.property('discarded').that.is.a('boolean'); + expect(response).to.have.property('groupId').that.is.a('number'); + expect(response).to.have.property('highlighted').that.is.a('boolean'); + expect(response).to.have.property('id').that.is.a('number'); + expect(response).to.have.property('incognito').that.is.a('boolean'); + expect(response).to.have.property('index').that.is.a('number'); + expect(response).to.have.property('pinned').that.is.a('boolean'); + expect(response).to.have.property('selected').that.is.a('boolean'); + expect(response).to.have.property('windowId').that.is.a('number'); + }); + + it('does not return privileged properties without tabs permission', async () => { + const noPrivilegeSes = session.fromPartition(`persist:${uuid.v4()}`); + await noPrivilegeSes.loadExtension(path.join(fixtures, 'extensions', 'chrome-tabs', 'no-privileges')); + + w = new BrowserWindow({ show: false, webPreferences: { session: noPrivilegeSes } }); + await w.loadURL(url); + + w.webContents.executeJavaScript('window.postMessage(\'{}\', \'*\')'); + const [,, responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + expect(response).not.to.have.property('url'); + expect(response).not.to.have.property('title'); + expect(response).to.have.property('active').that.is.a('boolean'); + expect(response).to.have.property('autoDiscardable').that.is.a('boolean'); + expect(response).to.have.property('discarded').that.is.a('boolean'); + expect(response).to.have.property('groupId').that.is.a('number'); + expect(response).to.have.property('highlighted').that.is.a('boolean'); + expect(response).to.have.property('id').that.is.a('number'); + expect(response).to.have.property('incognito').that.is.a('boolean'); + expect(response).to.have.property('index').that.is.a('number'); + expect(response).to.have.property('pinned').that.is.a('boolean'); + expect(response).to.have.property('selected').that.is.a('boolean'); + expect(response).to.have.property('windowId').that.is.a('number'); + }); }); it('reload', async () => { @@ -960,6 +987,19 @@ describe('chrome extensions', () => { const [,, responseString] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); + expect(response).to.have.property('url').that.is.a('string'); + expect(response).to.have.property('title').that.is.a('string'); + expect(response).to.have.property('active').that.is.a('boolean'); + expect(response).to.have.property('autoDiscardable').that.is.a('boolean'); + expect(response).to.have.property('discarded').that.is.a('boolean'); + expect(response).to.have.property('groupId').that.is.a('number'); + expect(response).to.have.property('highlighted').that.is.a('boolean'); + expect(response).to.have.property('id').that.is.a('number'); + expect(response).to.have.property('incognito').that.is.a('boolean'); + expect(response).to.have.property('index').that.is.a('number'); + expect(response).to.have.property('pinned').that.is.a('boolean'); + expect(response).to.have.property('selected').that.is.a('boolean'); + expect(response).to.have.property('windowId').that.is.a('number'); expect(response).to.have.property('mutedInfo').that.is.a('object'); const { mutedInfo } = response; expect(mutedInfo).to.deep.eq({ diff --git a/spec/fixtures/extensions/tabs-api-async/background.js b/spec/fixtures/extensions/chrome-tabs/api-async/background.js similarity index 100% rename from spec/fixtures/extensions/tabs-api-async/background.js rename to spec/fixtures/extensions/chrome-tabs/api-async/background.js diff --git a/spec/fixtures/extensions/tabs-api-async/main.js b/spec/fixtures/extensions/chrome-tabs/api-async/main.js similarity index 100% rename from spec/fixtures/extensions/tabs-api-async/main.js rename to spec/fixtures/extensions/chrome-tabs/api-async/main.js diff --git a/spec/fixtures/extensions/tabs-api-async/manifest.json b/spec/fixtures/extensions/chrome-tabs/api-async/manifest.json similarity index 82% rename from spec/fixtures/extensions/tabs-api-async/manifest.json rename to spec/fixtures/extensions/chrome-tabs/api-async/manifest.json index 58081152de..d0a208cd06 100644 --- a/spec/fixtures/extensions/tabs-api-async/manifest.json +++ b/spec/fixtures/extensions/chrome-tabs/api-async/manifest.json @@ -1,5 +1,5 @@ { - "name": "tabs-api-async", + "name": "api-async", "version": "1.0", "content_scripts": [ { @@ -8,6 +8,7 @@ "run_at": "document_start" } ], + "permissions": ["tabs"], "background": { "service_worker": "background.js" }, diff --git a/spec/fixtures/extensions/chrome-tabs/no-privileges/background.js b/spec/fixtures/extensions/chrome-tabs/no-privileges/background.js new file mode 100644 index 0000000000..d586b455a1 --- /dev/null +++ b/spec/fixtures/extensions/chrome-tabs/no-privileges/background.js @@ -0,0 +1,6 @@ +/* global chrome */ + +chrome.runtime.onMessage.addListener((_request, sender, sendResponse) => { + chrome.tabs.get(sender.tab.id).then(sendResponse); + return true; +}); diff --git a/spec/fixtures/extensions/chrome-tabs/no-privileges/main.js b/spec/fixtures/extensions/chrome-tabs/no-privileges/main.js new file mode 100644 index 0000000000..cc12115487 --- /dev/null +++ b/spec/fixtures/extensions/chrome-tabs/no-privileges/main.js @@ -0,0 +1,11 @@ +/* global chrome */ + +chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { + sendResponse(request); +}); + +window.addEventListener('message', () => { + chrome.runtime.sendMessage({}, response => { + console.log(JSON.stringify(response)); + }); +}, false); diff --git a/spec/fixtures/extensions/chrome-tabs/no-privileges/manifest.json b/spec/fixtures/extensions/chrome-tabs/no-privileges/manifest.json new file mode 100644 index 0000000000..f920c8bc0e --- /dev/null +++ b/spec/fixtures/extensions/chrome-tabs/no-privileges/manifest.json @@ -0,0 +1,19 @@ +{ + "name": "no-privileges", + "version": "1.0", + "content_scripts": [ + { + "matches": [ + "<all_urls>" + ], + "js": [ + "main.js" + ], + "run_at": "document_start" + } + ], + "background": { + "service_worker": "background.js" + }, + "manifest_version": 3 +} \ No newline at end of file
fix
1cf5e6d88cf2f9715ceb830773fa57f8f208db38
Charles Kerr
2024-11-19 13:45:18
fix: cyclical #include dependency between autofill_popup.h and autofill_popup_view.h (#44705) fix: AutofillPopup warning: use '= default' to define a trivial default constructor [modernize-use-equals-default] refactor: reduce #indclude scope in autofill_popup.h and autofill_popup_view.h
diff --git a/shell/browser/ui/autofill_popup.cc b/shell/browser/ui/autofill_popup.cc index 9db3b5ac77..d63b33459c 100644 --- a/shell/browser/ui/autofill_popup.cc +++ b/shell/browser/ui/autofill_popup.cc @@ -15,6 +15,7 @@ #include "shell/browser/osr/osr_render_widget_host_view.h" #include "shell/browser/osr/osr_view_proxy.h" #include "shell/browser/ui/autofill_popup.h" +#include "shell/browser/ui/views/autofill_popup_view.h" #include "shell/common/api/api.mojom.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "ui/color/color_id.h" @@ -160,11 +161,7 @@ gfx::Rect CalculatePopupBounds(const gfx::Size& desired_size, } // namespace -AutofillPopup::AutofillPopup() { - bold_font_list_ = gfx::FontList().DeriveWithWeight(gfx::Font::Weight::BOLD); - smaller_font_list_ = - gfx::FontList().DeriveWithSizeDelta(kSmallerFontSizeDelta); -} +AutofillPopup::AutofillPopup() = default; AutofillPopup::~AutofillPopup() { Hide(); diff --git a/shell/browser/ui/autofill_popup.h b/shell/browser/ui/autofill_popup.h index 00c1c900ee..e652d2088d 100644 --- a/shell/browser/ui/autofill_popup.h +++ b/shell/browser/ui/autofill_popup.h @@ -8,15 +8,18 @@ #include <vector> #include "base/memory/raw_ptr.h" -#include "shell/browser/ui/views/autofill_popup_view.h" #include "ui/gfx/font_list.h" -#include "ui/views/view.h" -#include "ui/views/widget/widget.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/views/view_observer.h" namespace content { class RenderFrameHost; } // namespace content +namespace gfx { +class RectF; +} // namespace gfx + namespace ui { using ColorId = int; } // namespace ui @@ -68,6 +71,10 @@ class AutofillPopup : private views::ViewObserver { const std::u16string& label_at(int i) const { return labels_.at(i); } int LineFromY(int y) const; + static constexpr int kNamePadding = 15; + static constexpr int kRowHeight = 24; + static constexpr int kSmallerFontSizeDelta = -1; + int selected_index_; // Popup location @@ -81,8 +88,10 @@ class AutofillPopup : private views::ViewObserver { std::vector<std::u16string> labels_; // Font lists for the suggestions - gfx::FontList smaller_font_list_; - gfx::FontList bold_font_list_; + const gfx::FontList smaller_font_list_ = + gfx::FontList{}.DeriveWithSizeDelta(kSmallerFontSizeDelta); + const gfx::FontList bold_font_list_ = + gfx::FontList{}.DeriveWithWeight(gfx::Font::Weight::BOLD); // For sending the accepted suggestion to the render frame that // asked to open the popup diff --git a/shell/browser/ui/views/autofill_popup_view.cc b/shell/browser/ui/views/autofill_popup_view.cc index 68e1d6dfa3..da7527b419 100644 --- a/shell/browser/ui/views/autofill_popup_view.cc +++ b/shell/browser/ui/views/autofill_popup_view.cc @@ -12,6 +12,7 @@ #include "cc/paint/skia_paint_canvas.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_view_host.h" +#include "shell/browser/ui/autofill_popup.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/color/color_provider.h" diff --git a/shell/browser/ui/views/autofill_popup_view.h b/shell/browser/ui/views/autofill_popup_view.h index de66c3b350..9c0035dc49 100644 --- a/shell/browser/ui/views/autofill_popup_view.h +++ b/shell/browser/ui/views/autofill_popup_view.h @@ -8,8 +8,6 @@ #include <memory> #include <optional> -#include "shell/browser/ui/autofill_popup.h" - #include "base/memory/raw_ptr.h" #include "content/public/browser/render_widget_host.h" #include "electron/buildflags/buildflags.h" @@ -31,11 +29,8 @@ struct AXNodeData; namespace electron { -const int kPopupBorderThickness = 1; -const int kSmallerFontSizeDelta = -1; -const int kEndPadding = 8; -const int kNamePadding = 15; -const int kRowHeight = 24; +constexpr int kPopupBorderThickness = 1; +constexpr int kEndPadding = 8; class AutofillPopup;
fix
d9329042e2cb68db888d4acf36a87da5ab6e99d2
Shelley Vohr
2023-08-09 14:47:19
feat: add support for `chrome.tabs.query` (#39330) * feat: add support for tabs.query * fix: scope to webContents in current session * test: add test for session behavior
diff --git a/docs/api/extensions.md b/docs/api/extensions.md index 2c1539d57d..c9970d066c 100644 --- a/docs/api/extensions.md +++ b/docs/api/extensions.md @@ -91,8 +91,9 @@ The following events of `chrome.runtime` are supported: ### `chrome.storage` -Only `chrome.storage.local` is supported; `chrome.storage.sync` and -`chrome.storage.managed` are not. +The following methods of `chrome.storage` are supported: + +- `chrome.storage.local` ### `chrome.tabs` @@ -101,6 +102,8 @@ The following methods of `chrome.tabs` are supported: - `chrome.tabs.sendMessage` - `chrome.tabs.reload` - `chrome.tabs.executeScript` +- `chrome.tabs.query` (partial support) + - supported properties: `url`, `title`, `audible`, `active`, `muted`. - `chrome.tabs.update` (partial support) - supported properties: `url`, `muted`. @@ -117,6 +120,9 @@ The following methods of `chrome.management` are supported: - `chrome.management.getSelf` - `chrome.management.getPermissionWarningsById` - `chrome.management.getPermissionWarningsByManifest` + +The following events of `chrome.management` are supported: + - `chrome.management.onEnabled` - `chrome.management.onDisabled` diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index f1f21d35e6..479a76a469 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -4405,6 +4405,16 @@ WebContents* WebContents::FromID(int32_t id) { return GetAllWebContents().Lookup(id); } +// static +std::list<WebContents*> WebContents::GetWebContentsList() { + std::list<WebContents*> list; + for (auto iter = base::IDMap<WebContents*>::iterator(&GetAllWebContents()); + !iter.IsAtEnd(); iter.Advance()) { + list.push_back(iter.GetCurrentValue()); + } + return list; +} + // static gin::WrapperInfo WebContents::kWrapperInfo = {gin::kEmbedderNativeGin}; diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 9273cdf95a..fee6f44224 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -134,6 +134,7 @@ class WebContents : public ExclusiveAccessContext, // if there is no associated wrapper. static WebContents* From(content::WebContents* web_contents); static WebContents* FromID(int32_t id); + static std::list<WebContents*> GetWebContentsList(); // Get the V8 wrapper of the |web_contents|, or create one if not existed. // diff --git a/shell/browser/extensions/api/tabs/tabs_api.cc b/shell/browser/extensions/api/tabs/tabs_api.cc index cde0d41b28..79f595121b 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.cc +++ b/shell/browser/extensions/api/tabs/tabs_api.cc @@ -7,6 +7,7 @@ #include <memory> #include <utility> +#include "base/strings/pattern.h" #include "chrome/common/url_constants.h" #include "components/url_formatter/url_fixer.h" #include "content/public/browser/navigation_entry.h" @@ -16,7 +17,9 @@ #include "extensions/common/mojom/host_id.mojom.h" #include "extensions/common/permissions/permissions_data.h" #include "shell/browser/api/electron_api_web_contents.h" +#include "shell/browser/native_window.h" #include "shell/browser/web_contents_zoom_controller.h" +#include "shell/browser/window_list.h" #include "shell/common/extensions/api/tabs.h" #include "third_party/blink/public/common/page/page_zoom.h" #include "url/gurl.h" @@ -58,6 +61,13 @@ void ZoomModeToZoomSettings(WebContentsZoomController::ZoomMode zoom_mode, } } +// Returns true if either |boolean| is disengaged, or if |boolean| and +// |value| are equal. This function is used to check if a tab's parameters match +// those of the browser. +bool MatchesBool(const absl::optional<bool>& boolean, bool value) { + return !boolean || *boolean == value; +} + api::tabs::MutedInfo CreateMutedInfo(content::WebContents* contents) { DCHECK(contents); api::tabs::MutedInfo info; @@ -65,6 +75,7 @@ api::tabs::MutedInfo CreateMutedInfo(content::WebContents* contents) { info.reason = api::tabs::MUTED_INFO_REASON_USER; return info; } + } // namespace ExecuteCodeInTabFunction::ExecuteCodeInTabFunction() : execute_tab_id_(-1) {} @@ -214,6 +225,93 @@ ExtensionFunction::ResponseAction TabsReloadFunction::Run() { return RespondNow(NoArguments()); } +ExtensionFunction::ResponseAction TabsQueryFunction::Run() { + absl::optional<tabs::Query::Params> params = + tabs::Query::Params::Create(args()); + EXTENSION_FUNCTION_VALIDATE(params); + + URLPatternSet url_patterns; + if (params->query_info.url) { + std::vector<std::string> url_pattern_strings; + if (params->query_info.url->as_string) + url_pattern_strings.push_back(*params->query_info.url->as_string); + else if (params->query_info.url->as_strings) + url_pattern_strings.swap(*params->query_info.url->as_strings); + // It is o.k. to use URLPattern::SCHEME_ALL here because this function does + // not grant access to the content of the tabs, only to seeing their URLs + // and meta data. + std::string error; + if (!url_patterns.Populate(url_pattern_strings, URLPattern::SCHEME_ALL, + true, &error)) { + return RespondNow(Error(std::move(error))); + } + } + + std::string title = params->query_info.title.value_or(std::string()); + absl::optional<bool> audible = params->query_info.audible; + absl::optional<bool> muted = params->query_info.muted; + + base::Value::List result; + + // Filter out webContents that don't belong to the current browser context. + auto* bc = browser_context(); + auto all_contents = electron::api::WebContents::GetWebContentsList(); + all_contents.remove_if([&bc](electron::api::WebContents* wc) { + return (bc != wc->web_contents()->GetBrowserContext()); + }); + + for (auto* contents : all_contents) { + if (!contents || !contents->web_contents()) + continue; + + auto* wc = contents->web_contents(); + + // Match webContents audible value. + if (!MatchesBool(audible, wc->IsCurrentlyAudible())) + continue; + + // Match webContents muted value. + if (!MatchesBool(muted, wc->IsAudioMuted())) + continue; + + // Match webContents active status. + if (!MatchesBool(params->query_info.active, contents->IsFocused())) + continue; + + if (!title.empty() || !url_patterns.is_empty()) { + // "title" and "url" properties are considered privileged data and can + // only be checked if the extension has the "tabs" permission or it has + // access to the WebContents's origin. Otherwise, this tab is considered + // not matched. + if (!extension()->permissions_data()->HasAPIPermissionForTab( + contents->ID(), mojom::APIPermissionID::kTab) && + !extension()->permissions_data()->HasHostPermission(wc->GetURL())) { + continue; + } + + // Match webContents title. + if (!title.empty() && + !base::MatchPattern(wc->GetTitle(), base::UTF8ToUTF16(title))) + continue; + + // Match webContents url. + if (!url_patterns.is_empty() && !url_patterns.MatchesURL(wc->GetURL())) + continue; + } + + tabs::Tab tab; + tab.id = contents->ID(); + tab.url = wc->GetLastCommittedURL().spec(); + tab.active = contents->IsFocused(); + tab.audible = contents->IsCurrentlyAudible(); + tab.muted_info = CreateMutedInfo(wc); + + result.Append(tab.ToValue()); + } + + return RespondNow(WithArguments(std::move(result))); +} + ExtensionFunction::ResponseAction TabsGetFunction::Run() { absl::optional<tabs::Get::Params> params = tabs::Get::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/shell/browser/extensions/api/tabs/tabs_api.h b/shell/browser/extensions/api/tabs/tabs_api.h index fd6c94f2c9..1c18dae41f 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.h +++ b/shell/browser/extensions/api/tabs/tabs_api.h @@ -55,6 +55,14 @@ class TabsReloadFunction : public ExtensionFunction { DECLARE_EXTENSION_FUNCTION("tabs.reload", TABS_RELOAD) }; +class TabsQueryFunction : public ExtensionFunction { + ~TabsQueryFunction() override {} + + ResponseAction Run() override; + + DECLARE_EXTENSION_FUNCTION("tabs.query", TABS_QUERY) +}; + class TabsGetFunction : public ExtensionFunction { ~TabsGetFunction() override {} diff --git a/shell/common/extensions/api/tabs.json b/shell/common/extensions/api/tabs.json index c39e67a88c..53a835f6cb 100644 --- a/shell/common/extensions/api/tabs.json +++ b/shell/common/extensions/api/tabs.json @@ -3,6 +3,16 @@ "namespace": "tabs", "description": "Use the <code>chrome.tabs</code> API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.", "types": [ + { + "id": "TabStatus", + "type": "string", + "enum": [ + "unloaded", + "loading", + "complete" + ], + "description": "The tab's loading status." + }, { "id": "MutedInfoReason", "type": "string", @@ -210,6 +220,18 @@ "description": "Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings." } } + }, + { + "id": "WindowType", + "type": "string", + "enum": [ + "normal", + "popup", + "panel", + "app", + "devtools" + ], + "description": "The type of window." } ], "functions": [ @@ -489,6 +511,124 @@ ] } }, + { + "name": "query", + "type": "function", + "description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.", + "parameters": [ + { + "type": "object", + "name": "queryInfo", + "properties": { + "active": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are active in their windows." + }, + "pinned": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are pinned." + }, + "audible": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are audible." + }, + "muted": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are muted." + }, + "highlighted": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are highlighted." + }, + "discarded": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content is reloaded the next time it is activated." + }, + "autoDiscardable": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs can be discarded automatically by the browser when resources are low." + }, + "currentWindow": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are in the <a href='windows#current-window'>current window</a>." + }, + "lastFocusedWindow": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are in the last focused window." + }, + "status": { + "$ref": "TabStatus", + "optional": true, + "description": "The tab loading status." + }, + "title": { + "type": "string", + "optional": true, + "description": "Match page titles against a pattern. This property is ignored if the extension does not have the <code>\"tabs\"</code> permission." + }, + "url": { + "choices": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "optional": true, + "description": "Match tabs against one or more <a href='match_patterns'>URL patterns</a>. Fragment identifiers are not matched. This property is ignored if the extension does not have the <code>\"tabs\"</code> permission." + }, + "groupId": { + "type": "integer", + "optional": true, + "minimum": -1, + "description": "The ID of the group that the tabs are in, or $(ref:tabGroups.TAB_GROUP_ID_NONE) for ungrouped tabs." + }, + "windowId": { + "type": "integer", + "optional": true, + "minimum": -2, + "description": "The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the <a href='windows#current-window'>current window</a>." + }, + "windowType": { + "$ref": "WindowType", + "optional": true, + "description": "The type of window the tabs are in." + }, + "index": { + "type": "integer", + "optional": true, + "minimum": 0, + "description": "The position of the tabs within their windows." + } + } + } + ], + "returns_async": { + "name": "callback", + "parameters": [ + { + "name": "result", + "type": "array", + "items": { + "$ref": "Tab" + } + } + ] + } + }, { "name": "update", "type": "function", diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index c55964c990..03da89c715 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -967,6 +967,66 @@ describe('chrome extensions', () => { reason: 'user' }); }); + + describe('query', () => { + it('can query for a tab with specific properties', async () => { + await w.loadURL(url); + + expect(w.webContents.isAudioMuted()).to.be.false('muted'); + w.webContents.setAudioMuted(true); + expect(w.webContents.isAudioMuted()).to.be.true('not muted'); + + const message = { method: 'query', args: [{ muted: true }] }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [, , responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + expect(response).to.have.lengthOf(1); + + const tab = response[0]; + expect(tab.mutedInfo).to.deep.equal({ + muted: true, + reason: 'user' + }); + }); + + it('only returns tabs in the same session', async () => { + await w.loadURL(url); + w.webContents.setAudioMuted(true); + + const sameSessionWin = new BrowserWindow({ + show: false, + webPreferences: { + session: customSession + } + }); + + sameSessionWin.webContents.setAudioMuted(true); + + const newSession = session.fromPartition(`persist:${uuid.v4()}`); + const differentSessionWin = new BrowserWindow({ + show: false, + webPreferences: { + session: newSession + } + }); + + differentSessionWin.webContents.setAudioMuted(true); + + const message = { method: 'query', args: [{ muted: true }] }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [, , responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + expect(response).to.have.lengthOf(2); + for (const tab of response) { + expect(tab.mutedInfo).to.deep.equal({ + muted: true, + reason: 'user' + }); + } + }); + }); }); }); }); diff --git a/spec/fixtures/extensions/tabs-api-async/background.js b/spec/fixtures/extensions/tabs-api-async/background.js index 2e3eb8ebf5..9133bd4fb6 100644 --- a/spec/fixtures/extensions/tabs-api-async/background.js +++ b/spec/fixtures/extensions/tabs-api-async/background.js @@ -38,6 +38,12 @@ const handleRequest = (request, sender, sendResponse) => { break; } + case 'query': { + const [params] = args; + chrome.tabs.query(params).then(sendResponse); + break; + } + case 'reload': { chrome.tabs.reload(tabId).then(() => { sendResponse({ status: 'reloaded' }); diff --git a/spec/fixtures/extensions/tabs-api-async/main.js b/spec/fixtures/extensions/tabs-api-async/main.js index 4360681115..91030070bc 100644 --- a/spec/fixtures/extensions/tabs-api-async/main.js +++ b/spec/fixtures/extensions/tabs-api-async/main.js @@ -15,6 +15,11 @@ const testMap = { console.log(JSON.stringify(response)); }); }, + query (params) { + chrome.runtime.sendMessage({ method: 'query', args: [params] }, response => { + console.log(JSON.stringify(response)); + }); + }, getZoom () { chrome.runtime.sendMessage({ method: 'getZoom', args: [] }, response => { console.log(JSON.stringify(response));
feat
a31deea1ba28335fb20f936a6dfd59b407ddca45
John Kleinschmidt
2023-10-09 09:19:21
ci: fixup diagnose_goma_log.py call (#40131)
diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index aa8ebf26dc..7cc7a94bfb 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -754,8 +754,8 @@ step-show-goma-stats: &step-show-goma-stats command: | set +e set +o pipefail - $GOMA_DIR/goma_ctl.py stat - $GOMA_DIR/diagnose_goma_log.py + python3 $GOMA_DIR/goma_ctl.py stat + python3 $GOMA_DIR/diagnose_goma_log.py true when: always background: true
ci
54d53bfa514e50e1847b7b4c110a8d46300d4c79
Shelley Vohr
2024-11-20 12:45:08
fix: tooltips in WCO caption buttons (#44721) fix: tooltips in WCO capton buttons
diff --git a/shell/browser/ui/views/win_caption_button_container.cc b/shell/browser/ui/views/win_caption_button_container.cc index d98af95380..2aff060d8c 100644 --- a/shell/browser/ui/views/win_caption_button_container.cc +++ b/shell/browser/ui/views/win_caption_button_container.cc @@ -19,6 +19,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/compositor/layer.h" #include "ui/strings/grit/ui_strings.h" +#include "ui/views/accessibility/view_accessibility.h" #include "ui/views/background.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/view_class_properties.h" @@ -83,6 +84,7 @@ WinCaptionButtonContainer::WinCaptionButtonContainer(WinFrameView* frame_view) views::MaximumFlexSizeRule::kPreferred, /* adjust_width_for_height */ false, views::MinimumFlexSizeRule::kScaleToZero)); + UpdateButtonToolTipsForWindowControlsOverlay(); } WinCaptionButtonContainer::~WinCaptionButtonContainer() {} @@ -105,18 +107,6 @@ int WinCaptionButtonContainer::NonClientHitTest(const gfx::Point& point) const { return HTCAPTION; } -gfx::Size WinCaptionButtonContainer::GetButtonSize() const { - // Close button size is set the same as all the buttons - return close_button_->GetSize(); -} - -void WinCaptionButtonContainer::SetButtonSize(gfx::Size size) { - minimize_button_->SetSize(size); - maximize_button_->SetSize(size); - restore_button_->SetSize(size); - close_button_->SetSize(size); -} - void WinCaptionButtonContainer::ResetWindowControls() { minimize_button_->SetState(views::Button::STATE_NORMAL); maximize_button_->SetState(views::Button::STATE_NORMAL); @@ -132,10 +122,7 @@ void WinCaptionButtonContainer::AddedToWidget() { widget_observation_.Observe(widget); UpdateButtons(); - - if (frame_view_->window()->IsWindowControlsOverlayEnabled()) { - UpdateBackground(); - } + UpdateBackground(); } void WinCaptionButtonContainer::RemovedFromWidget() { @@ -183,6 +170,24 @@ void WinCaptionButtonContainer::UpdateButtons() { InvalidateLayout(); } +void WinCaptionButtonContainer::UpdateButtonToolTipsForWindowControlsOverlay() { + minimize_button_->SetTooltipText( + minimize_button_->GetViewAccessibility().GetCachedName()); + maximize_button_->SetTooltipText( + maximize_button_->GetViewAccessibility().GetCachedName()); + restore_button_->SetTooltipText( + restore_button_->GetViewAccessibility().GetCachedName()); + close_button_->SetTooltipText( + close_button_->GetViewAccessibility().GetCachedName()); +} + +void WinCaptionButtonContainer::SetButtonSize(gfx::Size size) { + minimize_button_->SetSize(size); + maximize_button_->SetSize(size); + restore_button_->SetSize(size); + close_button_->SetSize(size); +} + BEGIN_METADATA(WinCaptionButtonContainer) END_METADATA diff --git a/shell/browser/ui/views/win_caption_button_container.h b/shell/browser/ui/views/win_caption_button_container.h index 308f35ca53..7c2390b7da 100644 --- a/shell/browser/ui/views/win_caption_button_container.h +++ b/shell/browser/ui/views/win_caption_button_container.h @@ -42,9 +42,11 @@ class WinCaptionButtonContainer : public views::View, // See also ClientView::NonClientHitTest. int NonClientHitTest(const gfx::Point& point) const; - gfx::Size GetButtonSize() const; void SetButtonSize(gfx::Size size); + // Add tooltip text to caption buttons. + void UpdateButtonToolTipsForWindowControlsOverlay(); + // Sets caption button container background color. void UpdateBackground();
fix
23739c644ba8dfa6cec5417cdf4e2550ca4b94b8
Shelley Vohr
2023-01-31 12:29:29
fix: crash on `WebWorkerObserver` script execution (#37050) fix: crash on WebWorkerObserver script execution
diff --git a/shell/renderer/electron_renderer_client.cc b/shell/renderer/electron_renderer_client.cc index 50b5cde56e..bb1fd5f748 100644 --- a/shell/renderer/electron_renderer_client.cc +++ b/shell/renderer/electron_renderer_client.cc @@ -168,7 +168,12 @@ void ElectronRendererClient::WorkerScriptReadyForEvaluationOnWorkerThread( // that have a different value for nodeIntegrationInWorker if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNodeIntegrationInWorker)) { - WebWorkerObserver::GetCurrent()->WorkerScriptReadyForEvaluation(context); + // WorkerScriptReadyForEvaluationOnWorkerThread can be invoked multiple + // times for the same thread, so we need to create a new observer each time + // this happens. We use a ThreadLocalOwnedPointer to ensure that the old + // observer for a given thread gets destructed when swapping with the new + // observer in WebWorkerObserver::Create. + WebWorkerObserver::Create()->WorkerScriptReadyForEvaluation(context); } } @@ -182,7 +187,9 @@ void ElectronRendererClient::WillDestroyWorkerContextOnWorkerThread( // with webPreferences that have a different value for nodeIntegrationInWorker if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNodeIntegrationInWorker)) { - WebWorkerObserver::GetCurrent()->ContextWillDestroy(context); + auto* current = WebWorkerObserver::GetCurrent(); + if (current) + current->ContextWillDestroy(context); } } diff --git a/shell/renderer/web_worker_observer.cc b/shell/renderer/web_worker_observer.cc index 7cf9c1cd69..2ee0d387cc 100644 --- a/shell/renderer/web_worker_observer.cc +++ b/shell/renderer/web_worker_observer.cc @@ -4,7 +4,9 @@ #include "shell/renderer/web_worker_observer.h" -#include "base/lazy_instance.h" +#include <utility> + +#include "base/no_destructor.h" #include "base/threading/thread_local.h" #include "shell/common/api/electron_bindings.h" #include "shell/common/gin_helper/event_emitter_caller.h" @@ -15,28 +17,31 @@ namespace electron { namespace { -static base::LazyInstance< - base::ThreadLocalPointer<WebWorkerObserver>>::DestructorAtExit lazy_tls = - LAZY_INSTANCE_INITIALIZER; +static base::NoDestructor<base::ThreadLocalOwnedPointer<WebWorkerObserver>> + lazy_tls; } // namespace // static WebWorkerObserver* WebWorkerObserver::GetCurrent() { - WebWorkerObserver* self = lazy_tls.Pointer()->Get(); - return self ? self : new WebWorkerObserver; + return lazy_tls->Get(); +} + +// static +WebWorkerObserver* WebWorkerObserver::Create() { + auto obs = std::make_unique<WebWorkerObserver>(); + auto* obs_raw = obs.get(); + lazy_tls->Set(std::move(obs)); + return obs_raw; } WebWorkerObserver::WebWorkerObserver() : node_bindings_( NodeBindings::Create(NodeBindings::BrowserEnvironment::kWorker)), electron_bindings_( - std::make_unique<ElectronBindings>(node_bindings_->uv_loop())) { - lazy_tls.Pointer()->Set(this); -} + std::make_unique<ElectronBindings>(node_bindings_->uv_loop())) {} WebWorkerObserver::~WebWorkerObserver() { - lazy_tls.Pointer()->Set(nullptr); // Destroying the node environment will also run the uv loop, // Node.js expects `kExplicit` microtasks policy and will run microtasks // checkpoints after every call into JavaScript. Since we use a different @@ -90,7 +95,8 @@ void WebWorkerObserver::ContextWillDestroy(v8::Local<v8::Context> context) { if (env) gin_helper::EmitEvent(env->isolate(), env->process_object(), "exit"); - delete this; + if (lazy_tls->Get()) + lazy_tls->Set(nullptr); } } // namespace electron diff --git a/shell/renderer/web_worker_observer.h b/shell/renderer/web_worker_observer.h index 0b05644fa0..bba7ae7e61 100644 --- a/shell/renderer/web_worker_observer.h +++ b/shell/renderer/web_worker_observer.h @@ -17,8 +17,13 @@ class NodeBindings; // Watches for WebWorker and insert node integration to it. class WebWorkerObserver { public: + WebWorkerObserver(); + ~WebWorkerObserver(); + // Returns the WebWorkerObserver for current worker thread. static WebWorkerObserver* GetCurrent(); + // Creates a new WebWorkerObserver for a given context. + static WebWorkerObserver* Create(); // disable copy WebWorkerObserver(const WebWorkerObserver&) = delete; @@ -28,9 +33,6 @@ class WebWorkerObserver { void ContextWillDestroy(v8::Local<v8::Context> context); private: - WebWorkerObserver(); - ~WebWorkerObserver(); - std::unique_ptr<NodeBindings> node_bindings_; std::unique_ptr<ElectronBindings> electron_bindings_; }; diff --git a/spec/fixtures/crash-cases/worker-multiple-destroy/index.html b/spec/fixtures/crash-cases/worker-multiple-destroy/index.html new file mode 100644 index 0000000000..131b48850d --- /dev/null +++ b/spec/fixtures/crash-cases/worker-multiple-destroy/index.html @@ -0,0 +1,22 @@ +<html> + +<body> + <style> + textarea { + background-image: url(checkerboard); + background-image: paint(checkerboard); + } + + @supports (background: paint(id)) { + background-image: paint(checkerboard); + } + </style> + <textarea></textarea> + <script> + const addPaintWorklet = async () => { + await CSS.paintWorklet.addModule('worklet.js'); + } + </script> +</body> + +</html> diff --git a/spec/fixtures/crash-cases/worker-multiple-destroy/index.js b/spec/fixtures/crash-cases/worker-multiple-destroy/index.js new file mode 100644 index 0000000000..382212f918 --- /dev/null +++ b/spec/fixtures/crash-cases/worker-multiple-destroy/index.js @@ -0,0 +1,38 @@ +const { app, BrowserWindow } = require('electron'); + +async function createWindow () { + const mainWindow = new BrowserWindow({ + webPreferences: { + nodeIntegrationInWorker: true + } + }); + + let loads = 1; + mainWindow.webContents.on('did-finish-load', async () => { + if (loads === 2) { + process.exit(0); + } else { + loads++; + await mainWindow.webContents.executeJavaScript('addPaintWorklet()'); + await mainWindow.webContents.executeJavaScript('location.reload()'); + } + }); + + mainWindow.webContents.on('render-process-gone', () => { + process.exit(1); + }); + + await mainWindow.loadFile('index.html'); +} + +app.whenReady().then(() => { + createWindow(); + + app.on('activate', () => { + if (BrowserWindow.getAllWindows().length === 0) createWindow(); + }); +}); + +app.on('window-all-closed', () => { + if (process.platform !== 'darwin') app.quit(); +}); diff --git a/spec/fixtures/crash-cases/worker-multiple-destroy/worklet.js b/spec/fixtures/crash-cases/worker-multiple-destroy/worklet.js new file mode 100644 index 0000000000..61e24a0602 --- /dev/null +++ b/spec/fixtures/crash-cases/worker-multiple-destroy/worklet.js @@ -0,0 +1,18 @@ +class CheckerboardPainter { + paint (ctx, geom, properties) { + const colors = ['red', 'green', 'blue']; + const size = 32; + for (let y = 0; y < (geom.height / size); y++) { + for (let x = 0; x < (geom.width / size); x++) { + const color = colors[(x + y) % colors.length]; + ctx.beginPath(); + ctx.fillStyle = color; + ctx.rect(x * size, y * size, size, size); + ctx.fill(); + } + } + } +} + +// eslint-disable-next-line no-undef +registerPaint('checkerboard', CheckerboardPainter);
fix
b6bf277b6fa62b1651276e34a4a4e720ce3d2f7d
Charles Kerr
2024-09-16 23:08:40
refactor: reduce code duplication in gin_helper::Promise (#43716) * refactor: move scope scaffolding into SettletScope idea stolen from SpellCheckScope * refactor: move impl of PromiseBase::RejectPromise() to the cc file * chore: remove unused #include
diff --git a/shell/browser/api/electron_api_system_preferences_win.cc b/shell/browser/api/electron_api_system_preferences_win.cc index eeeb7361c2..b5097657bb 100644 --- a/shell/browser/api/electron_api_system_preferences_win.cc +++ b/shell/browser/api/electron_api_system_preferences_win.cc @@ -16,6 +16,7 @@ #include "base/win/windows_types.h" #include "base/win/wrapped_window_proc.h" #include "shell/common/color_util.h" +#include "shell/common/process_util.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/win/hwnd_util.h" diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 3295616951..e2414ee9f9 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -126,6 +126,7 @@ #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/error_thrower.h" +#include "shell/common/gin_helper/locker.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/gin_helper/promise.h" #include "shell/common/language_util.h" diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 20c96abdd1..6c38316350 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -23,6 +23,7 @@ #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" // nogncheck #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" #include "content/common/frame.mojom.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/javascript_dialog_manager.h" #include "content/public/browser/render_widget_host.h" diff --git a/shell/browser/electron_crypto_module_delegate_nss.cc b/shell/browser/electron_crypto_module_delegate_nss.cc index 48fd9f1fc7..6d9b55daaa 100644 --- a/shell/browser/electron_crypto_module_delegate_nss.cc +++ b/shell/browser/electron_crypto_module_delegate_nss.cc @@ -4,6 +4,7 @@ #include "shell/browser/electron_crypto_module_delegate_nss.h" +#include "content/public/browser/browser_thread.h" #include "crypto/nss_crypto_module_delegate.h" #include "shell/browser/api/electron_api_app.h" #include "shell/browser/javascript_environment.h" diff --git a/shell/browser/serial/serial_chooser_controller.cc b/shell/browser/serial/serial_chooser_controller.cc index d0f8945afc..fe93fb8112 100644 --- a/shell/browser/serial/serial_chooser_controller.cc +++ b/shell/browser/serial/serial_chooser_controller.cc @@ -7,6 +7,7 @@ #include <algorithm> #include <utility> +#include "base/containers/contains.h" #include "base/functional/bind.h" #include "base/strings/stringprintf.h" #include "content/public/browser/web_contents.h" diff --git a/shell/browser/ui/devtools_manager_delegate.cc b/shell/browser/ui/devtools_manager_delegate.cc index e62729171b..2d4547aeca 100644 --- a/shell/browser/ui/devtools_manager_delegate.cc +++ b/shell/browser/ui/devtools_manager_delegate.cc @@ -12,6 +12,7 @@ #include "base/functional/bind.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/devtools_frontend_host.h" #include "content/public/browser/devtools_socket_factory.h" diff --git a/shell/common/api/electron_api_clipboard.cc b/shell/common/api/electron_api_clipboard.cc index f4a20cc45e..f8c2a84edd 100644 --- a/shell/common/api/electron_api_clipboard.cc +++ b/shell/common/api/electron_api_clipboard.cc @@ -13,6 +13,7 @@ #include "shell/common/gin_converters/image_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/node_includes.h" +#include "shell/common/process_util.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/clipboard/clipboard_format_type.h" #include "ui/base/clipboard/file_info.h" diff --git a/shell/common/api/electron_bindings.cc b/shell/common/api/electron_bindings.cc index acae6ba083..487bab7e35 100644 --- a/shell/common/api/electron_bindings.cc +++ b/shell/common/api/electron_bindings.cc @@ -20,6 +20,7 @@ #include "shell/common/application_info.h" #include "shell/common/gin_converters/file_path_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/locker.h" #include "shell/common/gin_helper/microtasks_scope.h" #include "shell/common/gin_helper/promise.h" #include "shell/common/heap_snapshot.h" diff --git a/shell/common/gin_helper/promise.cc b/shell/common/gin_helper/promise.cc index bd162c426e..17da3f4bb3 100644 --- a/shell/common/gin_helper/promise.cc +++ b/shell/common/gin_helper/promise.cc @@ -2,13 +2,27 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. +#include <string> #include <string_view> +#include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/browser_thread.h" +#include "shell/common/gin_helper/microtasks_scope.h" #include "shell/common/gin_helper/promise.h" +#include "shell/common/process_util.h" #include "v8/include/v8-context.h" namespace gin_helper { +PromiseBase::SettleScope::SettleScope(const PromiseBase& base) + : handle_scope_{base.isolate()}, + context_{base.GetContext()}, + microtasks_scope_{base.isolate(), context_->GetMicrotaskQueue(), false, + v8::MicrotasksScope::kRunMicrotasks}, + context_scope_{context_} {} + +PromiseBase::SettleScope::~SettleScope() = default; + PromiseBase::PromiseBase(v8::Isolate* isolate) : PromiseBase(isolate, v8::Promise::Resolver::New(isolate->GetCurrentContext()) @@ -28,40 +42,30 @@ PromiseBase::~PromiseBase() = default; PromiseBase& PromiseBase::operator=(PromiseBase&&) = default; -v8::Maybe<bool> PromiseBase::Reject() { - v8::HandleScope handle_scope(isolate()); - v8::Local<v8::Context> context = GetContext(); - gin_helper::MicrotasksScope microtasks_scope{ - isolate(), context->GetMicrotaskQueue(), false, - v8::MicrotasksScope::kRunMicrotasks}; - v8::Context::Scope context_scope(context); - - return GetInner()->Reject(context, v8::Undefined(isolate())); +// static +scoped_refptr<base::TaskRunner> PromiseBase::GetTaskRunner() { + if (electron::IsBrowserProcess() && + !content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { + return content::GetUIThreadTaskRunner({}); + } + return {}; } v8::Maybe<bool> PromiseBase::Reject(v8::Local<v8::Value> except) { - v8::HandleScope handle_scope(isolate()); - v8::Local<v8::Context> context = GetContext(); - gin_helper::MicrotasksScope microtasks_scope{ - isolate(), context->GetMicrotaskQueue(), false, - v8::MicrotasksScope::kRunMicrotasks}; - v8::Context::Scope context_scope(context); - - return GetInner()->Reject(context, except); + SettleScope settle_scope{*this}; + return GetInner()->Reject(settle_scope.context_, except); } -v8::Maybe<bool> PromiseBase::RejectWithErrorMessage( - const std::string_view message) { - v8::HandleScope handle_scope(isolate()); - v8::Local<v8::Context> context = GetContext(); - gin_helper::MicrotasksScope microtasks_scope{ - isolate(), context->GetMicrotaskQueue(), false, - v8::MicrotasksScope::kRunMicrotasks}; - v8::Context::Scope context_scope(context); - - v8::Local<v8::Value> error = - v8::Exception::Error(gin::StringToV8(isolate(), message)); - return GetInner()->Reject(context, (error)); +v8::Maybe<bool> PromiseBase::Reject() { + SettleScope settle_scope{*this}; + return GetInner()->Reject(settle_scope.context_, v8::Undefined(isolate())); +} + +v8::Maybe<bool> PromiseBase::RejectWithErrorMessage(std::string_view errmsg) { + SettleScope settle_scope{*this}; + return GetInner()->Reject( + settle_scope.context_, + v8::Exception::Error(gin::StringToV8(isolate(), errmsg))); } v8::Local<v8::Context> PromiseBase::GetContext() const { @@ -76,11 +80,28 @@ v8::Local<v8::Promise::Resolver> PromiseBase::GetInner() const { return resolver_.Get(isolate()); } +// static +void PromiseBase::RejectPromise(PromiseBase&& promise, + std::string_view errmsg) { + if (auto task_runner = GetTaskRunner()) { + task_runner->PostTask( + FROM_HERE, base::BindOnce( + // Note that this callback can not take std::string_view, + // as StringPiece only references string internally and + // will blow when a temporary string is passed. + [](PromiseBase&& promise, std::string str) { + promise.RejectWithErrorMessage(str); + }, + std::move(promise), std::string{errmsg})); + } else { + promise.RejectWithErrorMessage(errmsg); + } +} + // static void Promise<void>::ResolvePromise(Promise<void> promise) { - if (electron::IsBrowserProcess() && - !content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { - content::GetUIThreadTaskRunner({})->PostTask( + if (auto task_runner = GetTaskRunner()) { + task_runner->PostTask( FROM_HERE, base::BindOnce([](Promise<void> promise) { promise.Resolve(); }, std::move(promise))); @@ -97,14 +118,8 @@ v8::Local<v8::Promise> Promise<void>::ResolvedPromise(v8::Isolate* isolate) { } v8::Maybe<bool> Promise<void>::Resolve() { - v8::HandleScope handle_scope(isolate()); - v8::Local<v8::Context> context = GetContext(); - gin_helper::MicrotasksScope microtasks_scope{ - isolate(), context->GetMicrotaskQueue(), false, - v8::MicrotasksScope::kRunMicrotasks}; - v8::Context::Scope context_scope(context); - - return GetInner()->Resolve(context, v8::Undefined(isolate())); + SettleScope settle_scope{*this}; + return GetInner()->Resolve(settle_scope.context_, v8::Undefined(isolate())); } } // namespace gin_helper diff --git a/shell/common/gin_helper/promise.h b/shell/common/gin_helper/promise.h index e220bd6291..1fc1832f01 100644 --- a/shell/common/gin_helper/promise.h +++ b/shell/common/gin_helper/promise.h @@ -12,12 +12,10 @@ #include <utility> #include "base/memory/raw_ptr.h" -#include "content/public/browser/browser_task_traits.h" -#include "content/public/browser/browser_thread.h" +#include "base/memory/scoped_refptr.h" +#include "base/task/task_runner.h" #include "shell/common/gin_converters/std_converter.h" -#include "shell/common/gin_helper/locker.h" #include "shell/common/gin_helper/microtasks_scope.h" -#include "shell/common/process_util.h" #include "v8/include/v8-context.h" namespace gin_helper { @@ -45,27 +43,7 @@ class PromiseBase { PromiseBase& operator=(PromiseBase&&); // Helper for rejecting promise with error message. - // - // Note: The parameter type is PromiseBase&& so it can take the instances of - // Promise<T> type. - static void RejectPromise(PromiseBase&& promise, - const std::string_view errmsg) { - if (electron::IsBrowserProcess() && - !content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, - base::BindOnce( - // Note that this callback can not take std::string_view, - // as StringPiece only references string internally and - // will blow when a temporary string is passed. - [](PromiseBase&& promise, std::string str) { - promise.RejectWithErrorMessage(str); - }, - std::move(promise), std::string{errmsg})); - } else { - promise.RejectWithErrorMessage(errmsg); - } - } + static void RejectPromise(PromiseBase&& promise, std::string_view errmsg); v8::Maybe<bool> Reject(); v8::Maybe<bool> Reject(v8::Local<v8::Value> except); @@ -77,8 +55,20 @@ class PromiseBase { v8::Isolate* isolate() const { return isolate_; } protected: + struct SettleScope { + explicit SettleScope(const PromiseBase& base); + ~SettleScope(); + + v8::HandleScope handle_scope_; + v8::Local<v8::Context> context_; + gin_helper::MicrotasksScope microtasks_scope_; + v8::Context::Scope context_scope_; + }; + v8::Local<v8::Promise::Resolver> GetInner() const; + static scoped_refptr<base::TaskRunner> GetTaskRunner(); + private: raw_ptr<v8::Isolate> isolate_; v8::Global<v8::Context> context_; @@ -93,9 +83,8 @@ class Promise : public PromiseBase { // Helper for resolving the promise with |result|. static void ResolvePromise(Promise<RT> promise, RT result) { - if (electron::IsBrowserProcess() && - !content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) { - content::GetUIThreadTaskRunner({})->PostTask( + if (auto task_runner = GetTaskRunner()) { + task_runner->PostTask( FROM_HERE, base::BindOnce([](Promise<RT> promise, RT result) { promise.Resolve(result); }, std::move(promise), std::move(result))); @@ -115,21 +104,13 @@ class Promise : public PromiseBase { // Convert to another type. template <typename NT> Promise<NT> As() { - return Promise<NT>(isolate(), GetInner()); + return Promise<NT>{isolate(), GetInner()}; } - // Promise resolution is a microtask - // We use the MicrotasksRunner to trigger the running of pending microtasks v8::Maybe<bool> Resolve(const RT& value) { - gin_helper::Locker locker(isolate()); - v8::HandleScope handle_scope(isolate()); - v8::Local<v8::Context> context = GetContext(); - gin_helper::MicrotasksScope microtasks_scope{ - isolate(), context->GetMicrotaskQueue(), false, - v8::MicrotasksScope::kRunMicrotasks}; - v8::Context::Scope context_scope(context); - - return GetInner()->Resolve(context, gin::ConvertToV8(isolate(), value)); + SettleScope settle_scope{*this}; + return GetInner()->Resolve(settle_scope.context_, + gin::ConvertToV8(isolate(), value)); } template <typename... ResolveType> @@ -142,15 +123,10 @@ class Promise : public PromiseBase { std::is_same<RT, std::tuple_element_t<0, std::tuple<ResolveType...>>>(), "A promises's 'Then' callback must handle the same type as the " "promises resolve type"); - gin_helper::Locker locker(isolate()); - v8::HandleScope handle_scope(isolate()); - v8::Local<v8::Context> context = GetContext(); - v8::Context::Scope context_scope(context); - + SettleScope settle_scope{*this}; v8::Local<v8::Value> value = gin::ConvertToV8(isolate(), std::move(cb)); v8::Local<v8::Function> handler = value.As<v8::Function>(); - - return GetHandle()->Then(context, handler); + return GetHandle()->Then(settle_scope.context_, handler); } }; diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index fd77be2990..1f5944a50c 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -37,6 +37,7 @@ #include "shell/common/mac/main_application_bundle.h" #include "shell/common/node_includes.h" #include "shell/common/node_util.h" +#include "shell/common/process_util.h" #include "shell/common/world_ids.h" #include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/renderer/bindings/core/v8/v8_initializer.h" // nogncheck
refactor
493e3c4537bfa70405a2da998503e82594eada14
Charles Kerr
2024-12-02 10:13:38
fix: don't use deprecated ui::MouseEvent constructor (#44868) * refactor: do not use deprecated gfx::Point constructor for MouseEvent Deprecated in https://chromium-review.googlesource.com/c/1444251 * refactor: use WebInputEvent::GetTypeAsUiEventType() instead of rolling our own Added in https://chromium-review.googlesource.com/c/chromium/src/+/2180291
diff --git a/shell/browser/osr/osr_render_widget_host_view.cc b/shell/browser/osr/osr_render_widget_host_view.cc index dbddfe3e96..525c3e48f6 100644 --- a/shell/browser/osr/osr_render_widget_host_view.cc +++ b/shell/browser/osr/osr_render_widget_host_view.cc @@ -56,31 +56,6 @@ namespace { const float kDefaultScaleFactor = 1.0; ui::MouseEvent UiMouseEventFromWebMouseEvent(blink::WebMouseEvent event) { - ui::EventType type = ui::EventType::kUnknown; - switch (event.GetType()) { - case blink::WebInputEvent::Type::kMouseDown: - type = ui::EventType::kMousePressed; - break; - case blink::WebInputEvent::Type::kMouseUp: - type = ui::EventType::kMouseReleased; - break; - case blink::WebInputEvent::Type::kMouseMove: - type = ui::EventType::kMouseMoved; - break; - case blink::WebInputEvent::Type::kMouseEnter: - type = ui::EventType::kMouseEntered; - break; - case blink::WebInputEvent::Type::kMouseLeave: - type = ui::EventType::kMouseExited; - break; - case blink::WebInputEvent::Type::kMouseWheel: - type = ui::EventType::kMousewheel; - break; - default: - type = ui::EventType::kUnknown; - break; - } - int button_flags = 0; switch (event.button) { case blink::WebMouseEvent::Button::kBack: @@ -103,12 +78,12 @@ ui::MouseEvent UiMouseEventFromWebMouseEvent(blink::WebMouseEvent event) { break; } - ui::MouseEvent ui_event(type, - gfx::Point(std::floor(event.PositionInWidget().x()), - std::floor(event.PositionInWidget().y())), - gfx::Point(std::floor(event.PositionInWidget().x()), - std::floor(event.PositionInWidget().y())), - ui::EventTimeForNow(), button_flags, button_flags); + ui::MouseEvent ui_event{event.GetTypeAsUiEventType(), + event.PositionInWidget(), + event.PositionInWidget(), + ui::EventTimeForNow(), + button_flags, + button_flags}; ui_event.SetClickCount(event.click_count); return ui_event;
fix
5bff883c40444ccb3a7f1b2bc94759a395bed32c
Shelley Vohr
2024-07-05 09:44:34
chore: clean up outdated goma references (#42762)
diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 757faacae9..95afdbd281 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -445,7 +445,7 @@ step-mksnapshot-build: &step-mksnapshot-build fi sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args - sed $SEDOPTION '/The gn arg use_goma=true .*/d' out/Default/mksnapshot_args + if [ "`uname`" != "Darwin" ]; then if [ "$TARGET_ARCH" == "arm" ]; then electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 255596b6b1..9cfac35885 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -25,9 +25,19 @@ Codespaces doesn't lean very well into gclient based checkouts, the directory st /workspaces/electron ``` -## Goma +## Reclient -If you are a maintainer [with Goma access](../docs/development/goma.md) it should be automatically configured and authenticated when you spin up a new codespaces instance. You can validate this by checking `e d goma_auth info` or by checking that your build-tools configuration has a goma mode of `cluster`. +If you are a maintainer [with Reclient access](../docs/development/reclient.md) you'll need to ensure you're authenticated when you spin up a new codespaces instance. You can validate this by checking `e d rbe info` - your build-tools configuration should have `Access` type `Cache & Execute`: + +```console +Authentication Status: Authenticated +Since: 2024-05-28 10:29:33 +0200 CEST +Expires: 2024-08-26 10:29:33 +0200 CEST +... +Access: Cache & Execute +``` + +To authenticate if you're not logged in, run `e d rbe login` and follow the link to authenticate. ## Running Electron diff --git a/.devcontainer/on-create-command.sh b/.devcontainer/on-create-command.sh index e168a5f0a5..b6a9318d97 100755 --- a/.devcontainer/on-create-command.sh +++ b/.devcontainer/on-create-command.sh @@ -59,7 +59,6 @@ if [ ! -f $buildtools/configs/evm.testing.json ]; then \"\$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\", \"configValidationLevel\": \"strict\", \"reclient\": \"$1\", - \"goma\": \"none\", \"preserveXcode\": 5 } " >$buildtools/configs/evm.testing.json diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 622cf6d901..dcf24aec4c 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -90,7 +90,6 @@ runs: fi sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args - sed $SEDOPTION '/The gn arg use_goma=true .*/d' out/Default/mksnapshot_args if [ "`uname`" = "Linux" ]; then if [ "${{ inputs.target-arch }}" = "arm" ]; then diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 0b525168a3..07d24afc1c 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -149,7 +149,7 @@ for: - gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args # Remove unused args from mksnapshot_args - ps: >- - Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') -And -not $_.Contains('The gn arg use_goma=true') } | Set-Content out/Default/mksnapshot_args + Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') } | Set-Content out/Default/mksnapshot_args - autoninja -C out/Default electron:electron_mksnapshot_zip - cd out\Default - 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S diff --git a/appveyor.yml b/appveyor.yml index 7f969ca1db..f288f28331 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -147,7 +147,7 @@ for: - gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args # Remove unused args from mksnapshot_args - ps: >- - Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') -And -not $_.Contains('The gn arg use_goma=true') } | Set-Content out/Default/mksnapshot_args + Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') } | Set-Content out/Default/mksnapshot_args - autoninja -C out/Default electron:electron_mksnapshot_zip - cd out\Default - 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S diff --git a/docs/development/goma.md b/docs/development/goma.md deleted file mode 100644 index 21d6ed93ce..0000000000 --- a/docs/development/goma.md +++ /dev/null @@ -1,6 +0,0 @@ -# Goma - -> Goma is a distributed compiler service for open-source projects such as -> Chromium and Android. - -Electron's deployment of Goma is deprecated and we are gradually shifting all usage to the [reclient](reclient.md) system. At some point in 2024 the Goma backend will be shutdown.
chore
4701795dc0f59f03970a3f2622058faf0020f3c1
Keeley Hammond
2024-06-13 16:36:45
build: fix datetime module for Linux Publish (#42489)
diff --git a/script/release/uploaders/upload.py b/script/release/uploaders/upload.py index cb6c788941..c431d1cc37 100755 --- a/script/release/uploaders/upload.py +++ b/script/release/uploaders/upload.py @@ -48,7 +48,7 @@ def main(): if args.verbose: enable_verbose_mode() if args.upload_to_storage: - utcnow = datetime.datetime.now(datetime.UTC) + utcnow = datetime.datetime.utcnow() args.upload_timestamp = utcnow.strftime('%Y%m%d') build_version = get_electron_build_version()
build
1036d824fe719a37517888c7249e8b7e271e8376
John Kleinschmidt
2024-03-21 14:07:18
ci: use CircleCI hosted macOS arm64 runners for testing (#41649)
diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index fc60394dc8..6c5b4e3434 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -75,10 +75,6 @@ executors: resource_class: << parameters.size >> # Electron Runners - apple-silicon: - resource_class: electronjs/macos-arm64 - machine: true - linux-arm: resource_class: electronjs/aks-linux-arm-test docker: @@ -2298,8 +2294,10 @@ jobs: - electron-tests: artifact-key: darwin-x64 - darwin-testing-arm64-tests: - executor: apple-silicon + darwin-testing-arm64-tests: + executor: + name: macos + size: macos.m1.medium.gen1 environment: <<: *env-mac-large <<: *env-stack-dumping @@ -2323,7 +2321,9 @@ jobs: artifact-key: mas-x64 mas-testing-arm64-tests: - executor: apple-silicon + executor: + name: macos + size: macos.m1.medium.gen1 environment: <<: *env-mac-large <<: *env-stack-dumping diff --git a/spec/api-app-spec.ts b/spec/api-app-spec.ts index 30531b8745..3d8334a0e7 100644 --- a/spec/api-app-spec.ts +++ b/spec/api-app-spec.ts @@ -760,7 +760,8 @@ describe('app module', () => { }).to.throw(/'name' is required when type is not mainAppService/); }); - ifit(isVenturaOrHigher)('throws when getting non-default type with no name', () => { + // TODO this test does not work on CircleCI arm64 macs + ifit(isVenturaOrHigher && process.arch !== 'arm64')('throws when getting non-default type with no name', () => { expect(() => { app.getLoginItemSettings({ type: 'daemonService' diff --git a/spec/api-media-handler-spec.ts b/spec/api-media-handler-spec.ts index fe1334adfa..5b4b4aece2 100644 --- a/spec/api-media-handler-spec.ts +++ b/spec/api-media-handler-spec.ts @@ -25,9 +25,7 @@ describe('setDisplayMediaRequestHandler', () => { // error message: // [ERROR:video_capture_device_client.cc(659)] error@ OnStart@content/browser/media/capture/desktop_capture_device_mac.cc:98, CGDisplayStreamCreate failed, OS message: Value too large to be stored in data type (84) // This is possibly related to the OS/VM setup that CircleCI uses for macOS. - // Our arm64 runners are in @jkleinsc's office, and are real machines, so the - // test works there. - ifit(!(process.platform === 'darwin' && process.arch === 'x64'))('works when calling getDisplayMedia', async function () { + ifit(process.platform !== 'darwin')('works when calling getDisplayMedia', async function () { if ((await desktopCapturer.getSources({ types: ['screen'] })).length === 0) { return this.skip(); } @@ -306,7 +304,7 @@ describe('setDisplayMediaRequestHandler', () => { expect(ok).to.be.true(message); }); - ifit(!(process.platform === 'darwin' && process.arch === 'x64'))('can supply a screen response to preferCurrentTab', async () => { + ifit(process.platform !== 'darwin')('can supply a screen response to preferCurrentTab', async () => { const ses = session.fromPartition('' + Math.random()); let requestHandlerCalled = false; ses.setDisplayMediaRequestHandler(async (request, callback) => { diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index 17ed36292e..e61b5df75b 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -2511,18 +2511,18 @@ describe('webContents module', () => { it('emits when moveTo is called', async () => { const w = new BrowserWindow({ show: false }); w.loadURL('about:blank'); - w.webContents.executeJavaScript('window.moveTo(100, 100)', true); + w.webContents.executeJavaScript('window.moveTo(50, 50)', true); const [, rect] = await once(w.webContents, 'content-bounds-updated') as [any, Electron.Rectangle]; const { width, height } = w.getBounds(); expect(rect).to.deep.equal({ - x: 100, - y: 100, + x: 50, + y: 50, width, height }); await new Promise(setImmediate); - expect(w.getBounds().x).to.equal(100); - expect(w.getBounds().y).to.equal(100); + expect(w.getBounds().x).to.equal(50); + expect(w.getBounds().y).to.equal(50); }); it('emits when resizeTo is called', async () => {
ci
6e4d90fcdbfff7eb1d445edf6ad7312c2fc7ded0
Shelley Vohr
2024-08-23 17:02:05
fix: ensure bounds stability in `OnWidgetBoundsChanged` (#43431) * fix: ensure bounds stability in OnWidgetBoundsChanged * Update shell/browser/native_window_views.cc Co-authored-by: Charles Kerr <[email protected]> --------- Co-authored-by: Charles Kerr <[email protected]>
diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index f7061d25c5..5a0fb64834 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -22,6 +22,7 @@ #include "base/containers/contains.h" #include "base/memory/raw_ref.h" +#include "base/numerics/ranges.h" #include "base/strings/utf_string_conversions.h" #include "content/public/browser/desktop_media_id.h" #include "content/public/common/color_parser.h" @@ -1637,10 +1638,18 @@ void NativeWindowViews::OnWidgetBoundsChanged(views::Widget* changed_widget, if (changed_widget != widget()) return; - // Note: We intentionally use `GetBounds()` instead of `bounds` to properly - // handle minimized windows on Windows. + // |GetWindowBoundsInScreen| has a ~1 pixel margin of error, so if we check + // existing bounds directly against the new bounds without accounting for that + // we'll have constant false positives when the window is moving but the user + // hasn't changed its size at all. + auto areWithinOnePixel = [](gfx::Size old_size, gfx::Size new_size) -> bool { + return base::IsApproximatelyEqual(old_size.width(), new_size.width(), 1) && + base::IsApproximatelyEqual(old_size.height(), new_size.height(), 1); + }; + + // We use |GetBounds| to account for minimized windows on Windows. const auto new_bounds = GetBounds(); - if (widget_size_ != new_bounds.size()) { + if (!areWithinOnePixel(widget_size_, new_bounds.size())) { NotifyWindowResize(); widget_size_ = new_bounds.size(); }
fix
5310b79ffb40f840dd881fb8446b16a2f345322c
Shelley Vohr
2024-04-29 11:28:24
fix: `setTitleBarOverlay` should be implemented on `BaseWindow` (#41960) fix: setTitleBarOverlay should be implemented on BaseWindow
diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index d8c1f8063f..108dec8b2d 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -11,6 +11,7 @@ #include "base/containers/contains.h" #include "base/task/single_thread_task_runner.h" +#include "content/public/common/color_parser.h" #include "electron/buildflags/buildflags.h" #include "gin/dictionary.h" #include "shell/browser/api/electron_api_menu.h" @@ -36,6 +37,7 @@ #endif #if BUILDFLAG(IS_WIN) +#include "shell/browser/ui/views/win_frame_view.h" #include "shell/browser/ui/win/taskbar_host.h" #include "ui/base/win/shell.h" #endif @@ -1039,6 +1041,63 @@ void BaseWindow::SetAppDetails(const gin_helper::Dictionary& options) { relaunch_command, relaunch_display_name, window_->GetAcceleratedWidget()); } + +void BaseWindow::SetTitleBarOverlay(const gin_helper::Dictionary& options, + gin_helper::Arguments* args) { + // Ensure WCO is already enabled on this window + if (!window_->titlebar_overlay_enabled()) { + args->ThrowError("Titlebar overlay is not enabled"); + return; + } + + auto* window = static_cast<NativeWindowViews*>(window_.get()); + bool updated = false; + + // Check and update the button color + std::string btn_color; + if (options.Get(options::kOverlayButtonColor, &btn_color)) { + // Parse the string as a CSS color + SkColor color; + if (!content::ParseCssColorString(btn_color, &color)) { + args->ThrowError("Could not parse color as CSS color"); + return; + } + + // Update the view + window->set_overlay_button_color(color); + updated = true; + } + + // Check and update the symbol color + std::string symbol_color; + if (options.Get(options::kOverlaySymbolColor, &symbol_color)) { + // Parse the string as a CSS color + SkColor color; + if (!content::ParseCssColorString(symbol_color, &color)) { + args->ThrowError("Could not parse symbol color as CSS color"); + return; + } + + // Update the view + window->set_overlay_symbol_color(color); + updated = true; + } + + // Check and update the height + int height = 0; + if (options.Get(options::kOverlayHeight, &height)) { + window->set_titlebar_overlay_height(height); + updated = true; + } + + // If anything was updated, invalidate the layout and schedule a paint of the + // window's frame view + if (updated) { + auto* frame_view = static_cast<WinFrameView*>( + window->widget()->non_client_view()->frame_view()); + frame_view->InvalidateCaptionButtons(); + } +} #endif int32_t BaseWindow::GetID() const { @@ -1227,6 +1286,7 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate, .SetMethod("setThumbnailClip", &BaseWindow::SetThumbnailClip) .SetMethod("setThumbnailToolTip", &BaseWindow::SetThumbnailToolTip) .SetMethod("setAppDetails", &BaseWindow::SetAppDetails) + .SetMethod("setTitleBarOverlay", &BaseWindow::SetTitleBarOverlay) #endif .SetProperty("id", &BaseWindow::GetID); } diff --git a/shell/browser/api/electron_api_base_window.h b/shell/browser/api/electron_api_base_window.h index 7bff94b776..46043f284f 100644 --- a/shell/browser/api/electron_api_base_window.h +++ b/shell/browser/api/electron_api_base_window.h @@ -241,6 +241,8 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>, bool SetThumbnailClip(const gfx::Rect& region); bool SetThumbnailToolTip(const std::string& tooltip); void SetAppDetails(const gin_helper::Dictionary& options); + void SetTitleBarOverlay(const gin_helper::Dictionary& options, + gin_helper::Arguments* args); #endif int32_t GetID() const; diff --git a/shell/browser/api/electron_api_browser_window.cc b/shell/browser/api/electron_api_browser_window.cc index 234dedb643..b1ea0974bf 100644 --- a/shell/browser/api/electron_api_browser_window.cc +++ b/shell/browser/api/electron_api_browser_window.cc @@ -10,7 +10,6 @@ #include "content/browser/web_contents/web_contents_impl.h" // nogncheck #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" -#include "content/public/common/color_parser.h" #include "shell/browser/api/electron_api_web_contents_view.h" #include "shell/browser/browser.h" #include "shell/browser/web_contents_preferences.h" @@ -27,10 +26,6 @@ #include "shell/browser/native_window_views.h" #endif -#if BUILDFLAG(IS_WIN) -#include "shell/browser/ui/views/win_frame_view.h" -#endif - namespace electron::api { BrowserWindow::BrowserWindow(gin::Arguments* args, @@ -275,65 +270,6 @@ v8::Local<v8::Value> BrowserWindow::GetWebContents(v8::Isolate* isolate) { return v8::Local<v8::Value>::New(isolate, web_contents_); } -#if BUILDFLAG(IS_WIN) -void BrowserWindow::SetTitleBarOverlay(const gin_helper::Dictionary& options, - gin_helper::Arguments* args) { - // Ensure WCO is already enabled on this window - if (!window_->titlebar_overlay_enabled()) { - args->ThrowError("Titlebar overlay is not enabled"); - return; - } - - auto* window = static_cast<NativeWindowViews*>(window_.get()); - bool updated = false; - - // Check and update the button color - std::string btn_color; - if (options.Get(options::kOverlayButtonColor, &btn_color)) { - // Parse the string as a CSS color - SkColor color; - if (!content::ParseCssColorString(btn_color, &color)) { - args->ThrowError("Could not parse color as CSS color"); - return; - } - - // Update the view - window->set_overlay_button_color(color); - updated = true; - } - - // Check and update the symbol color - std::string symbol_color; - if (options.Get(options::kOverlaySymbolColor, &symbol_color)) { - // Parse the string as a CSS color - SkColor color; - if (!content::ParseCssColorString(symbol_color, &color)) { - args->ThrowError("Could not parse symbol color as CSS color"); - return; - } - - // Update the view - window->set_overlay_symbol_color(color); - updated = true; - } - - // Check and update the height - int height = 0; - if (options.Get(options::kOverlayHeight, &height)) { - window->set_titlebar_overlay_height(height); - updated = true; - } - - // If anything was updated, invalidate the layout and schedule a paint of the - // window's frame view - if (updated) { - auto* frame_view = static_cast<WinFrameView*>( - window->widget()->non_client_view()->frame_view()); - frame_view->InvalidateCaptionButtons(); - } -} -#endif - void BrowserWindow::OnWindowShow() { web_contents()->WasShown(); BaseWindow::OnWindowShow(); @@ -373,9 +309,6 @@ void BrowserWindow::BuildPrototype(v8::Isolate* isolate, .SetMethod("focusOnWebView", &BrowserWindow::FocusOnWebView) .SetMethod("blurWebView", &BrowserWindow::BlurWebView) .SetMethod("isWebViewFocused", &BrowserWindow::IsWebViewFocused) -#if BUILDFLAG(IS_WIN) - .SetMethod("setTitleBarOverlay", &BrowserWindow::SetTitleBarOverlay) -#endif .SetProperty("webContents", &BrowserWindow::GetWebContents); } diff --git a/shell/browser/api/electron_api_browser_window.h b/shell/browser/api/electron_api_browser_window.h index c9de1334a4..e752d1ed59 100644 --- a/shell/browser/api/electron_api_browser_window.h +++ b/shell/browser/api/electron_api_browser_window.h @@ -73,10 +73,6 @@ class BrowserWindow : public BaseWindow, void BlurWebView(); bool IsWebViewFocused(); v8::Local<v8::Value> GetWebContents(v8::Isolate* isolate); -#if BUILDFLAG(IS_WIN) - void SetTitleBarOverlay(const gin_helper::Dictionary& options, - gin_helper::Arguments* args); -#endif private: // Helpers.
fix
03a3deca181807c2b152264a11f92c70b7adc9ef
Michaela Laurencin
2024-01-18 16:57:49
ci: add stale-exempt label to exempt issues from automation (#41031)
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d932674aee..a0102ad488 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -27,7 +27,7 @@ jobs: This issue has been automatically marked as stale. **If this issue is still affecting you, please leave any comment** (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the [latest version of Electron](https://www.electronjs.org/releases/stable) or in the [beta](https://www.electronjs.org/releases/beta)—please include it with your comment! close-issue-message: > This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue. - exempt-issue-labels: "discussion,security \U0001F512,enhancement :sparkles:,status/confirmed" + exempt-issue-labels: "discussion,security \U0001F512,enhancement :sparkles:,status/confirmed,stale-exempt" only-pr-labels: not-a-real-label pending-repro: runs-on: ubuntu-latest
ci
2f4a46f47a4d284ed2748c539bfaf10482908713
Shelley Vohr
2024-07-08 10:11:40
fix: video and audio capture should be separate (#42775)
diff --git a/shell/browser/web_contents_permission_helper.cc b/shell/browser/web_contents_permission_helper.cc index 2a9c4d347d..f80f9fb239 100644 --- a/shell/browser/web_contents_permission_helper.cc +++ b/shell/browser/web_contents_permission_helper.cc @@ -282,10 +282,10 @@ bool WebContentsPermissionHelper::CheckMediaAccessPermission( base::Value::Dict details; details.Set("securityOrigin", security_origin.GetURL().spec()); details.Set("mediaType", MediaStreamTypeToString(type)); - // The permission type doesn't matter here, AUDIO_CAPTURE/VIDEO_CAPTURE - // are presented as same type in content_converter.h. - return CheckPermission(blink::PermissionType::AUDIO_CAPTURE, - std::move(details)); + auto blink_type = type == blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE + ? blink::PermissionType::AUDIO_CAPTURE + : blink::PermissionType::VIDEO_CAPTURE; + return CheckPermission(blink_type, std::move(details)); } bool WebContentsPermissionHelper::CheckSerialAccessPermission( diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index 238480364c..bb28c80181 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -1770,7 +1770,7 @@ describe('chromium features', () => { expect(labels.some((l: any) => l)).to.be.true(); }); - it('does not return labels of enumerated devices when permission denied', async () => { + it('does not return labels of enumerated devices when all permission denied', async () => { session.defaultSession.setPermissionCheckHandler(() => false); const w = new BrowserWindow({ show: false }); w.loadFile(path.join(fixturesPath, 'pages', 'blank.html')); @@ -1778,6 +1778,40 @@ describe('chromium features', () => { expect(labels.some((l: any) => l)).to.be.false(); }); + it('does not return labels of enumerated audio devices when permission denied', async () => { + session.defaultSession.setPermissionCheckHandler((wc, permission, origin, { mediaType }) => { + return permission !== 'media' || mediaType !== 'audio'; + }); + const w = new BrowserWindow({ show: false }); + w.loadFile(path.join(fixturesPath, 'pages', 'blank.html')); + const devices = await w.webContents.executeJavaScript( + `navigator.mediaDevices.enumerateDevices().then(ds => ds.map(d => { + return ({ label: d.label, kind: d.kind }) + })); + `); + const audioDevices = devices.filter((d: any) => d.kind === 'audioinput'); + expect(audioDevices.some((d: any) => d.label)).to.be.false(); + const videoDevices = devices.filter((d: any) => d.kind === 'videoinput'); + expect(videoDevices.some((d: any) => d.label)).to.be.true(); + }); + + it('does not return labels of enumerated video devices when permission denied', async () => { + session.defaultSession.setPermissionCheckHandler((wc, permission, origin, { mediaType }) => { + return permission !== 'media' || mediaType !== 'video'; + }); + const w = new BrowserWindow({ show: false }); + w.loadFile(path.join(fixturesPath, 'pages', 'blank.html')); + const devices = await w.webContents.executeJavaScript( + `navigator.mediaDevices.enumerateDevices().then(ds => ds.map(d => { + return ({ label: d.label, kind: d.kind }) + })); + `); + const audioDevices = devices.filter((d: any) => d.kind === 'audioinput'); + expect(audioDevices.some((d: any) => d.label)).to.be.true(); + const videoDevices = devices.filter((d: any) => d.kind === 'videoinput'); + expect(videoDevices.some((d: any) => d.label)).to.be.false(); + }); + it('returns the same device ids across reloads', async () => { const ses = session.fromPartition('persist:media-device-id'); const w = new BrowserWindow({
fix
c857c9b7e2575769a26769dfa32e967a3da26e99
Shelley Vohr
2023-04-17 10:45:40
docs: add note to `win.setFullScreen(flag)` (#37921) docs: add note to win.setFullScreen(flag)
diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 5c87398106..2b47cd13ca 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -992,6 +992,8 @@ Returns `boolean` - Whether the window is minimized. Sets whether the window should be in fullscreen mode. +**Note:** On macOS, fullscreen transitions take place asynchronously. If further actions depend on the fullscreen state, use the ['enter-full-screen'](browser-window.md#event-enter-full-screen) or ['leave-full-screen'](browser-window.md#event-leave-full-screen) events. + #### `win.isFullScreen()` Returns `boolean` - Whether the window is in fullscreen mode.
docs
6786fde576276b8915a4e486ff0c35a3bc1036c0
Shelley Vohr
2024-01-30 16:55:03
docs: `document printToPDF` `generateDocumentOutline` option (#41156) * doc: document printToPDF generateDocumentOutline option * doc: ready event to whenReady
diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 9896d7a1aa..ff5735c52b 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -1614,6 +1614,7 @@ win.webContents.print(options, (success, errorType) => { * `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`. * `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size. * `generateTaggedPDF` boolean (optional) _Experimental_ - Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this property is experimental, the generated PDF may not adhere fully to PDF/UA and WCAG standards. + * `generateDocumentOutline` boolean (optional) _Experimental_ - Whether or not to generate a PDF document outline from content headers. Defaults to false. Returns `Promise<Buffer>` - Resolves with the generated PDF data. @@ -1624,24 +1625,26 @@ The `landscape` will be ignored if `@page` CSS at-rule is used in the web page. An example of `webContents.printToPDF`: ```js -const { BrowserWindow } = require('electron') +const { app, BrowserWindow } = require('electron') const fs = require('node:fs') const path = require('node:path') const os = require('node:os') -const win = new BrowserWindow() -win.loadURL('https://github.com') +app.whenReady().then(() => { + const win = new BrowserWindow() + win.loadURL('https://github.com') -win.webContents.on('did-finish-load', () => { - // Use default printing options - const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf') - win.webContents.printToPDF({}).then(data => { - fs.writeFile(pdfPath, data, (error) => { - if (error) throw error - console.log(`Wrote PDF successfully to ${pdfPath}`) + win.webContents.on('did-finish-load', () => { + // Use default printing options + const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf') + win.webContents.printToPDF({}).then(data => { + fs.writeFile(pdfPath, data, (error) => { + if (error) throw error + console.log(`Wrote PDF successfully to ${pdfPath}`) + }) + }).catch(error => { + console.log(`Failed to write PDF to ${pdfPath}: `, error) }) - }).catch(error => { - console.log(`Failed to write PDF to ${pdfPath}: `, error) }) }) ``` diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index eecd2e86f9..ac049bed19 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -611,6 +611,7 @@ Prints `webview`'s web page. Same as `webContents.print([options])`. * `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`. * `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size. * `generateTaggedPDF` boolean (optional) _Experimental_ - Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this property is experimental, the generated PDF may not adhere fully to PDF/UA and WCAG standards. + * `generateDocumentOutline` boolean (optional) _Experimental_ - Whether or not to generate a PDF document outline from content headers. Defaults to false. Returns `Promise<Uint8Array>` - Resolves with the generated PDF data. diff --git a/lib/browser/api/web-contents.ts b/lib/browser/api/web-contents.ts index 1b04d925b2..2dbd19c927 100644 --- a/lib/browser/api/web-contents.ts +++ b/lib/browser/api/web-contents.ts @@ -235,6 +235,7 @@ WebContents.prototype.printToPDF = async function (options) { pageRanges: checkType(options.pageRanges ?? '', 'string', 'pageRanges'), preferCSSPageSize: checkType(options.preferCSSPageSize ?? false, 'boolean', 'preferCSSPageSize'), generateTaggedPDF: checkType(options.generateTaggedPDF ?? false, 'boolean', 'generateTaggedPDF'), + generateDocumentOutline: checkType(options.generateDocumentOutline ?? false, 'boolean', 'generateDocumentOutline'), ...parsePageSize(options.pageSize ?? 'letter') }; diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index 2119b25cc7..7251a4e9fb 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -2039,7 +2039,9 @@ describe('webContents module', () => { pageRanges: { oops: 'im-not-the-right-key' }, headerTemplate: [1, 2, 3], footerTemplate: [4, 5, 6], - preferCSSPageSize: 'no' + preferCSSPageSize: 'no', + generateTaggedPDF: 'wtf', + generateDocumentOutline: [7, 8, 9] }; await w.loadURL('data:text/html,<h1>Hello, World!</h1>');
docs
6bd9ee6988cb986c3d8a2f01e2a538271f5f2b92
Jeremy Rose
2023-03-02 15:47:45
feat: net.fetch() supports custom protocols (#36606)
diff --git a/docs/api/net.md b/docs/api/net.md index f7e7da6194..a1199150b7 100644 --- a/docs/api/net.md +++ b/docs/api/net.md @@ -101,6 +101,10 @@ Limitations: * The `.type` and `.url` values of the returned `Response` object are incorrect. +Requests made with `net.fetch` can be made to [custom protocols](protocol.md) +as well as `file:`, and will trigger [webRequest](web-request.md) handlers if +present. + ### `net.isOnline()` Returns `boolean` - Whether there is currently internet connection. diff --git a/docs/api/session.md b/docs/api/session.md index 7a15bcc821..9554cb238e 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -768,6 +768,10 @@ Limitations: * The `.type` and `.url` values of the returned `Response` object are incorrect. +Requests made with `ses.fetch` can be made to [custom protocols](protocol.md) +as well as `file:`, and will trigger [webRequest](web-request.md) handlers if +present. + #### `ses.disableNetworkEmulation()` Disables any network emulation already active for the `session`. Resets to diff --git a/lib/browser/api/net-client-request.ts b/lib/browser/api/net-client-request.ts index a6ce4210ff..49476db8c5 100644 --- a/lib/browser/api/net-client-request.ts +++ b/lib/browser/api/net-client-request.ts @@ -10,7 +10,7 @@ const { } = process._linkedBinding('electron_browser_net'); const { Session } = process._linkedBinding('electron_browser_session'); -const kSupportedProtocols = new Set(['http:', 'https:']); +const kHttpProtocols = new Set(['http:', 'https:']); // set of headers that Node.js discards duplicates for // see https://nodejs.org/api/http.html#http_message_headers @@ -195,7 +195,20 @@ class ChunkedBodyStream extends Writable { type RedirectPolicy = 'manual' | 'follow' | 'error'; -function parseOptions (optionsIn: ClientRequestConstructorOptions | string): NodeJS.CreateURLLoaderOptions & { redirectPolicy: RedirectPolicy, headers: Record<string, { name: string, value: string | string[] }> } { +const kAllowNonHttpProtocols = Symbol('kAllowNonHttpProtocols'); +export function allowAnyProtocol (opts: ClientRequestConstructorOptions): ClientRequestConstructorOptions { + return { + ...opts, + [kAllowNonHttpProtocols]: true + } as any; +} + +type ExtraURLLoaderOptions = { + redirectPolicy: RedirectPolicy; + headers: Record<string, { name: string, value: string | string[] }>; + allowNonHttpProtocols: boolean; +} +function parseOptions (optionsIn: ClientRequestConstructorOptions | string): NodeJS.CreateURLLoaderOptions & ExtraURLLoaderOptions { const options: any = typeof optionsIn === 'string' ? url.parse(optionsIn) : { ...optionsIn }; let urlStr: string = options.url; @@ -203,9 +216,6 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod if (!urlStr) { const urlObj: url.UrlObject = {}; const protocol = options.protocol || 'http:'; - if (!kSupportedProtocols.has(protocol)) { - throw new Error('Protocol "' + protocol + '" not supported'); - } urlObj.protocol = protocol; if (options.host) { @@ -247,7 +257,7 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod throw new TypeError('headers must be an object'); } - const urlLoaderOptions: NodeJS.CreateURLLoaderOptions & { redirectPolicy: RedirectPolicy, headers: Record<string, { name: string, value: string | string[] }> } = { + const urlLoaderOptions: NodeJS.CreateURLLoaderOptions & { redirectPolicy: RedirectPolicy, headers: Record<string, { name: string, value: string | string[] }>, allowNonHttpProtocols: boolean } = { method: (options.method || 'GET').toUpperCase(), url: urlStr, redirectPolicy, @@ -257,7 +267,8 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod credentials: options.credentials, origin: options.origin, referrerPolicy: options.referrerPolicy, - cache: options.cache + cache: options.cache, + allowNonHttpProtocols: Object.prototype.hasOwnProperty.call(options, kAllowNonHttpProtocols) }; const headers: Record<string, string | string[]> = options.headers || {}; for (const [name, value] of Object.entries(headers)) { @@ -308,6 +319,10 @@ export class ClientRequest extends Writable implements Electron.ClientRequest { } const { redirectPolicy, ...urlLoaderOptions } = parseOptions(options); + const urlObj = new URL(urlLoaderOptions.url); + if (!urlLoaderOptions.allowNonHttpProtocols && !kHttpProtocols.has(urlObj.protocol)) { + throw new Error('ClientRequest only supports http: and https: protocols'); + } if (urlLoaderOptions.credentials === 'same-origin' && !urlLoaderOptions.origin) { throw new Error('credentials: same-origin requires origin to be set'); } this._urlLoaderOptions = urlLoaderOptions; this._redirectPolicy = redirectPolicy; diff --git a/lib/browser/api/net-fetch.ts b/lib/browser/api/net-fetch.ts index 3b9bcb2be5..2d66a58d24 100644 --- a/lib/browser/api/net-fetch.ts +++ b/lib/browser/api/net-fetch.ts @@ -1,5 +1,6 @@ import { net, IncomingMessage, Session as SessionT } from 'electron/main'; import { Readable, Writable, isReadable } from 'stream'; +import { allowAnyProtocol } from '@electron/internal/browser/api/net-client-request'; function createDeferredPromise<T, E extends Error = Error> (): { promise: Promise<T>; resolve: (x: T) => void; reject: (e: E) => void; } { let res: (x: T) => void; @@ -72,7 +73,7 @@ export function fetchWithSession (input: RequestInfo, init: RequestInit | undefi // We can't set credentials to same-origin unless there's an origin set. const credentials = req.credentials === 'same-origin' && !origin ? 'include' : req.credentials; - const r = net.request({ + const r = net.request(allowAnyProtocol({ session, method: req.method, url: req.url, @@ -81,7 +82,7 @@ export function fetchWithSession (input: RequestInfo, init: RequestInit | undefi cache: req.cache, referrerPolicy: req.referrerPolicy, redirect: req.redirect - }); + })); // cors is the default mode, but we can't set mode=cors without an origin. if (req.mode && (req.mode !== 'cors' || origin)) { diff --git a/shell/browser/api/electron_api_url_loader.cc b/shell/browser/api/electron_api_url_loader.cc index a20f335f54..b1dc3c097a 100644 --- a/shell/browser/api/electron_api_url_loader.cc +++ b/shell/browser/api/electron_api_url_loader.cc @@ -18,14 +18,19 @@ #include "mojo/public/cpp/system/data_pipe_producer.h" #include "net/base/load_flags.h" #include "net/http/http_util.h" +#include "net/url_request/redirect_util.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/simple_url_loader.h" +#include "services/network/public/cpp/url_util.h" +#include "services/network/public/cpp/wrapper_shared_url_loader_factory.h" #include "services/network/public/mojom/chunked_data_pipe_getter.mojom.h" #include "services/network/public/mojom/http_raw_headers.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" #include "shell/browser/api/electron_api_session.h" #include "shell/browser/electron_browser_context.h" #include "shell/browser/javascript_environment.h" +#include "shell/browser/net/asar/asar_url_loader_factory.h" +#include "shell/browser/protocol_registry.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/net_converter.h" @@ -336,34 +341,49 @@ gin::WrapperInfo SimpleURLLoaderWrapper::kWrapperInfo = { gin::kEmbedderNativeGin}; SimpleURLLoaderWrapper::SimpleURLLoaderWrapper( + ElectronBrowserContext* browser_context, std::unique_ptr<network::ResourceRequest> request, - network::mojom::URLLoaderFactory* url_loader_factory, - int options) { - if (!request->trusted_params) - request->trusted_params = network::ResourceRequest::TrustedParams(); + int options) + : browser_context_(browser_context), + request_options_(options), + request_(std::move(request)) { + if (!request_->trusted_params) + request_->trusted_params = network::ResourceRequest::TrustedParams(); mojo::PendingRemote<network::mojom::URLLoaderNetworkServiceObserver> url_loader_network_observer_remote; url_loader_network_observer_receivers_.Add( this, url_loader_network_observer_remote.InitWithNewPipeAndPassReceiver()); - request->trusted_params->url_loader_network_observer = + request_->trusted_params->url_loader_network_observer = std::move(url_loader_network_observer_remote); // Chromium filters headers using browser rules, while for net module we have // every header passed. The following setting will allow us to capture the // raw headers in the URLLoader. - request->trusted_params->report_raw_headers = true; - // SimpleURLLoader wants to control the request body itself. We have other - // ideas. - auto request_body = std::move(request->request_body); - auto* request_ref = request.get(); + request_->trusted_params->report_raw_headers = true; + Start(); +} + +void SimpleURLLoaderWrapper::Start() { + // Make a copy of the request; we'll need to re-send it if we get redirected. + auto request = std::make_unique<network::ResourceRequest>(); + *request = *request_; + + // SimpleURLLoader has no way to set a data pipe as the request body, which + // we need to do for streaming upload, so instead we "cheat" and pretend to + // SimpleURLLoader like there is no request_body when we construct it. Later, + // we will sneakily put the request_body back while it isn't looking. + scoped_refptr<network::ResourceRequestBody> request_body = + std::move(request->request_body); + + network::ResourceRequest* request_ref = request.get(); loader_ = network::SimpleURLLoader::Create(std::move(request), kTrafficAnnotation); - if (request_body) { + + if (request_body) request_ref->request_body = std::move(request_body); - } loader_->SetAllowHttpErrorResults(true); - loader_->SetURLLoaderFactoryOptions(options); + loader_->SetURLLoaderFactoryOptions(request_options_); loader_->SetOnResponseStartedCallback(base::BindOnce( &SimpleURLLoaderWrapper::OnResponseStarted, base::Unretained(this))); loader_->SetOnRedirectCallback(base::BindRepeating( @@ -373,7 +393,8 @@ SimpleURLLoaderWrapper::SimpleURLLoaderWrapper( loader_->SetOnDownloadProgressCallback(base::BindRepeating( &SimpleURLLoaderWrapper::OnDownloadProgress, base::Unretained(this))); - loader_->DownloadAsStream(url_loader_factory, this); + url_loader_factory_ = GetURLLoaderFactoryForURL(request_ref->url); + loader_->DownloadAsStream(url_loader_factory_.get(), this); } void SimpleURLLoaderWrapper::Pin() { @@ -458,6 +479,42 @@ void SimpleURLLoaderWrapper::Cancel() { // This ensures that no further callbacks will be called, so there's no need // for additional guards. } +scoped_refptr<network::SharedURLLoaderFactory> +SimpleURLLoaderWrapper::GetURLLoaderFactoryForURL(const GURL& url) { + scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory; + auto* protocol_registry = + ProtocolRegistry::FromBrowserContext(browser_context_); + // Explicitly handle intercepted protocols here, even though + // ProxyingURLLoaderFactory would handle them later on, so that we can + // correctly intercept file:// scheme URLs. + if (protocol_registry->IsProtocolIntercepted(url.scheme())) { + auto& protocol_handler = + protocol_registry->intercept_handlers().at(url.scheme()); + mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_remote = + ElectronURLLoaderFactory::Create(protocol_handler.first, + protocol_handler.second); + url_loader_factory = network::SharedURLLoaderFactory::Create( + std::make_unique<network::WrapperPendingSharedURLLoaderFactory>( + std::move(pending_remote))); + } else if (protocol_registry->IsProtocolRegistered(url.scheme())) { + auto& protocol_handler = protocol_registry->handlers().at(url.scheme()); + mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_remote = + ElectronURLLoaderFactory::Create(protocol_handler.first, + protocol_handler.second); + url_loader_factory = network::SharedURLLoaderFactory::Create( + std::make_unique<network::WrapperPendingSharedURLLoaderFactory>( + std::move(pending_remote))); + } else if (url.SchemeIsFile()) { + mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_remote = + AsarURLLoaderFactory::Create(); + url_loader_factory = network::SharedURLLoaderFactory::Create( + std::make_unique<network::WrapperPendingSharedURLLoaderFactory>( + std::move(pending_remote))); + } else { + url_loader_factory = browser_context_->GetURLLoaderFactory(); + } + return url_loader_factory; +} // static gin::Handle<SimpleURLLoaderWrapper> SimpleURLLoaderWrapper::Create( @@ -634,12 +691,9 @@ gin::Handle<SimpleURLLoaderWrapper> SimpleURLLoaderWrapper::Create( session = Session::FromPartition(args->isolate(), ""); } - auto url_loader_factory = session->browser_context()->GetURLLoaderFactory(); - auto ret = gin::CreateHandle( - args->isolate(), - new SimpleURLLoaderWrapper(std::move(request), url_loader_factory.get(), - options)); + args->isolate(), new SimpleURLLoaderWrapper(session->browser_context(), + std::move(request), options)); ret->Pin(); if (!chunk_pipe_getter.IsEmpty()) { ret->PinBodyGetter(chunk_pipe_getter); @@ -691,6 +745,45 @@ void SimpleURLLoaderWrapper::OnRedirect( const network::mojom::URLResponseHead& response_head, std::vector<std::string>* removed_headers) { Emit("redirect", redirect_info, response_head.headers.get()); + + if (!loader_) + // The redirect was aborted by JS. + return; + + // Optimization: if both the old and new URLs are handled by the network + // service, just FollowRedirect. + if (network::IsURLHandledByNetworkService(redirect_info.new_url) && + network::IsURLHandledByNetworkService(request_->url)) + return; + + // Otherwise, restart the request (potentially picking a new + // URLLoaderFactory). See + // https://source.chromium.org/chromium/chromium/src/+/main:content/browser/loader/navigation_url_loader_impl.cc;l=534-550;drc=fbaec92ad5982f83aa4544d5c88d66d08034a9f4 + + bool should_clear_upload = false; + net::RedirectUtil::UpdateHttpRequest( + request_->url, request_->method, redirect_info, *removed_headers, + /* modified_headers = */ absl::nullopt, &request_->headers, + &should_clear_upload); + if (should_clear_upload) { + // The request body is no longer applicable. + request_->request_body.reset(); + } + + request_->url = redirect_info.new_url; + request_->method = redirect_info.new_method; + request_->site_for_cookies = redirect_info.new_site_for_cookies; + + // See if navigation network isolation key needs to be updated. + request_->trusted_params->isolation_info = + request_->trusted_params->isolation_info.CreateForRedirect( + url::Origin::Create(request_->url)); + + request_->referrer = GURL(redirect_info.new_referrer); + request_->referrer_policy = redirect_info.new_referrer_policy; + request_->navigation_redirect_chain.push_back(redirect_info.new_url); + + Start(); } void SimpleURLLoaderWrapper::OnUploadProgress(uint64_t position, diff --git a/shell/browser/api/electron_api_url_loader.h b/shell/browser/api/electron_api_url_loader.h index adf8de0be4..4d48cc2b90 100644 --- a/shell/browser/api/electron_api_url_loader.h +++ b/shell/browser/api/electron_api_url_loader.h @@ -31,8 +31,13 @@ class Handle; namespace network { class SimpleURLLoader; struct ResourceRequest; +class SharedURLLoaderFactory; } // namespace network +namespace electron { +class ElectronBrowserContext; +} + namespace electron::api { /** Wraps a SimpleURLLoader to make it usable from JavaScript */ @@ -54,8 +59,8 @@ class SimpleURLLoaderWrapper const char* GetTypeName() override; private: - SimpleURLLoaderWrapper(std::unique_ptr<network::ResourceRequest> request, - network::mojom::URLLoaderFactory* url_loader_factory, + SimpleURLLoaderWrapper(ElectronBrowserContext* browser_context, + std::unique_ptr<network::ResourceRequest> request, int options); // SimpleURLLoaderStreamConsumer: @@ -99,6 +104,9 @@ class SimpleURLLoaderWrapper mojo::PendingReceiver<network::mojom::URLLoaderNetworkServiceObserver> observer) override; + scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactoryForURL( + const GURL& url); + // SimpleURLLoader callbacks void OnResponseStarted(const GURL& final_url, const network::mojom::URLResponseHead& response_head); @@ -112,6 +120,10 @@ class SimpleURLLoaderWrapper void Pin(); void PinBodyGetter(v8::Local<v8::Value>); + ElectronBrowserContext* browser_context_; + int request_options_; + std::unique_ptr<network::ResourceRequest> request_; + scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_; std::unique_ptr<network::SimpleURLLoader> loader_; v8::Global<v8::Value> pinned_wrapper_; v8::Global<v8::Value> pinned_chunk_pipe_getter_; diff --git a/spec/api-net-spec.ts b/spec/api-net-spec.ts index a957325514..61c259e7e8 100644 --- a/spec/api-net-spec.ts +++ b/spec/api-net-spec.ts @@ -1,8 +1,9 @@ import { expect } from 'chai'; import * as dns from 'dns'; -import { net, session, ClientRequest, BrowserWindow, ClientRequestConstructorOptions } from 'electron/main'; +import { net, session, ClientRequest, BrowserWindow, ClientRequestConstructorOptions, protocol } from 'electron/main'; import * as http from 'http'; import * as url from 'url'; +import * as path from 'path'; import { Socket } from 'net'; import { defer, listen } from './lib/spec-helpers'; import { once } from 'events'; @@ -163,9 +164,9 @@ describe('net module', () => { it('should post the correct data in a POST request', async () => { const bodyData = 'Hello World!'; + let postedBodyData: string = ''; const serverUrl = await respondOnce.toSingleURL(async (request, response) => { - const postedBodyData = await collectStreamBody(request); - expect(postedBodyData).to.equal(bodyData); + postedBodyData = await collectStreamBody(request); response.end(); }); const urlRequest = net.request({ @@ -175,16 +176,72 @@ describe('net module', () => { urlRequest.write(bodyData); const response = await getResponse(urlRequest); expect(response.statusCode).to.equal(200); + expect(postedBodyData).to.equal(bodyData); + }); + + it('a 307 redirected POST request preserves the body', async () => { + const bodyData = 'Hello World!'; + let postedBodyData: string = ''; + let methodAfterRedirect: string | undefined; + const serverUrl = await respondNTimes.toRoutes({ + '/redirect': (req, res) => { + res.statusCode = 307; + res.setHeader('location', serverUrl); + return res.end(); + }, + '/': async (req, res) => { + methodAfterRedirect = req.method; + postedBodyData = await collectStreamBody(req); + res.end(); + } + }, 2); + const urlRequest = net.request({ + method: 'POST', + url: serverUrl + '/redirect' + }); + urlRequest.write(bodyData); + const response = await getResponse(urlRequest); + expect(response.statusCode).to.equal(200); + await collectStreamBody(response); + expect(methodAfterRedirect).to.equal('POST'); + expect(postedBodyData).to.equal(bodyData); + }); + + it('a 302 redirected POST request DOES NOT preserve the body', async () => { + const bodyData = 'Hello World!'; + let postedBodyData: string = ''; + let methodAfterRedirect: string | undefined; + const serverUrl = await respondNTimes.toRoutes({ + '/redirect': (req, res) => { + res.statusCode = 302; + res.setHeader('location', serverUrl); + return res.end(); + }, + '/': async (req, res) => { + methodAfterRedirect = req.method; + postedBodyData = await collectStreamBody(req); + res.end(); + } + }, 2); + const urlRequest = net.request({ + method: 'POST', + url: serverUrl + '/redirect' + }); + urlRequest.write(bodyData); + const response = await getResponse(urlRequest); + expect(response.statusCode).to.equal(200); + await collectStreamBody(response); + expect(methodAfterRedirect).to.equal('GET'); + expect(postedBodyData).to.equal(''); }); it('should support chunked encoding', async () => { + let receivedRequest: http.IncomingMessage = null as any; const serverUrl = await respondOnce.toSingleURL((request, response) => { response.statusCode = 200; response.statusMessage = 'OK'; response.chunkedEncoding = true; - expect(request.method).to.equal('POST'); - expect(request.headers['transfer-encoding']).to.equal('chunked'); - expect(request.headers['content-length']).to.equal(undefined); + receivedRequest = request; request.on('data', (chunk: Buffer) => { response.write(chunk); }); @@ -210,6 +267,9 @@ describe('net module', () => { } const response = await getResponse(urlRequest); + expect(receivedRequest.method).to.equal('POST'); + expect(receivedRequest.headers['transfer-encoding']).to.equal('chunked'); + expect(receivedRequest.headers['content-length']).to.equal(undefined); expect(response.statusCode).to.equal(200); const received = await collectStreamBodyBuffer(response); expect(sent.equals(received)).to.be.true(); @@ -1446,6 +1506,9 @@ describe('net module', () => { urlRequest.end(); urlRequest.on('redirect', () => { urlRequest.abort(); }); urlRequest.on('error', () => {}); + urlRequest.on('response', () => { + expect.fail('Unexpected response'); + }); await once(urlRequest, 'abort'); }); @@ -2078,6 +2141,20 @@ describe('net module', () => { }); }); + describe('non-http schemes', () => { + it('should be rejected by net.request', async () => { + expect(() => { + net.request('file://bar'); + }).to.throw('ClientRequest only supports http: and https: protocols'); + }); + + it('should be rejected by net.request when passed in url:', async () => { + expect(() => { + net.request({ url: 'file://bar' }); + }).to.throw('ClientRequest only supports http: and https: protocols'); + }); + }); + describe('net.fetch', () => { // NB. there exist much more comprehensive tests for fetch() in the form of // the WPT: https://github.com/web-platform-tests/wpt/tree/master/fetch @@ -2167,5 +2244,83 @@ describe('net module', () => { await expect(r.text()).to.be.rejectedWith(/ERR_INCOMPLETE_CHUNKED_ENCODING/); }); }); + + it('can request file:// URLs', async () => { + const resp = await net.fetch(url.pathToFileURL(path.join(__dirname, 'fixtures', 'hello.txt')).toString()); + expect(resp.ok).to.be.true(); + // trimRight instead of asserting the whole string to avoid line ending shenanigans on WOA + expect((await resp.text()).trimRight()).to.equal('hello world'); + }); + + it('can make requests to custom protocols', async () => { + protocol.registerStringProtocol('electron-test', (req, cb) => { cb('hello ' + req.url); }); + defer(() => { + protocol.unregisterProtocol('electron-test'); + }); + const body = await net.fetch('electron-test://foo').then(r => r.text()); + expect(body).to.equal('hello electron-test://foo'); + }); + + it('runs through intercept handlers', async () => { + protocol.interceptStringProtocol('http', (req, cb) => { cb('hello ' + req.url); }); + defer(() => { + protocol.uninterceptProtocol('http'); + }); + const body = await net.fetch('http://foo').then(r => r.text()); + expect(body).to.equal('hello http://foo/'); + }); + + it('file: runs through intercept handlers', async () => { + protocol.interceptStringProtocol('file', (req, cb) => { cb('hello ' + req.url); }); + defer(() => { + protocol.uninterceptProtocol('file'); + }); + const body = await net.fetch('file://foo').then(r => r.text()); + expect(body).to.equal('hello file://foo/'); + }); + + it('can be redirected', async () => { + protocol.interceptStringProtocol('file', (req, cb) => { cb({ statusCode: 302, headers: { location: 'electron-test://bar' } }); }); + defer(() => { + protocol.uninterceptProtocol('file'); + }); + protocol.registerStringProtocol('electron-test', (req, cb) => { cb('hello ' + req.url); }); + defer(() => { + protocol.unregisterProtocol('electron-test'); + }); + const body = await net.fetch('file://foo').then(r => r.text()); + expect(body).to.equal('hello electron-test://bar'); + }); + + it('should not follow redirect when redirect: error', async () => { + protocol.registerStringProtocol('electron-test', (req, cb) => { + if (/redirect/.test(req.url)) return cb({ statusCode: 302, headers: { location: 'electron-test://bar' } }); + cb('hello ' + req.url); + }); + defer(() => { + protocol.unregisterProtocol('electron-test'); + }); + await expect(net.fetch('electron-test://redirect', { redirect: 'error' })).to.eventually.be.rejectedWith('Attempted to redirect, but redirect policy was \'error\''); + }); + + it('a 307 redirected POST request preserves the body', async () => { + const bodyData = 'Hello World!'; + let postedBodyData: any; + protocol.registerStringProtocol('electron-test', async (req, cb) => { + if (/redirect/.test(req.url)) return cb({ statusCode: 307, headers: { location: 'electron-test://bar' } }); + postedBodyData = req.uploadData![0].bytes.toString(); + cb('hello ' + req.url); + }); + defer(() => { + protocol.unregisterProtocol('electron-test'); + }); + const response = await net.fetch('electron-test://redirect', { + method: 'POST', + body: bodyData + }); + expect(response.status).to.equal(200); + await response.text(); + expect(postedBodyData).to.equal(bodyData); + }); }); }); diff --git a/spec/fixtures/hello.txt b/spec/fixtures/hello.txt new file mode 100644 index 0000000000..3b18e512db --- /dev/null +++ b/spec/fixtures/hello.txt @@ -0,0 +1 @@ +hello world
feat
aa7a5e6ca959a6a54b59ce9e4c11eb4ce482b8cb
Niklas Wenzel
2024-11-18 23:36:41
docs: document why to use the loadBrowserProcessSpecificV8Snapshot fuse (#44680) Fixes #44450
diff --git a/docs/tutorial/fuses.md b/docs/tutorial/fuses.md index 3e644f02dc..1afa53d6a7 100644 --- a/docs/tutorial/fuses.md +++ b/docs/tutorial/fuses.md @@ -68,6 +68,10 @@ The onlyLoadAppFromAsar fuse changes the search system that Electron uses to loc The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is used for the browser process. By default Electron's processes will all use the same V8 snapshot file. When this fuse is enabled the browser process uses the file called `browser_v8_context_snapshot.bin` for its V8 snapshot. The other processes will use the V8 snapshot file that they normally do. +V8 snapshots can be useful to improve app startup performance. V8 lets you take snapshots of initialized heaps and then load them back in to avoid the cost of initializing the heap. + +Using separate snapshots for renderer processes and the main process can improve security, especially to make sure that the renderer doesn't use a snapshot with `nodeIntegration` enabled. See [#35170](https://github.com/electron/electron/issues/35170) for details. + ### `grantFileProtocolExtraPrivileges` **Default:** Enabled
docs
8c5e7bbf6b8759488f01faa39c583e16966c81e2
Charles Kerr
2024-09-09 07:13:39
fix: UvHandle move semantics (#43615) reassign the uv_handle_t of the source
diff --git a/shell/common/node_bindings.h b/shell/common/node_bindings.h index ac6faf470a..a870e97c1f 100644 --- a/shell/common/node_bindings.h +++ b/shell/common/node_bindings.h @@ -62,8 +62,17 @@ class UvHandle { UvHandle() : t_{new T} {} ~UvHandle() { reset(); } - UvHandle(UvHandle&&) = default; - UvHandle& operator=(UvHandle&&) = default; + explicit UvHandle(UvHandle&& that) { + t_ = that.t_; + that.t_ = nullptr; + } + + UvHandle& operator=(UvHandle&& that) { + reset(); + t_ = that.t_; + that.t_ = nullptr; + return *this; + } UvHandle(const UvHandle&) = delete; UvHandle& operator=(const UvHandle&) = delete;
fix
f979d4c74203fb495c187f747b02f464774893da
David Sanders
2024-07-25 02:00:02
test: add test for nodeCliInspect fuse (#43035)
diff --git a/spec/fuses-spec.ts b/spec/fuses-spec.ts index fe3955732e..5fb0013c0e 100644 --- a/spec/fuses-spec.ts +++ b/spec/fuses-spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { startRemoteControlApp } from './lib/spec-helpers'; import { once } from 'node:events'; -import { spawn } from 'node:child_process'; +import { spawn, spawnSync } from 'node:child_process'; import { BrowserWindow } from 'electron'; import path = require('node:path'); @@ -17,6 +17,13 @@ describe('fuses', () => { expect(code1).to.equal(0); }); + it('disables --inspect flag when node_cli_inspect is 0', () => { + const { status, stderr } = spawnSync(process.execPath, ['--set-fuse-node_cli_inspect=0', '--inspect', '-v'], { encoding: 'utf-8' }); + expect(stderr).to.not.include('Debugger listening on ws://'); + // Should print the version and exit with 0 + expect(status).to.equal(0); + }); + it('disables fetching file:// URLs when grant_file_protocol_extra_privileges is 0', async () => { const rc = await startRemoteControlApp(['--set-fuse-grant_file_protocol_extra_privileges=0']); await expect(rc.remotely(async (fixture: string) => {
test
9616dfb1f6be46cb70606faa97f3121b7cafadcd
Samuel Attard
2022-11-15 20:02:01
docs: update SECURITY.md with new GHSA reporting feature (#36367)
diff --git a/SECURITY.md b/SECURITY.md index 43129ea52c..ebf5d628d1 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ The Electron team and community take security bugs in Electron seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. -To report a security issue, email [[email protected]](mailto:[email protected]) and include the word "SECURITY" in the subject line. +To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/electron/electron/security/advisories/new) tab. The Electron team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.
docs
2b283724ce689a680b20c9b922384bec854415f6
hunter
2023-07-31 16:32:59
docs: fix some string union type (#39258) * docs: fix some string union types Improve Type Union Typings in the Docs * test: add smoke tests * test: update `ses.clearStorageData` test case * test: update `ses.clearStorageData` test case --------- Co-authored-by: mhli <[email protected]>
diff --git a/docs/api/desktop-capturer.md b/docs/api/desktop-capturer.md index 32b881516a..078d4f980b 100644 --- a/docs/api/desktop-capturer.md +++ b/docs/api/desktop-capturer.md @@ -91,7 +91,7 @@ The `desktopCapturer` module has the following methods: * `options` Object * `types` string[] - An array of strings that lists the types of desktop sources - to be captured, available types are `screen` and `window`. + to be captured, available types can be `screen` and `window`. * `thumbnailSize` [Size](structures/size.md) (optional) - The size that the media source thumbnail should be scaled to. Default is `150` x `150`. Set width or height to 0 when you do not need the thumbnails. This will save the processing time required for capturing the content of each diff --git a/docs/api/native-image.md b/docs/api/native-image.md index 84660c5da7..d31b39f1c7 100644 --- a/docs/api/native-image.md +++ b/docs/api/native-image.md @@ -306,7 +306,7 @@ Returns `NativeImage` - The cropped image. * `width` Integer (optional) - Defaults to the image's width. * `height` Integer (optional) - Defaults to the image's height. * `quality` string (optional) - The desired quality of the resize image. - Possible values are `good`, `better`, or `best`. The default is `best`. + Possible values include `good`, `better`, or `best`. The default is `best`. These values express a desired quality/speed tradeoff. They are translated into an algorithm-specific method that depends on the capabilities (CPU, GPU) of the underlying platform. It is possible for all three methods diff --git a/docs/api/session.md b/docs/api/session.md index df59bf0886..7be9461b10 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -574,11 +574,11 @@ Clears the session’s HTTP cache. * `options` Object (optional) * `origin` string (optional) - Should follow `window.location.origin`’s representation `scheme://host:port`. - * `storages` string[] (optional) - The types of storages to clear, can contain: + * `storages` string[] (optional) - The types of storages to clear, can be `cookies`, `filesystem`, `indexdb`, `localstorage`, `shadercache`, `websql`, `serviceworkers`, `cachestorage`. If not specified, clear all storage types. - * `quotas` string[] (optional) - The types of quotas to clear, can contain: + * `quotas` string[] (optional) - The types of quotas to clear, can be `temporary`, `syncable`. If not specified, clear all quotas. Returns `Promise<void>` - resolves when the storage data has been cleared. @@ -1113,7 +1113,7 @@ app.whenReady().then(() => { * `handler` Function\<string[]> | null * `details` Object - * `protectedClasses` string[] - The current list of protected USB classes. Possible class values are: + * `protectedClasses` string[] - The current list of protected USB classes. Possible class values include: * `audio` * `audio-video` * `hid` diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index fb12398316..cb046fb8fd 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -795,7 +795,7 @@ Returns: * `frameCharset` string - The character encoding of the frame on which the menu was invoked. * `inputFieldType` string - If the context menu was invoked on an input - field, the type of that field. Possible values are `none`, `plainText`, + field, the type of that field. Possible values include `none`, `plainText`, `password`, `other`. * `spellcheckEnabled` boolean - If the context is editable, whether or not spellchecking is enabled. * `menuSourceType` string - Input source that invoked the context menu. diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index 4a71c998f5..74b8c1519d 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -1091,7 +1091,7 @@ Returns: * `frameCharset` string - The character encoding of the frame on which the menu was invoked. * `inputFieldType` string - If the context menu was invoked on an input - field, the type of that field. Possible values are `none`, `plainText`, + field, the type of that field. Possible values include `none`, `plainText`, `password`, `other`. * `spellcheckEnabled` boolean - If the context is editable, whether or not spellchecking is enabled. * `menuSourceType` string - Input source that invoked the context menu. diff --git a/spec/api-session-spec.ts b/spec/api-session-spec.ts index 6768077027..840748167a 100644 --- a/spec/api-session-spec.ts +++ b/spec/api-session-spec.ts @@ -252,12 +252,11 @@ describe('session module', () => { it('clears localstorage data', async () => { const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true } }); await w.loadFile(path.join(fixtures, 'api', 'localstorage.html')); - const options = { + await w.webContents.session.clearStorageData({ origin: 'file://', storages: ['localstorage'], - quotas: ['persistent'] - }; - await w.webContents.session.clearStorageData(options); + quotas: ['temporary'] + }); while (await w.webContents.executeJavaScript('localStorage.length') !== 0) { // The storage clear isn't instantly visible to the renderer, so keep // trying until it is. diff --git a/spec/ts-smoke/electron/main.ts b/spec/ts-smoke/electron/main.ts index 05829f4d6e..27ea0da6c3 100644 --- a/spec/ts-smoke/electron/main.ts +++ b/spec/ts-smoke/electron/main.ts @@ -526,6 +526,10 @@ dialog.showMessageBoxSync(win3, { message: 'test', type: 'foo' }); ipcMain.handle('get-sources', (event, options) => desktopCapturer.getSources(options)); +desktopCapturer.getSources({ types: ['window', 'screen'] }); +// @ts-expect-error Invalid type value +desktopCapturer.getSources({ types: ['unknown'] }); + // global-shortcut // https://github.com/electron/electron/blob/main/docs/api/global-shortcut.md @@ -1030,6 +1034,12 @@ appIcon4.destroy(); const image2 = nativeImage.createFromPath('/Users/somebody/images/icon.png'); console.log(image2.getSize()); +image2.resize({ quality: 'best' }); +image2.resize({ quality: 'better' }); +image2.resize({ quality: 'good' }); +// @ts-expect-error Invalid type value +image2.resize({ quality: 'bad' }); + // process // https://github.com/electron/electron/blob/main/docs/api/process.md @@ -1133,6 +1143,16 @@ shell.writeShortcutLink('/home/user/Desktop/shortcut.lnk', 'update', shell.readS // session // https://github.com/electron/electron/blob/main/docs/api/session.md +session.defaultSession.clearStorageData({ storages: ['cookies', 'filesystem'] }); +session.defaultSession.clearStorageData({ storages: ['localstorage', 'indexdb', 'serviceworkers'] }); +session.defaultSession.clearStorageData({ storages: ['shadercache', 'websql', 'cachestorage'] }); +// @ts-expect-error Invalid type value +session.defaultSession.clearStorageData({ storages: ['wrong_path'] }); + +session.defaultSession.clearStorageData({ quotas: ['syncable', 'temporary'] }); +// @ts-expect-error Invalid type value +session.defaultSession.clearStorageData({ quotas: ['bad_type'] }); + session.defaultSession.on('will-download', (event, item, webContents) => { console.log('will-download', webContents.id); event.preventDefault();
docs
eac1a7ff68fd03dea343efeff09ef345d48c51df
Shelley Vohr
2025-02-27 20:44:46
fix: context-menu event emitted in draggable regions (#45813) * fix: context-menu event emitted in draggable regions * fix: only trigger on mouse release
diff --git a/shell/browser/ui/electron_desktop_window_tree_host_linux.cc b/shell/browser/ui/electron_desktop_window_tree_host_linux.cc index 98546cc0ac..7f79c7223e 100644 --- a/shell/browser/ui/electron_desktop_window_tree_host_linux.cc +++ b/shell/browser/ui/electron_desktop_window_tree_host_linux.cc @@ -12,6 +12,7 @@ #include "base/feature_list.h" #include "base/i18n/rtl.h" +#include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/native_window_features.h" #include "shell/browser/native_window_views.h" #include "shell/browser/ui/views/client_frame_view_linux.h" @@ -241,4 +242,23 @@ void ElectronDesktopWindowTreeHostLinux::UpdateFrameHints() { SizeConstraintsChanged(); } } + +void ElectronDesktopWindowTreeHostLinux::DispatchEvent(ui::Event* event) { + if (event->IsMouseEvent()) { + auto* mouse_event = static_cast<ui::MouseEvent*>(event); + bool is_mousedown = mouse_event->type() == ui::EventType::kMousePressed; + bool is_system_menu_trigger = + is_mousedown && + (mouse_event->IsRightMouseButton() || + (mouse_event->IsLeftMouseButton() && mouse_event->IsControlDown())); + if (is_system_menu_trigger) { + electron::api::WebContents::SetDisableDraggableRegions(true); + views::DesktopWindowTreeHostLinux::DispatchEvent(event); + electron::api::WebContents::SetDisableDraggableRegions(false); + return; + } + } + views::DesktopWindowTreeHostLinux::DispatchEvent(event); +} + } // namespace electron diff --git a/shell/browser/ui/electron_desktop_window_tree_host_linux.h b/shell/browser/ui/electron_desktop_window_tree_host_linux.h index 38d295b835..d1ee9a33a8 100644 --- a/shell/browser/ui/electron_desktop_window_tree_host_linux.h +++ b/shell/browser/ui/electron_desktop_window_tree_host_linux.h @@ -60,6 +60,7 @@ class ElectronDesktopWindowTreeHostLinux // views::DesktopWindowTreeHostLinux: void UpdateFrameHints() override; + void DispatchEvent(ui::Event* event) override; private: void UpdateWindowState(ui::PlatformWindowState new_state); diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index ed6fd5ef73..5d7721acce 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -2861,18 +2861,18 @@ describe('webContents module', () => { await once(w.webContents, 'context-menu'); await setTimeout(100); - expect(contextMenuEmitCount).to.equal(1); }); - it('emits when right-clicked in page in a draggable region', async () => { + ifit(process.platform !== 'win32')('emits when right-clicked in page in a draggable region', async () => { const w = new BrowserWindow({ show: false }); await w.loadFile(path.join(fixturesPath, 'pages', 'draggable-page.html')); const promise = once(w.webContents, 'context-menu') as Promise<[any, Electron.ContextMenuParams]>; // Simulate right-click to create context-menu event. - const opts = { x: 0, y: 0, button: 'right' as const }; + const midPoint = w.getBounds().width / 2; + const opts = { x: midPoint, y: midPoint, button: 'right' as const }; w.webContents.sendInputEvent({ ...opts, type: 'mouseDown' }); w.webContents.sendInputEvent({ ...opts, type: 'mouseUp' });
fix
01330805cb8e316f39c0ef9c9be49eaf0ec26a17
Charles Kerr
2024-09-24 00:37:18
refactor: prefer member initializers in asar structs (#43883) prefactor: prefer member initializers in asar::Archive prefactor: prefer member initializers in asar::Archive::FileInfo prefactor: prefer member initializers in asar::IntegrityPayload
diff --git a/shell/common/asar/archive.cc b/shell/common/asar/archive.cc index 4fb9a70f5c..34037ecd90 100644 --- a/shell/common/asar/archive.cc +++ b/shell/common/asar/archive.cc @@ -156,17 +156,14 @@ bool FillFileInfoWithNode(Archive::FileInfo* info, } // namespace -IntegrityPayload::IntegrityPayload() - : algorithm(HashAlgorithm::kNone), block_size(0) {} +IntegrityPayload::IntegrityPayload() = default; IntegrityPayload::~IntegrityPayload() = default; IntegrityPayload::IntegrityPayload(const IntegrityPayload& other) = default; -Archive::FileInfo::FileInfo() - : unpacked(false), executable(false), size(0), offset(0) {} +Archive::FileInfo::FileInfo() = default; Archive::FileInfo::~FileInfo() = default; -Archive::Archive(const base::FilePath& path) - : initialized_(false), path_(path), file_(base::File::FILE_OK) { +Archive::Archive(const base::FilePath& path) : path_{path} { electron::ScopedAllowBlockingForElectron allow_blocking; file_.Initialize(path_, base::File::FLAG_OPEN | base::File::FLAG_READ); #if BUILDFLAG(IS_WIN) diff --git a/shell/common/asar/archive.h b/shell/common/asar/archive.h index ed9b18d74c..16898e1f73 100644 --- a/shell/common/asar/archive.h +++ b/shell/common/asar/archive.h @@ -31,9 +31,9 @@ struct IntegrityPayload { IntegrityPayload(); ~IntegrityPayload(); IntegrityPayload(const IntegrityPayload& other); - HashAlgorithm algorithm; + HashAlgorithm algorithm = HashAlgorithm::kNone; std::string hash; - uint32_t block_size; + uint32_t block_size = 0U; std::vector<std::string> blocks; }; @@ -44,10 +44,10 @@ class Archive { struct FileInfo { FileInfo(); ~FileInfo(); - bool unpacked; - bool executable; - uint32_t size; - uint64_t offset; + bool unpacked = false; + bool executable = false; + uint32_t size = 0U; + uint64_t offset = 0U; std::optional<IntegrityPayload> integrity; }; @@ -100,10 +100,10 @@ class Archive { base::FilePath path() const { return path_; } private: - bool initialized_; + bool initialized_ = false; bool header_validated_ = false; const base::FilePath path_; - base::File file_; + base::File file_{base::File::FILE_OK}; int fd_ = -1; uint32_t header_size_ = 0; std::optional<base::Value::Dict> header_;
refactor
f5869b6fb936ba125071f6560ae8c871e4488777
David Sanders
2023-06-12 15:55:36
chore: change remaining usages of `process.mainModule` (#38705)
diff --git a/script/lint.js b/script/lint.js index f5cc4c9b6a..7b6405a4bd 100755 --- a/script/lint.js +++ b/script/lint.js @@ -353,7 +353,7 @@ async function main () { } } -if (process.mainModule === module) { +if (require.main === module) { main().catch((error) => { console.error(error); process.exit(1); diff --git a/script/nan-spec-runner.js b/script/nan-spec-runner.js index 04c8459a08..85aebb15f6 100644 --- a/script/nan-spec-runner.js +++ b/script/nan-spec-runner.js @@ -9,7 +9,7 @@ const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx'; const utils = require('./lib/utils'); const { YARN_VERSION } = require('./yarn'); -if (!process.mainModule) { +if (!require.main) { throw new Error('Must call the nan spec runner directly'); } diff --git a/script/node-spec-runner.js b/script/node-spec-runner.js index 78d881ddd1..f365886b0a 100644 --- a/script/node-spec-runner.js +++ b/script/node-spec-runner.js @@ -15,7 +15,7 @@ const TAP_FILE_NAME = 'test.tap'; const utils = require('./lib/utils'); -if (!process.mainModule) { +if (!require.main) { throw new Error('Must call the node spec runner directly'); } diff --git a/script/push-patch.js b/script/push-patch.js index b2cdbd2eff..8f7bc86326 100644 --- a/script/push-patch.js +++ b/script/push-patch.js @@ -31,7 +31,7 @@ async function main () { } } -if (process.mainModule === module) { +if (require.main === module) { main().catch((err) => { console.error(err); process.exit(1); diff --git a/script/release/notes/index.js b/script/release/notes/index.js index 5923138502..567135faf8 100755 --- a/script/release/notes/index.js +++ b/script/release/notes/index.js @@ -200,7 +200,7 @@ For example, these invocations are equivalent: } } -if (process.mainModule === module) { +if (require.main === module) { main().catch((err) => { console.error('Error Occurred:', err); process.exit(1); diff --git a/script/release/version-bumper.js b/script/release/version-bumper.js index 1045345788..78e5551b32 100644 --- a/script/release/version-bumper.js +++ b/script/release/version-bumper.js @@ -109,7 +109,7 @@ function isMajorNightly (version, currentVersion) { return false; } -if (process.mainModule === module) { +if (require.main === module) { main().catch((error) => { console.error(error); process.exit(1);
chore
e2e71502b19114f91b9f622745c52b07ff8708a6
Jesper Ek
2024-12-13 17:47:29
fix: custom spell-checker stuck in infinite loop (#45001) `ReadUnicodeCharacter` updates index to the last character read, and not after it. We need to manually increment it to move to the next character. It also doesn't validate that the index is valid, so we need to check that index is within bounds. Refs: #44336
diff --git a/shell/renderer/api/electron_api_spell_check_client.cc b/shell/renderer/api/electron_api_spell_check_client.cc index b97f1771ff..95e05ecccb 100644 --- a/shell/renderer/api/electron_api_spell_check_client.cc +++ b/shell/renderer/api/electron_api_spell_check_client.cc @@ -32,7 +32,9 @@ namespace { bool HasWordCharacters(const std::u16string& text, size_t index) { base_icu::UChar32 code; - while (base::ReadUnicodeCharacter(text.c_str(), text.size(), &index, &code)) { + while (index < text.size() && + base::ReadUnicodeCharacter(text.c_str(), text.size(), &index, &code)) { + ++index; UErrorCode error = U_ZERO_ERROR; if (uscript_getScript(code, &error) != USCRIPT_COMMON) return true;
fix
1d3b1284c46b8a9db3a16da090675a7882c86e4f
Charles Kerr
2024-09-25 06:20:36
test: ensure `sender-pid` hint is set in Linux notifications (#43928) test: expect a `sender-pid` hint in Linux notifications. This PR ensures that the `sender-pid` hint is set for new notifications. It also updates the spec to confirm that DBus receives the hint and that it has the correct value. This fixes a spec failure when running libnotify >= 0.7.12 (2022-05-05). Starting with that version, libnotify started injecting `sender-pid` if not provided by the client. So our tests received a slightly different DBus payload depending on what version of libnotify was installed, causing our deep-equals tests to fail. By always providing and testing the `sender-pid` hint, our behavior and tests should be consistent across distros.
diff --git a/BUILD.gn b/BUILD.gn index 83d1cee62f..722f813b4f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -75,6 +75,7 @@ if (is_linux) { "notify_notification_set_timeout", "notify_notification_set_urgency", "notify_notification_set_hint_string", + "notify_notification_set_hint", "notify_notification_show", "notify_notification_close", ] diff --git a/shell/browser/notifications/linux/libnotify_notification.cc b/shell/browser/notifications/linux/libnotify_notification.cc index 4c8452fad1..4b6c6cf897 100644 --- a/shell/browser/notifications/linux/libnotify_notification.cc +++ b/shell/browser/notifications/linux/libnotify_notification.cc @@ -10,6 +10,7 @@ #include "base/files/file_enumerator.h" #include "base/functional/bind.h" #include "base/logging.h" +#include "base/process/process_handle.h" #include "base/strings/utf_string_conversions.h" #include "shell/browser/notifications/notification_delegate.h" #include "shell/browser/ui/gtk_util.h" @@ -145,6 +146,10 @@ void LibnotifyNotification::Show(const NotificationOptions& options) { notification_, "desktop-entry", desktop_id.c_str()); } + libnotify_loader_.notify_notification_set_hint( + notification_, "sender-pid", + g_variant_new_int64(base::GetCurrentProcId())); + GError* error = nullptr; libnotify_loader_.notify_notification_show(notification_, &error); if (error) { diff --git a/spec/api-notification-dbus-spec.ts b/spec/api-notification-dbus-spec.ts index 3d359a307b..d470bbd20c 100644 --- a/spec/api-notification-dbus-spec.ts +++ b/spec/api-notification-dbus-spec.ts @@ -124,6 +124,7 @@ ifdescribe(!skip)('Notification module (dbus)', () => { append: 'true', image_data: [3, 3, 12, true, 8, 4, Buffer.from([255, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 76, 255, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 38, 255, 255, 0, 0, 0, 255, 0, 0, 0, 0])], 'desktop-entry': appName, + 'sender-pid': process.pid, urgency: 1 } });
test
6a8b70639ba20655812fbd8201380fd0769ca70b
Milan Burda
2023-09-20 22:15:19
fix: `app.runningUnderARM64Translation()` always returning true on Windows ARM64 (#39920) fix: app.runningUnderARM64Translation() always returning true on ARM64
diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index ac6b1c79d0..675818dfb4 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -19,6 +19,7 @@ #include "base/path_service.h" #include "base/system/sys_info.h" #include "base/values.h" +#include "base/win/windows_version.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/icon_manager.h" #include "chrome/common/chrome_features.h" @@ -1475,23 +1476,8 @@ void App::SetUserAgentFallback(const std::string& user_agent) { } #if BUILDFLAG(IS_WIN) - bool App::IsRunningUnderARM64Translation() const { - USHORT processMachine = 0; - USHORT nativeMachine = 0; - - auto IsWow64Process2 = reinterpret_cast<decltype(&::IsWow64Process2)>( - GetProcAddress(GetModuleHandle(L"kernel32.dll"), "IsWow64Process2")); - - if (IsWow64Process2 == nullptr) { - return false; - } - - if (!IsWow64Process2(GetCurrentProcess(), &processMachine, &nativeMachine)) { - return false; - } - - return nativeMachine == IMAGE_FILE_MACHINE_ARM64; + return base::win::OSInfo::IsRunningEmulatedOnArm64(); } #endif
fix
44a4328ea8977b6f4b165e47ecaee54c23af7e97
Charles Kerr
2024-09-06 20:22:44
refactor: take a `uint8_t` span in `ValidateIntegrityOrDie()` (#43592) refactor: take a uint8_t span in ValidateIntegrityOrDie() Doing some groundwork for fixing unsafe base::File() APIs: - Change ValidateIntegrityOrDie() to take a span<const uint8_t> arg. We'll need this to migrate asar's base::File API calls away from the ones tagged `UNSAFE_BUFFER_USAGE` because the safe counterparts use span<uint8_t> too. - Simplify ValidateIntegrityOrDie()'s implementation by using crypto::SHA256Hash() instead of reinventing the wheel.
diff --git a/shell/common/asar/archive.cc b/shell/common/asar/archive.cc index edaae7b043..b3daddcf8c 100644 --- a/shell/common/asar/archive.cc +++ b/shell/common/asar/archive.cc @@ -251,9 +251,8 @@ bool Archive::Init() { // Currently we only support the sha256 algorithm, we can add support for // more below ensure we read them in preference order from most secure to // least - if (integrity.value().algorithm != HashAlgorithm::kNone) { - ValidateIntegrityOrDie(header.c_str(), header.length(), - integrity.value()); + if (integrity->algorithm != HashAlgorithm::kNone) { + ValidateIntegrityOrDie(base::as_byte_span(header), *integrity); } else { LOG(FATAL) << "No eligible hash for validatable asar archive: " << RelativePath().value(); diff --git a/shell/common/asar/asar_util.cc b/shell/common/asar/asar_util.cc index a2076217b6..cba95a00c4 100644 --- a/shell/common/asar/asar_util.cc +++ b/shell/common/asar/asar_util.cc @@ -132,25 +132,17 @@ bool ReadFileToString(const base::FilePath& path, std::string* contents) { return false; } - if (info.integrity.has_value()) { - ValidateIntegrityOrDie(contents->data(), contents->size(), - info.integrity.value()); - } + if (info.integrity) + ValidateIntegrityOrDie(base::as_byte_span(*contents), *info.integrity); return true; } -void ValidateIntegrityOrDie(const char* data, - size_t size, +void ValidateIntegrityOrDie(base::span<const uint8_t> input, const IntegrityPayload& integrity) { if (integrity.algorithm == HashAlgorithm::kSHA256) { - uint8_t hash[crypto::kSHA256Length]; - auto hasher = crypto::SecureHash::Create(crypto::SecureHash::SHA256); - hasher->Update(data, size); - hasher->Finish(hash, sizeof(hash)); const std::string hex_hash = - base::ToLowerASCII(base::HexEncode(hash, sizeof(hash))); - + base::ToLowerASCII(base::HexEncode(crypto::SHA256Hash(input))); if (integrity.hash != hex_hash) { LOG(FATAL) << "Integrity check failed for asar archive (" << integrity.hash << " vs " << hex_hash << ")"; diff --git a/shell/common/asar/asar_util.h b/shell/common/asar/asar_util.h index ee148f26d1..1f678e6d39 100644 --- a/shell/common/asar/asar_util.h +++ b/shell/common/asar/asar_util.h @@ -8,6 +8,8 @@ #include <memory> #include <string> +#include "base/containers/span.h" + namespace base { class FilePath; } @@ -29,8 +31,7 @@ bool GetAsarArchivePath(const base::FilePath& full_path, // Same with base::ReadFileToString but supports asar Archive. bool ReadFileToString(const base::FilePath& path, std::string* contents); -void ValidateIntegrityOrDie(const char* data, - size_t size, +void ValidateIntegrityOrDie(base::span<const uint8_t> input, const IntegrityPayload& integrity); } // namespace asar diff --git a/shell/common/asar/scoped_temporary_file.cc b/shell/common/asar/scoped_temporary_file.cc index 357793a9e2..32b192dda0 100644 --- a/shell/common/asar/scoped_temporary_file.cc +++ b/shell/common/asar/scoped_temporary_file.cc @@ -67,9 +67,8 @@ bool ScopedTemporaryFile::InitFromFile( if (len != static_cast<int>(size)) return false; - if (integrity.has_value()) { - ValidateIntegrityOrDie(buf.data(), buf.size(), integrity.value()); - } + if (integrity) + ValidateIntegrityOrDie(base::as_byte_span(buf), *integrity); base::File dest(path_, base::File::FLAG_OPEN | base::File::FLAG_WRITE); if (!dest.IsValid())
refactor
be4e4ff11b31ef2d6caf322eae947df4bdaf1a16
Jeremy Rose
2024-01-02 13:06:33
fix: make grant_file_protocol_extra_privileges fuse also block CORS fetches (#40801)
diff --git a/build/fuses/build.py b/build/fuses/build.py index f5c9b89417..27cddd9ac0 100755 --- a/build/fuses/build.py +++ b/build/fuses/build.py @@ -32,6 +32,13 @@ extern const volatile char kFuseWire[]; TEMPLATE_CC = """ #include "electron/fuses.h" +#include "base/dcheck_is_on.h" + +#if DCHECK_IS_ON() +#include "base/command_line.h" +#include "base/strings/string_util.h" +#include <string> +#endif namespace electron::fuses { @@ -66,9 +73,20 @@ for fuse in fuses: getters_h += "FUSE_EXPORT bool Is{name}Enabled();\n".replace("{name}", name) getters_cc += """ bool Is{name}Enabled() { +#if DCHECK_IS_ON() + // RunAsNode is checked so early that base::CommandLine isn't yet + // initialized, so guard here to avoid a CHECK. + if (base::CommandLine::InitializedForCurrentProcess()) { + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch("{switch_name}")) { + std::string switch_value = command_line->GetSwitchValueASCII("{switch_name}"); + return switch_value == "1"; + } + } +#endif return kFuseWire[{index}] == '1'; } -""".replace("{name}", name).replace("{index}", str(index)) +""".replace("{name}", name).replace("{switch_name}", f"set-fuse-{fuse.lower()}").replace("{index}", str(index)) def c_hex(n): s = hex(n)[2:] diff --git a/shell/browser/protocol_registry.cc b/shell/browser/protocol_registry.cc index 9bd6c4ac1e..f794e8de75 100644 --- a/shell/browser/protocol_registry.cc +++ b/shell/browser/protocol_registry.cc @@ -6,6 +6,7 @@ #include "base/stl_util.h" #include "content/public/browser/web_contents.h" +#include "electron/fuses.h" #include "shell/browser/electron_browser_context.h" #include "shell/browser/net/asar/asar_url_loader_factory.h" @@ -24,18 +25,21 @@ ProtocolRegistry::~ProtocolRegistry() = default; void ProtocolRegistry::RegisterURLLoaderFactories( content::ContentBrowserClient::NonNetworkURLLoaderFactoryMap* factories, bool allow_file_access) { - auto file_factory = factories->find(url::kFileScheme); - if (file_factory != factories->end()) { - // If Chromium already allows file access then replace the url factory to - // also loading asar files. - file_factory->second = AsarURLLoaderFactory::Create(); - } else if (allow_file_access) { - // Otherwise only allow file access when it is explicitly allowed. - // - // Note that Chromium may call |emplace| to create the default file factory - // after this call, it won't override our asar factory, but if asar support - // breaks in future, please check if Chromium has changed the call. - factories->emplace(url::kFileScheme, AsarURLLoaderFactory::Create()); + if (electron::fuses::IsGrantFileProtocolExtraPrivilegesEnabled()) { + auto file_factory = factories->find(url::kFileScheme); + if (file_factory != factories->end()) { + // If Chromium already allows file access then replace the url factory to + // also loading asar files. + file_factory->second = AsarURLLoaderFactory::Create(); + } else if (allow_file_access) { + // Otherwise only allow file access when it is explicitly allowed. + // + // Note that Chromium may call |emplace| to create the default file + // factory after this call, it won't override our asar factory, but if + // asar support breaks in future, please check if Chromium has changed the + // call. + factories->emplace(url::kFileScheme, AsarURLLoaderFactory::Create()); + } } for (const auto& it : handlers_) { diff --git a/spec/fixtures/apps/remote-control/main.js b/spec/fixtures/apps/remote-control/main.js index 668e9ae6fb..b2b6f4b4fb 100644 --- a/spec/fixtures/apps/remote-control/main.js +++ b/spec/fixtures/apps/remote-control/main.js @@ -1,4 +1,7 @@ -const { app } = require('electron'); +// eslint-disable-next-line camelcase +const electron_1 = require('electron'); +// eslint-disable-next-line camelcase +const { app } = electron_1; const http = require('node:http'); const v8 = require('node:v8'); // eslint-disable-next-line camelcase,@typescript-eslint/no-unused-vars diff --git a/spec/fuses-spec.ts b/spec/fuses-spec.ts new file mode 100644 index 0000000000..fe3955732e --- /dev/null +++ b/spec/fuses-spec.ts @@ -0,0 +1,28 @@ +import { expect } from 'chai'; +import { startRemoteControlApp } from './lib/spec-helpers'; +import { once } from 'node:events'; +import { spawn } from 'node:child_process'; +import { BrowserWindow } from 'electron'; +import path = require('node:path'); + +describe('fuses', () => { + it('can be enabled by command-line argument during testing', async () => { + const child0 = spawn(process.execPath, ['-v'], { env: { NODE_OPTIONS: '-e 0' } }); + const [code0] = await once(child0, 'exit'); + // Should exit with 9 because -e is not allowed in NODE_OPTIONS + expect(code0).to.equal(9); + const child1 = spawn(process.execPath, ['--set-fuse-node_options=0', '-v'], { env: { NODE_OPTIONS: '-e 0' } }); + const [code1] = await once(child1, 'exit'); + // Should print the version and exit with 0 + expect(code1).to.equal(0); + }); + + it('disables fetching file:// URLs when grant_file_protocol_extra_privileges is 0', async () => { + const rc = await startRemoteControlApp(['--set-fuse-grant_file_protocol_extra_privileges=0']); + await expect(rc.remotely(async (fixture: string) => { + const bw = new BrowserWindow({ show: false }); + await bw.loadFile(fixture); + return await bw.webContents.executeJavaScript("ajax('file:///etc/passwd')"); + }, path.join(__dirname, 'fixtures', 'pages', 'fetch.html'))).to.eventually.be.rejectedWith('Failed to fetch'); + }); +});
fix
29270f3df5e7044c67eba80886234a58ceea4b9b
John Kleinschmidt
2023-10-18 06:33:24
test: fixup node force colors test (#40241) * test: fixup node force colors test * chore: update patches --------- Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
diff --git a/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch b/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch index cd5f4df647..ea1f2520da 100644 --- a/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch +++ b/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch @@ -11,7 +11,7 @@ trying to see whether or not the lines are greyed out. One possibility would be to upstream a changed test that doesn't hardcode line numbers. diff --git a/test/fixtures/errors/force_colors.snapshot b/test/fixtures/errors/force_colors.snapshot -index 4c33acbc2d5c12ac8750b72e0796284176af3da2..56fae731aeec1f3a2870fba56eb0fb24e5d4b87f 100644 +index 4c33acbc2d5c12ac8750b72e0796284176af3da2..035f00b0a4a76a606ba707617b56c9beb074052e 100644 --- a/test/fixtures/errors/force_colors.snapshot +++ b/test/fixtures/errors/force_colors.snapshot @@ -4,11 +4,12 @@ throw new Error('Should include grayed stack trace') @@ -27,7 +27,7 @@ index 4c33acbc2d5c12ac8750b72e0796284176af3da2..56fae731aeec1f3a2870fba56eb0fb24 + at Module._extensions..js (node:internal*modules*cjs*loader:1326:10) + at Module.load (node:internal*modules*cjs*loader:1126:32) + at Module._load (node:internal*modules*cjs*loader:967:12) -+ at Module._load (node:electron*js2c*asar_bundle:763:32) ++ at Module._load (node:electron*js2c*asar_bundle:775:32) + at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:101:12)  at node:internal*main*run_main_module:23:47
test
87bd665e4192b998c11982ac83c604466897fcd0
Sam Maddock
2024-10-18 16:07:06
feat: expose frame & move properties to console-message event object (#43617) * feat: expose frame on console-message event refactor: use property names similar to ServiceWorker's console-message event refactor: don't use deprecated params in tests doc: console-message breaking change chore: add deprecation warning docs: restore deprecated argument descriptions * move console-message deprecations to v34 --------- Co-authored-by: John Kleinschmidt <[email protected]>
diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index e76ecf0587..000c6b9a76 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -955,11 +955,17 @@ Emitted when a `<webview>` has been attached to this web contents. Returns: -* `event` Event -* `level` Integer - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`. -* `message` string - The actual console message -* `line` Integer - The line number of the source that triggered this console message -* `sourceId` string +* `details` Event\<\> + * `message` string - Message text + * `level` string - Message severity + Possible values include `info`, `warning`, `error`, and `debug`. + * `lineNumber` Integer - Line number in the log source + * `sourceId` string - URL of the log source + * `frame` WebFrameMain - Frame that logged the message +* `level` Integer _Deprecated_ - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`. +* `message` string _Deprecated_ - The actual console message +* `line` Integer _Deprecated_ - The line number of the source that triggered this console message +* `sourceId` string _Deprecated_ Emitted when the associated window logs a console message. diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index d8dcb2e98e..9e32e6e8b4 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -12,6 +12,23 @@ This document uses the following convention to categorize breaking changes: * **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release. * **Removed:** An API or feature was removed, and is no longer supported by Electron. +## Planned Breaking API Changes (34.0) + +### Deprecated: `level`, `message`, `line`, and `sourceId` arguments in `console-message` event on `WebContents` + +The `console-message` event on `WebContents` has been updated to provide details on the `Event` +argument. + +```js +// Deprecated +webContents.on('console-message', (event, level, message, line, sourceId) => {}) + +// Replace with: +webContents.on('console-message', ({ level, message, lineNumber, sourceId, frame }) => {}) +``` + +Additionally, `level` is now a string with possible values of `info`, `warning`, `error`, and `debug`. + ## Planned Breaking API Changes (33.0) ### Behavior Changed: frame properties may retrieve detached WebFrameMain instances or none at all diff --git a/lib/browser/api/web-contents.ts b/lib/browser/api/web-contents.ts index ed519db1e8..55b78302bd 100644 --- a/lib/browser/api/web-contents.ts +++ b/lib/browser/api/web-contents.ts @@ -549,6 +549,8 @@ WebContents.prototype.goToOffset = function (index: number) { return this._goToOffset(index); }; +const consoleMessageDeprecated = deprecate.warnOnceMessage('\'console-message\' arguments are deprecated and will be removed. Please use Event<WebContentsConsoleMessageEventParams> object instead.'); + // Add JavaScript wrappers for WebContents class. WebContents.prototype._init = function () { const prefs = this.getLastWebPreferences() || {}; @@ -909,6 +911,15 @@ WebContents.prototype._init = function () { openDialogs.clear(); }); + // TODO(samuelmaddock): remove deprecated 'console-message' arguments + this.on('-console-message' as any, (event: Electron.Event<Electron.WebContentsConsoleMessageEventParams>) => { + const hasDeprecatedListener = this.listeners('console-message').some(listener => listener.length > 1); + if (hasDeprecatedListener) { + consoleMessageDeprecated(); + } + this.emit('console-message', event, (event as any)._level, event.message, event.lineNumber, event.sourceId); + }); + app.emit('web-contents-created', { sender: this, preventDefault () {}, get defaultPrevented () { return false; } }, this); // Properties diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 1cbd5502a6..fb8d3ff541 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -1068,14 +1068,31 @@ void WebContents::Close(std::optional<gin_helper::Dictionary> options) { } } -bool WebContents::DidAddMessageToConsole( - content::WebContents* source, +void WebContents::OnDidAddMessageToConsole( + content::RenderFrameHost* source_frame, blink::mojom::ConsoleMessageLevel level, const std::u16string& message, int32_t line_no, - const std::u16string& source_id) { - return Emit("console-message", static_cast<int32_t>(level), message, line_no, - source_id); + const std::u16string& source_id, + const std::optional<std::u16string>& untrusted_stack_trace) { + v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); + v8::HandleScope handle_scope(isolate); + + gin::Handle<gin_helper::internal::Event> event = + gin_helper::internal::Event::New(isolate); + v8::Local<v8::Object> event_object = event.ToV8().As<v8::Object>(); + + gin_helper::Dictionary dict(isolate, event_object); + dict.SetGetter("frame", source_frame); + dict.Set("level", level); + dict.Set("message", message); + dict.Set("lineNumber", line_no); + dict.Set("sourceId", source_id); + + // TODO(samuelmaddock): Delete when deprecated arguments are fully removed. + dict.Set("_level", static_cast<int32_t>(level)); + + EmitWithoutEvent("-console-message", event); } void WebContents::OnCreateWindow( diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 44252d7ba5..fd8fbc065b 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -530,11 +530,6 @@ class WebContents final : public ExclusiveAccessContext, #endif // content::WebContentsDelegate: - bool DidAddMessageToConsole(content::WebContents* source, - blink::mojom::ConsoleMessageLevel level, - const std::u16string& message, - int32_t line_no, - const std::u16string& source_id) override; bool IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, @@ -680,6 +675,13 @@ class WebContents final : public ExclusiveAccessContext, content::RenderWidgetHost* render_widget_host) override; void OnWebContentsLostFocus( content::RenderWidgetHost* render_widget_host) override; + void OnDidAddMessageToConsole( + content::RenderFrameHost* source_frame, + blink::mojom::ConsoleMessageLevel level, + const std::u16string& message, + int32_t line_no, + const std::u16string& source_id, + const std::optional<std::u16string>& untrusted_stack_trace) override; // InspectableWebContentsDelegate: void DevToolsReloadPage() override; diff --git a/shell/common/gin_converters/blink_converter.cc b/shell/common/gin_converters/blink_converter.cc index c0d2648e08..5098599e98 100644 --- a/shell/common/gin_converters/blink_converter.cc +++ b/shell/common/gin_converters/blink_converter.cc @@ -28,6 +28,7 @@ #include "third_party/blink/public/common/input/web_mouse_event.h" #include "third_party/blink/public/common/input/web_mouse_wheel_event.h" #include "third_party/blink/public/common/widget/device_emulation_params.h" +#include "third_party/blink/public/mojom/devtools/console_message.mojom.h" #include "third_party/blink/public/mojom/loader/referrer.mojom.h" #include "ui/base/clipboard/clipboard.h" #include "ui/events/blink/blink_event_util.h" @@ -699,4 +700,18 @@ bool Converter<blink::CloneableMessage>::FromV8(v8::Isolate* isolate, return electron::SerializeV8Value(isolate, val, out); } +// static +v8::Local<v8::Value> Converter<blink::mojom::ConsoleMessageLevel>::ToV8( + v8::Isolate* isolate, + const blink::mojom::ConsoleMessageLevel& in) { + using Val = blink::mojom::ConsoleMessageLevel; + static constexpr auto Lookup = base::MakeFixedFlatMap<Val, std::string_view>({ + {Val::kVerbose, "debug"}, + {Val::kInfo, "info"}, + {Val::kWarning, "warning"}, + {Val::kError, "error"}, + }); + return StringToV8(isolate, Lookup.at(in)); +} + } // namespace gin diff --git a/shell/common/gin_converters/blink_converter.h b/shell/common/gin_converters/blink_converter.h index 1dd38e9de4..f293181c4a 100644 --- a/shell/common/gin_converters/blink_converter.h +++ b/shell/common/gin_converters/blink_converter.h @@ -10,6 +10,7 @@ #include "third_party/blink/public/common/input/web_input_event.h" #include "third_party/blink/public/common/messaging/cloneable_message.h" #include "third_party/blink/public/common/web_cache/web_cache_resource_type_stats.h" +#include "third_party/blink/public/mojom/devtools/console_message.mojom-forward.h" #include "third_party/blink/public/mojom/loader/referrer.mojom-forward.h" namespace blink { @@ -126,6 +127,12 @@ struct Converter<blink::CloneableMessage> { blink::CloneableMessage* out); }; +template <> +struct Converter<blink::mojom::ConsoleMessageLevel> { + static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, + const blink::mojom::ConsoleMessageLevel& in); +}; + v8::Local<v8::Value> EditFlagsToV8(v8::Isolate* isolate, int editFlags); v8::Local<v8::Value> MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags); diff --git a/spec/api-protocol-spec.ts b/spec/api-protocol-spec.ts index 1ebcd855fd..300706a647 100644 --- a/spec/api-protocol-spec.ts +++ b/spec/api-protocol-spec.ts @@ -977,7 +977,7 @@ describe('protocol module', () => { contextIsolation: false }); const consoleMessages: string[] = []; - newContents.on('console-message', (e, level, message) => consoleMessages.push(message)); + newContents.on('console-message', (e) => consoleMessages.push(e.message)); try { newContents.loadURL(standardScheme + '://fake-host'); const [, response] = await once(ipcMain, 'response'); @@ -1631,7 +1631,7 @@ describe('protocol module', () => { defer(() => { protocol.unhandle('cors'); }); await contents.loadFile(path.resolve(fixturesPath, 'pages', 'base-page.html')); - contents.on('console-message', (e, level, message) => console.log(message)); + contents.on('console-message', (e) => console.log(e.message)); const ok = await contents.executeJavaScript(`(async () => { function wait(milliseconds) { return new Promise((resolve) => setTimeout(resolve, milliseconds)); diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index 2e584c309c..b074c31dab 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -1965,9 +1965,9 @@ describe('webContents module', () => { afterEach(closeAllWindows); it('is triggered with correct log message', (done) => { const w = new BrowserWindow({ show: true }); - w.webContents.on('console-message', (e, level, message) => { + w.webContents.on('console-message', (e) => { // Don't just assert as Chromium might emit other logs that we should ignore. - if (message === 'a') { + if (e.message === 'a') { done(); } }); diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index ce7f6e5023..049504001b 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -379,7 +379,7 @@ describe('web security', () => { console.log(e.message) } </script>`); - const [,, message] = await once(w.webContents, 'console-message'); + const [{ message }] = await once(w.webContents, 'console-message'); expect(message).to.match(/Refused to evaluate a string/); }); @@ -399,7 +399,7 @@ describe('web security', () => { console.log(e.message) } </script>`); - const [,, message] = await once(w.webContents, 'console-message'); + const [{ message }] = await once(w.webContents, 'console-message'); expect(message).to.equal('true'); }); @@ -1428,7 +1428,7 @@ describe('chromium features', () => { w.loadURL('about:blank'); w.webContents.executeJavaScript('window.child = window.open(); child.opener = null'); const [, { webContents }] = await once(app, 'browser-window-created'); - const [,, message] = await once(webContents, 'console-message'); + const [{ message }] = await once(webContents, 'console-message'); expect(message).to.equal('{"require":"function","module":"object","exports":"object","process":"object","Buffer":"function"}'); }); diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index 6d78104cde..a8cea93bbe 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -111,7 +111,7 @@ describe('chrome extensions', () => { const message = { method: 'query' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.have.lengthOf(1); @@ -434,7 +434,7 @@ describe('chrome extensions', () => { const message = { method: 'executeScript', args: ['1 + 2'] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.equal(3); @@ -448,7 +448,7 @@ describe('chrome extensions', () => { const message = { method: 'connectTab', args: [portName] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = responseString.split(','); expect(response[0]).to.equal(portName); expect(response[1]).to.equal('howdy'); @@ -461,7 +461,7 @@ describe('chrome extensions', () => { const message = { method: 'sendMessage', args: ['Hello World!'] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response.message).to.equal('Hello World!'); @@ -480,7 +480,7 @@ describe('chrome extensions', () => { const message = { method: 'update', args: [w2.webContents.id, { url }] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); await w2Navigated; @@ -801,7 +801,7 @@ describe('chrome extensions', () => { w.webContents.executeJavaScript('window.postMessage(\'fetch-confirmation\', \'*\')'); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const { message } = JSON.parse(responseString); expect(message).to.equal('Hello from background.js'); @@ -834,7 +834,7 @@ describe('chrome extensions', () => { const message = { method: 'getAcceptLanguages' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.be.an('array').that.is.not.empty('languages array is empty'); @@ -846,7 +846,7 @@ describe('chrome extensions', () => { const message = { method: 'getUILanguage' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.be.a('string'); @@ -858,7 +858,7 @@ describe('chrome extensions', () => { const message = { method: 'getMessage' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.equal('Hola mundo!!'); @@ -877,7 +877,7 @@ describe('chrome extensions', () => { const message = { method: 'detectLanguage', args: [greetings] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.be.an('array'); @@ -925,7 +925,7 @@ describe('chrome extensions', () => { const message = { method: 'isEnabled' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.equal(false); @@ -937,7 +937,7 @@ describe('chrome extensions', () => { const message = { method: 'setIcon' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.equal(null); @@ -949,7 +949,7 @@ describe('chrome extensions', () => { const message = { method: 'getBadgeText' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.equal(''); @@ -982,7 +982,7 @@ describe('chrome extensions', () => { const message = { method: 'getZoom' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.equal(1); @@ -994,7 +994,7 @@ describe('chrome extensions', () => { const message = { method: 'setZoom', args: [2] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.deep.equal(2); @@ -1006,7 +1006,7 @@ describe('chrome extensions', () => { const message = { method: 'getZoomSettings' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.deep.equal({ @@ -1022,7 +1022,7 @@ describe('chrome extensions', () => { const message = { method: 'setZoomSettings', args: [{ mode: 'disabled' }] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.deep.equal({ @@ -1039,7 +1039,7 @@ describe('chrome extensions', () => { const message = { method: 'get' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.have.property('url').that.is.a('string'); @@ -1065,7 +1065,7 @@ describe('chrome extensions', () => { await w.loadURL(url); w.webContents.executeJavaScript('window.postMessage(\'{}\', \'*\')'); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).not.to.have.property('url'); expect(response).not.to.have.property('title'); @@ -1092,7 +1092,7 @@ describe('chrome extensions', () => { const consoleMessage = once(w.webContents, 'console-message'); const finish = once(w.webContents, 'did-finish-load'); - await Promise.all([consoleMessage, finish]).then(([[,, responseString]]) => { + await Promise.all([consoleMessage, finish]).then(([[{ message: responseString }]]) => { const response = JSON.parse(responseString); expect(response.status).to.equal('reloaded'); }); @@ -1105,7 +1105,7 @@ describe('chrome extensions', () => { const message = { method: 'update', args: [{ muted: true }] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.have.property('mutedInfo').that.is.a('object'); @@ -1122,7 +1122,7 @@ describe('chrome extensions', () => { const message = { method: 'update', args: [{ url: 'chrome://crash' }] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const { error } = JSON.parse(responseString); expect(error).to.eq('I\'m sorry. I\'m afraid I can\'t do that.'); }); @@ -1133,7 +1133,7 @@ describe('chrome extensions', () => { const message = { method: 'update', args: [{ url: 'chrome://crash' }] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const { error } = JSON.parse(responseString); expect(error).to.eq('I\'m sorry. I\'m afraid I can\'t do that.'); }); @@ -1144,7 +1144,7 @@ describe('chrome extensions', () => { const message = { method: 'update', args: [{ url: 'devtools://blah' }] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const { error } = JSON.parse(responseString); expect(error).to.eq('Cannot navigate to a devtools:// page without either the devtools or debugger permission.'); }); @@ -1155,7 +1155,7 @@ describe('chrome extensions', () => { const message = { method: 'update', args: [{ url: 'chrome-untrusted://blah' }] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const { error } = JSON.parse(responseString); expect(error).to.eq('Cannot navigate to a chrome-untrusted:// page.'); }); @@ -1166,7 +1166,7 @@ describe('chrome extensions', () => { const message = { method: 'update', args: [{ url: 'file://blah' }] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const { error } = JSON.parse(responseString); expect(error).to.eq('Cannot navigate to a file URL without local file access.'); }); @@ -1183,7 +1183,7 @@ describe('chrome extensions', () => { const message = { method: 'query', args: [{ muted: true }] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.have.lengthOf(1); @@ -1220,7 +1220,7 @@ describe('chrome extensions', () => { const message = { method: 'query', args: [{ muted: true }] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [, , responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.have.lengthOf(2); for (const tab of response) { @@ -1270,7 +1270,7 @@ describe('chrome extensions', () => { const message = { method: 'registerContentScripts' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.be.an('array').with.lengthOf(1); expect(response[0]).to.deep.equal({ @@ -1290,7 +1290,7 @@ describe('chrome extensions', () => { const message = { method: 'globalParams' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.deep.equal({ changed: true }); }); @@ -1304,7 +1304,7 @@ describe('chrome extensions', () => { const message = { method: 'insertCSS' }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [{ message: responseString }] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response.success).to.be.true(); diff --git a/spec/fixtures/api/context-bridge/context-bridge-mutability/main.js b/spec/fixtures/api/context-bridge/context-bridge-mutability/main.js index 41e4ac1222..7eb4cf264e 100644 --- a/spec/fixtures/api/context-bridge/context-bridge-mutability/main.js +++ b/spec/fixtures/api/context-bridge/context-bridge-mutability/main.js @@ -13,8 +13,8 @@ app.whenReady().then(function () { win.loadFile('index.html'); - win.webContents.on('console-message', (event, level, message) => { - console.log(message); + win.webContents.on('console-message', (event) => { + console.log(event.message); }); win.webContents.on('did-finish-load', () => app.quit()); diff --git a/spec/security-warnings-spec.ts b/spec/security-warnings-spec.ts index 19e563b41d..3ca40ef325 100644 --- a/spec/security-warnings-spec.ts +++ b/spec/security-warnings-spec.ts @@ -75,7 +75,7 @@ describe('security warnings', () => { }); w.loadURL(`${serverUrl}/base-page-security.html`); - const [,, message] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); + const [{ message }] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); expect(message).to.include('Node.js Integration with Remote Content'); }); @@ -88,7 +88,7 @@ describe('security warnings', () => { }); w.loadURL(`${serverUrl}/base-page-security-onload-message.html`); - const [,, message] = await emittedUntil(w.webContents, 'console-message', isLoaded); + const [{ message }] = await emittedUntil(w.webContents, 'console-message', isLoaded); expect(message).to.not.include('Node.js Integration with Remote Content'); }); @@ -104,7 +104,7 @@ describe('security warnings', () => { }); w.loadURL(`${serverUrl}/base-page-security.html`); - const [,, message] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); + const [{ message }] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); expect(message).to.include('Disabled webSecurity'); }); @@ -116,7 +116,7 @@ describe('security warnings', () => { useCsp = false; w.loadURL(`${serverUrl}/base-page-security.html`); - const [,, message] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); + const [{ message }] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); expect(message).to.include('Insecure Content-Security-Policy'); }); @@ -146,7 +146,7 @@ describe('security warnings', () => { }); w.loadURL(`${serverUrl}/base-page-security.html`); - const [,, message] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); + const [{ message }] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); expect(message).to.include('allowRunningInsecureContent'); }); @@ -160,7 +160,7 @@ describe('security warnings', () => { }); w.loadURL(`${serverUrl}/base-page-security.html`); - const [,, message] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); + const [{ message }] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); expect(message).to.include('experimentalFeatures'); }); @@ -174,7 +174,7 @@ describe('security warnings', () => { }); w.loadURL(`${serverUrl}/base-page-security.html`); - const [,, message] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); + const [{ message }] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); expect(message).to.include('enableBlinkFeatures'); }); @@ -185,7 +185,7 @@ describe('security warnings', () => { }); w.loadURL(`${serverUrl}/webview-allowpopups.html`); - const [,, message] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); + const [{ message }] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); expect(message).to.include('allowpopups'); }); @@ -196,7 +196,7 @@ describe('security warnings', () => { }); w.loadURL(`${serverUrl}/insecure-resources.html`); - const [,, message] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); + const [{ message }] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); expect(message).to.include('Insecure Resources'); }); @@ -207,7 +207,7 @@ describe('security warnings', () => { }); w.loadURL(`${serverUrl}/insecure-resources.html`); - const [,, message] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); + const [{ message }] = await emittedUntil(w.webContents, 'console-message', messageContainsSecurityWarning); expect(message).to.not.include('insecure-resources.html'); }); });
feat
41ba9633924a14d992f495dee6eac2467def0d35
RoboSchmied
2024-04-10 17:54:56
fix: typos in comment section of `in_app_purchase.mm` (#41788) fix 2 typo Signed-off-by: Michael Seibt <[email protected]>
diff --git a/shell/browser/mac/in_app_purchase.mm b/shell/browser/mac/in_app_purchase.mm index 3ff87a9830..267dc9ef5e 100644 --- a/shell/browser/mac/in_app_purchase.mm +++ b/shell/browser/mac/in_app_purchase.mm @@ -79,10 +79,10 @@ } /** - * Process product informations and start the payment. + * Process product information and start the payment. * * @param request - The product request. - * @param response - The informations about the list of products. + * @param response - The information about the list of products. */ - (void)productsRequest:(SKProductsRequest*)request didReceiveResponse:(SKProductsResponse*)response {
fix
c00eb5d4910286a69ebfcfa4101d4ffcbf909010
David Sanders
2024-05-10 02:00:15
chore: update @electron/lint-roller to 2.1.0 (#42078)
diff --git a/.lint-roller.json b/.lint-roller.json new file mode 100644 index 0000000000..bdbbd9172c --- /dev/null +++ b/.lint-roller.json @@ -0,0 +1,13 @@ +{ + "markdown-ts-check": { + "defaultImports": [ + "import * as childProcess from 'node:child_process'", + "import * as fs from 'node:fs'", + "import * as path from 'node:path'", + "import { app, autoUpdater, contextBridge, crashReporter, dialog, BrowserWindow, ipcMain, ipcRenderer, Menu, MessageChannelMain, nativeImage, net, protocol, session, systemPreferences, Tray, utilityProcess, webFrame, webFrameMain } from 'electron'" + ], + "typings": [ + "../electron.d.ts" + ] + } +} diff --git a/.markdownlint.json b/.markdownlint.json index 9ccf3dd4b2..96357baa52 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,6 +1,7 @@ { "extends": "@electron/lint-roller/configs/markdownlint.json", "no-angle-brackets": true, + "no-curly-braces": true, "no-inline-html": { "allowed_elements": [ "br", diff --git a/docs/api/context-bridge.md b/docs/api/context-bridge.md index 5002874994..d1f00bc5ae 100644 --- a/docs/api/context-bridge.md +++ b/docs/api/context-bridge.md @@ -129,7 +129,7 @@ has been included below for completeness: | `Object` | Complex | ✅ | ✅ | Keys must be supported using only "Simple" types in this table. Values must be supported in this table. Prototype modifications are dropped. Sending custom classes will copy values but not the prototype. | | `Array` | Complex | ✅ | ✅ | Same limitations as the `Object` type | | `Error` | Complex | ✅ | ✅ | Errors that are thrown are also copied, this can result in the message and stack trace of the error changing slightly due to being thrown in a different context, and any custom properties on the Error object [will be lost](https://github.com/electron/electron/issues/25596) | -| `Promise` | Complex | ✅ | ✅ | N/A +| `Promise` | Complex | ✅ | ✅ | N/A | | `Function` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending classes or constructors will not work. | | [Cloneable Types](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) | Simple | ✅ | ✅ | See the linked document on cloneable types | | `Element` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending custom elements will not work. | diff --git a/docs/tutorial/offscreen-rendering.md b/docs/tutorial/offscreen-rendering.md index c6c52bc1d7..5caab67ba1 100644 --- a/docs/tutorial/offscreen-rendering.md +++ b/docs/tutorial/offscreen-rendering.md @@ -82,4 +82,5 @@ app.on('window-all-closed', () => { After launching the Electron application, navigate to your application's working folder, where you'll find the rendered image. + [disablehardwareacceleration]: ../api/app.md#appdisablehardwareacceleration diff --git a/docs/tutorial/progress-bar.md b/docs/tutorial/progress-bar.md index 4f1337b11f..f53b6dc344 100644 --- a/docs/tutorial/progress-bar.md +++ b/docs/tutorial/progress-bar.md @@ -112,4 +112,5 @@ For macOS, the progress bar will also be indicated for your application when using [Mission Control](https://support.apple.com/en-us/HT204100): ![Mission Control Progress Bar](../images/mission-control-progress-bar.png) + [setprogressbar]: ../api/browser-window.md#winsetprogressbarprogress-options diff --git a/package.json b/package.json index dbe1906572..e43f4dca48 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@electron/docs-parser": "^1.2.0", "@electron/fiddle-core": "^1.0.4", "@electron/github-app-auth": "^2.0.0", - "@electron/lint-roller": "^1.12.1", + "@electron/lint-roller": "^2.1.0", "@electron/typescript-definitions": "^8.15.2", "@octokit/rest": "^19.0.7", "@primer/octicons": "^10.0.0", @@ -91,10 +91,10 @@ "lint:gn": "node ./script/lint.js --gn", "lint:docs": "remark docs -qf && npm run lint:js-in-markdown && npm run create-typescript-definitions && npm run lint:ts-check-js-in-markdown && npm run lint:docs-fiddles && npm run lint:docs-relative-links && npm run lint:markdown", "lint:docs-fiddles": "standard \"docs/fiddles/**/*.js\"", - "lint:docs-relative-links": "electron-lint-markdown-links --root docs \"**/*.md\"", + "lint:docs-relative-links": "lint-roller-markdown-links --root docs \"**/*.md\"", "lint:markdown": "node ./script/lint.js --md", - "lint:ts-check-js-in-markdown": "electron-lint-markdown-ts-check --root docs \"**/*.md\" --ignore \"breaking-changes.md\"", - "lint:js-in-markdown": "electron-lint-markdown-standard --root docs \"**/*.md\"", + "lint:ts-check-js-in-markdown": "lint-roller-markdown-ts-check --root docs \"**/*.md\" --ignore \"breaking-changes.md\"", + "lint:js-in-markdown": "lint-roller-markdown-standard --root docs \"**/*.md\"", "create-api-json": "node script/create-api-json.js", "create-typescript-definitions": "npm run create-api-json && electron-typescript-definitions --api=electron-api.json && node spec/ts-smoke/runner.js", "gn-typescript-definitions": "npm run create-typescript-definitions && shx cp electron.d.ts", diff --git a/yarn.lock b/yarn.lock index 0685a0d1de..447123f3c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -199,19 +199,18 @@ "@octokit/auth-app" "^4.0.13" "@octokit/rest" "^19.0.11" -"@electron/lint-roller@^1.12.1": - version "1.12.1" - resolved "https://registry.yarnpkg.com/@electron/lint-roller/-/lint-roller-1.12.1.tgz#3152b9a68815b2ab51cc5a4d462ae6769d5052ce" - integrity sha512-TGgVcHUAooM9/dV3iJTxhmKl35x/gzStsClz2/LWtBQZ59cRK+0YwWF5HWhtydGFIpOLEQGzCvUrty5zZLyd4w== +"@electron/lint-roller@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@electron/lint-roller/-/lint-roller-2.1.0.tgz#984ec017c8d512e77e34749e7f6dc965aec8de06" + integrity sha512-Oxt7CHq7FNujOi5g0nYq3hwVvspnDk/DCp7C+52pHi3Ez7P85K8dY3QlGtm9Dpswm3t7SJmk6m1pfFzXWre1dg== dependencies: "@dsanders11/vscode-markdown-languageservice" "^0.3.0" balanced-match "^2.0.0" glob "^8.1.0" markdown-it "^13.0.1" - markdownlint-cli "^0.33.0" + markdownlint-cli "^0.40.0" mdast-util-from-markdown "^1.3.0" minimist "^1.2.8" - node-fetch "^2.6.9" rimraf "^4.4.1" standard "^17.0.0" unist-util-visit "^4.1.2" @@ -291,6 +290,18 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@jridgewell/gen-mapping@^0.3.0": version "0.3.2" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" @@ -625,6 +636,11 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.0.4.tgz#a167e46c10d05a07ab299fc518793b0cff8f6924" integrity sha512-BuJuXRSJNQ3QoKA6GWWDyuLpOUck+9hAXNMCnrloc1aWVoy6Xq6t9PUV08aBZ4Lutqq2LEHM486bpZqoViScog== +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@primer/octicons@^10.0.0": version "10.0.0" resolved "https://registry.yarnpkg.com/@primer/octicons/-/octicons-10.0.0.tgz#81e94ed32545dfd3472c8625a5b345f3ea4c153d" @@ -1416,7 +1432,7 @@ ansi-regex@^5.0.0, ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-regex@^6.0.0: +ansi-regex@^6.0.0, ansi-regex@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== @@ -1436,6 +1452,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: "@types/color-name" "^1.1.1" color-convert "^2.0.1" +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + anymatch@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.0.3.tgz#2fb624fe0e84bccab00afee3d0006ed310f22f09" @@ -1982,10 +2003,10 @@ commander@^7.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== -commander@~9.4.1: - version "9.4.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" - integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw== +commander@~12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.0.0.tgz#b929db6df8546080adfd004ab215ed48cf6f2592" + integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA== compress-brotli@^1.3.8: version "1.3.8" @@ -2220,6 +2241,11 @@ duplexer@~0.1.1: resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" integrity sha1-rOb/gIwc5mtX0ev5eXessCM0z8E= +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + [email protected]: version "1.0.11" resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" @@ -2293,6 +2319,11 @@ ensure-posix-path@^1.0.0: resolved "https://registry.yarnpkg.com/ensure-posix-path/-/ensure-posix-path-1.1.1.tgz#3c62bdb19fa4681544289edb2b382adc029179ce" integrity sha512-VWU0/zXzVbeJNXvME/5EmLuEj2TauvoaTz6aFYK1Z92JCBlDlZ3Gu0tuGR42kpW1754ywTs+QB0g5TP0oj9Zaw== +entities@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + entities@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" @@ -2997,6 +3028,14 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + form-data@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" @@ -3208,16 +3247,16 @@ glob@^9.2.0: minipass "^4.2.4" path-scurry "^1.6.1" -glob@~8.0.3: - version "8.0.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e" - integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ== +glob@~10.3.12: + version "10.3.12" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.12.tgz#3a65c363c2e9998d220338e88a5f6ac97302960b" + integrity sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg== dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^5.0.1" - once "^1.3.0" + foreground-child "^3.1.0" + jackspeak "^2.3.6" + minimatch "^9.0.1" + minipass "^7.0.4" + path-scurry "^1.10.2" global-agent@^3.0.0: version "3.0.0" @@ -3408,11 +3447,16 @@ ignore@^5.0.0, ignore@^5.1.1: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== -ignore@^5.2.0, ignore@~5.2.4: +ignore@^5.2.0: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== +ignore@~5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" + integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== + import-fresh@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118" @@ -3480,10 +3524,10 @@ ini@^1.3.5: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== -ini@~3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ini/-/ini-3.0.1.tgz#c76ec81007875bc44d544ff7a11a55d12294102d" - integrity sha512-it4HyVAUTKBc6m8e1iXWvXSTdndF7HbdN713+kvLrymxTaU4AUBWrJ4vEooP+V7fexnVD3LKcBshjGGPefSMUQ== +ini@~4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/ini/-/ini-4.1.2.tgz#7f646dbd9caea595e61f88ef60bfff8b01f8130a" + integrity sha512-AMB1mvwR1pyBFY/nSevUX6y8nJWS63/SzUKD3JyQn97s4xgIdgQPT75IRouIiBAN4yLQBUShNYVW0+UG25daCw== internal-slot@^1.0.3, internal-slot@^1.0.5: version "1.0.5" @@ -3775,6 +3819,15 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= +jackspeak@^2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" + integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-worker@^27.4.5: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" @@ -3861,10 +3914,10 @@ json5@^2.0.0, json5@^2.1.2: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== -jsonc-parser@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" - integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== +jsonc-parser@~3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a" + integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA== jsonfile@^4.0.0: version "4.0.0" @@ -3882,6 +3935,11 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" [email protected]: + version "5.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" + integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== + jsonwebtoken@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz#d0faf9ba1cc3a56255fe49c0961a67e520c1926d" @@ -3978,6 +4036,13 @@ linkify-it@^4.0.1: dependencies: uc.micro "^1.0.1" +linkify-it@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421" + integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ== + dependencies: + uc.micro "^2.0.0" + lint-staged@^10.2.11: version "10.2.11" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.2.11.tgz#713c80877f2dc8b609b05bc59020234e766c9720" @@ -4145,6 +4210,11 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lru-cache@^10.2.0: + version "10.2.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878" + integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ== + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -4162,16 +4232,17 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== [email protected], markdown-it@^13.0.1: - version "13.0.1" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-13.0.1.tgz#c6ecc431cacf1a5da531423fc6a42807814af430" - integrity sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q== [email protected]: + version "14.1.0" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45" + integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg== dependencies: argparse "^2.0.1" - entities "~3.0.1" - linkify-it "^4.0.1" - mdurl "^1.0.1" - uc.micro "^1.0.5" + entities "^4.4.0" + linkify-it "^5.0.0" + mdurl "^2.0.0" + punycode.js "^2.3.1" + uc.micro "^2.1.0" markdown-it@^12.0.0: version "12.3.2" @@ -4184,27 +4255,46 @@ markdown-it@^12.0.0: mdurl "^1.0.1" uc.micro "^1.0.5" -markdownlint-cli@^0.33.0: - version "0.33.0" - resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.33.0.tgz#703af1234c32c309ab52fcd0e8bc797a34e2b096" - integrity sha512-zMK1oHpjYkhjO+94+ngARiBBrRDEUMzooDHBAHtmEIJ9oYddd9l3chCReY2mPlecwH7gflQp1ApilTo+o0zopQ== +markdown-it@^13.0.1: + version "13.0.1" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-13.0.1.tgz#c6ecc431cacf1a5da531423fc6a42807814af430" + integrity sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q== dependencies: - commander "~9.4.1" - get-stdin "~9.0.0" - glob "~8.0.3" - ignore "~5.2.4" - js-yaml "^4.1.0" - jsonc-parser "~3.2.0" - markdownlint "~0.27.0" - minimatch "~5.1.2" - run-con "~1.2.11" + argparse "^2.0.1" + entities "~3.0.1" + linkify-it "^4.0.1" + mdurl "^1.0.1" + uc.micro "^1.0.5" -markdownlint@~0.27.0: - version "0.27.0" - resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.27.0.tgz#9dabf7710a4999e2835e3c68317f1acd0bc89049" - integrity sha512-HtfVr/hzJJmE0C198F99JLaeada+646B5SaG2pVoEakLFI6iRGsvMqrnnrflq8hm1zQgwskEgqSnhDW11JBp0w== +markdownlint-cli@^0.40.0: + version "0.40.0" + resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.40.0.tgz#57678cabd543c654d2ea88f752e9ac058b31c207" + integrity sha512-JXhI3dRQcaqwiFYpPz6VJ7aKYheD53GmTz9y4D/d0F1MbZDGOp9pqKlbOfUX/pHP/iAoeiE4wYRmk8/kjLakxA== dependencies: - markdown-it "13.0.1" + commander "~12.0.0" + get-stdin "~9.0.0" + glob "~10.3.12" + ignore "~5.3.1" + js-yaml "^4.1.0" + jsonc-parser "~3.2.1" + jsonpointer "5.0.1" + markdownlint "~0.34.0" + minimatch "~9.0.4" + run-con "~1.3.2" + toml "~3.0.0" + [email protected]: + version "0.1.9" + resolved "https://registry.yarnpkg.com/markdownlint-micromark/-/markdownlint-micromark-0.1.9.tgz#4876996b60d4dceb3a02f4eee2d3a366eb9569fa" + integrity sha512-5hVs/DzAFa8XqYosbEAEg6ok6MF2smDj89ztn9pKkCtdKHVdPQuGMH7frFfYL9mLkvfFe4pTyAMffLbjf3/EyA== + +markdownlint@~0.34.0: + version "0.34.0" + resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.34.0.tgz#bbc2047c952d1644269009a69ba227ed597b23fa" + integrity sha512-qwGyuyKwjkEMOJ10XN6OTKNOVYvOIi35RNvDLNxTof5s8UmyGHlCdpngRHoRGNvQVGuxO3BJ7uNSgdeX166WXw== + dependencies: + markdown-it "14.1.0" + markdownlint-micromark "0.1.9" matcher-collection@^1.0.0: version "1.1.2" @@ -4291,6 +4381,11 @@ mdurl@^1.0.1: resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= +mdurl@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0" + integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w== + [email protected]: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -4600,10 +4695,10 @@ minimatch@^8.0.2: dependencies: brace-expansion "^2.0.1" -minimatch@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.2.tgz#0939d7d6f0898acbd1508abe534d1929368a8fff" - integrity sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg== +minimatch@^9.0.1, minimatch@~9.0.4: + version "9.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" + integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== dependencies: brace-expansion "^2.0.1" @@ -4639,6 +4734,11 @@ minipass@^5.0.0: resolved "https://registry.yarnpkg.com/minipass/-/minipass-6.0.2.tgz#542844b6c4ce95b202c0995b0a471f1229de4c81" integrity sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.4: + version "7.1.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.0.tgz#b545f84af94e567386770159302ca113469c80b8" + integrity sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig== + minizlib@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" @@ -4722,13 +4822,6 @@ node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -node-fetch@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6" - integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg== - dependencies: - whatwg-url "^5.0.0" - node-releases@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" @@ -5039,6 +5132,14 @@ path-parse@^1.0.6, path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.2.tgz#8f6357eb1239d5fa1da8b9f70e9c080675458ba7" + integrity sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry@^1.6.1: version "1.9.2" resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.9.2.tgz#90f9d296ac5e37e608028e28a447b11d385b3f63" @@ -5192,6 +5293,11 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" +punycode.js@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7" + integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA== + [email protected]: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" @@ -5999,14 +6105,14 @@ roarr@^2.15.3: semver-compare "^1.0.0" sprintf-js "^1.1.2" -run-con@~1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/run-con/-/run-con-1.2.11.tgz#0014ed430bad034a60568dfe7de2235f32e3f3c4" - integrity sha512-NEMGsUT+cglWkzEr4IFK21P4Jca45HqiAbIIZIBdX5+UZTB24Mb/21iNGgz9xZa8tL6vbW7CXmq7MFN42+VjNQ== +run-con@~1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/run-con/-/run-con-1.3.2.tgz#755860a10ce326a96b509485fcea50b4d03754e8" + integrity sha512-CcfE+mYiTcKEzg0IqS08+efdnH0oJ3zV0wSUFBNrMHMuxCtXvBCLzCJHatwuXDcu/RlhjTziTo/a1ruQik6/Yg== dependencies: deep-extend "^0.6.0" - ini "~3.0.0" - minimist "^1.2.6" + ini "~4.1.0" + minimist "^1.2.8" strip-json-comments "~3.1.1" run-parallel@^1.1.9: @@ -6203,6 +6309,11 @@ signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + simple-git@^3.5.0: version "3.16.0" resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.16.0.tgz#421773e24680f5716999cc4a1d60127b4b6a9dec" @@ -6343,6 +6454,15 @@ [email protected]: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^4.1.0, string-width@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" @@ -6361,6 +6481,15 @@ string-width@^5.0.0: is-fullwidth-code-point "^4.0.0" strip-ansi "^7.0.0" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.matchall@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" @@ -6425,6 +6554,13 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" @@ -6439,13 +6575,6 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" -strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.0.tgz#1dc49b980c3a4100366617adac59327eefdefcb0" @@ -6453,6 +6582,13 @@ strip-ansi@^7.0.0: dependencies: ansi-regex "^6.0.0" +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -6639,6 +6775,11 @@ [email protected]: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +toml@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" + integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== + tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -6780,6 +6921,11 @@ uc.micro@^1.0.1, uc.micro@^1.0.5: resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== +uc.micro@^2.0.0, uc.micro@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" + integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A== + unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" @@ -7279,6 +7425,15 @@ word-wrap@^1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA== +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -7288,6 +7443,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrapped@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wrapped/-/wrapped-1.0.1.tgz#c783d9d807b273e9b01e851680a938c87c907242"
chore
55e7a47d709ce711e0d9d91b9c8f9d6c4972a839
Fedor Indutny
2024-07-27 10:25:43
fix: always terminate active Node Streams (#43056) `.destroy()` is an important method in the lifecycle of a Node.js Readable stream. It is typically called to reclaim the resources (e.g., close file descriptor). The only situations where calling it manually isn't necessary are when the following events are emitted first: - `end`: natural end of a stream - `error`: stream terminated due to a failure Prior to this commit the ended state was incorrectly tracked together with a pending internal error. It led to situations where the request could get aborted during a read and then get marked as ended (having pending error). With this change we disentangle pending "error" and "destroyed" cases to always properly terminate an active Node.js Readable stream. Co-authored-by: Fedor Indutny <[email protected]>
diff --git a/shell/browser/net/node_stream_loader.cc b/shell/browser/net/node_stream_loader.cc index ca7c6f9820..83709adc09 100644 --- a/shell/browser/net/node_stream_loader.cc +++ b/shell/browser/net/node_stream_loader.cc @@ -43,7 +43,7 @@ NodeStreamLoader::~NodeStreamLoader() { } // Destroy the stream if not already ended - if (!ended_) { + if (!destroyed_) { node::MakeCallback(isolate_, emitter_.Get(isolate_), "destroy", 0, nullptr, {0, 0}); } @@ -63,13 +63,21 @@ void NodeStreamLoader::Start(network::mojom::URLResponseHeadPtr head) { std::nullopt); auto weak = weak_factory_.GetWeakPtr(); - On("end", - base::BindRepeating(&NodeStreamLoader::NotifyComplete, weak, net::OK)); - On("error", base::BindRepeating(&NodeStreamLoader::NotifyComplete, weak, - net::ERR_FAILED)); + On("end", base::BindRepeating(&NodeStreamLoader::NotifyEnd, weak)); + On("error", base::BindRepeating(&NodeStreamLoader::NotifyError, weak)); On("readable", base::BindRepeating(&NodeStreamLoader::NotifyReadable, weak)); } +void NodeStreamLoader::NotifyEnd() { + destroyed_ = true; + NotifyComplete(net::OK); +} + +void NodeStreamLoader::NotifyError() { + destroyed_ = true; + NotifyComplete(net::ERR_FAILED); +} + void NodeStreamLoader::NotifyReadable() { if (!readable_) ReadMore(); @@ -81,7 +89,7 @@ void NodeStreamLoader::NotifyReadable() { void NodeStreamLoader::NotifyComplete(int result) { // Wait until write finishes or fails. if (is_reading_ || is_writing_) { - ended_ = true; + pending_result_ = true; result_ = result; return; } @@ -121,7 +129,7 @@ void NodeStreamLoader::ReadMore() { } readable_ = false; - if (ended_) { + if (pending_result_) { NotifyComplete(result_); } return; @@ -146,7 +154,7 @@ void NodeStreamLoader::ReadMore() { void NodeStreamLoader::DidWrite(MojoResult result) { is_writing_ = false; // We were told to end streaming. - if (ended_) { + if (pending_result_) { NotifyComplete(result_); return; } diff --git a/shell/browser/net/node_stream_loader.h b/shell/browser/net/node_stream_loader.h index 5ca1e9b299..a1e5a71365 100644 --- a/shell/browser/net/node_stream_loader.h +++ b/shell/browser/net/node_stream_loader.h @@ -47,6 +47,8 @@ class NodeStreamLoader : public network::mojom::URLLoader { using EventCallback = base::RepeatingCallback<void()>; void Start(network::mojom::URLResponseHeadPtr head); + void NotifyEnd(); + void NotifyError(); void NotifyReadable(); void NotifyComplete(int result); void ReadMore(); @@ -86,9 +88,13 @@ class NodeStreamLoader : public network::mojom::URLLoader { // When NotifyComplete is called while writing, we will save the result and // quit with it after the write is done. - bool ended_ = false; + bool pending_result_ = false; int result_ = net::OK; + // Set to `true` when we get either `end` or `error` event on the stream. + // If `false` - we call `stream.destroy()` to finalize the stream. + bool destroyed_ = false; + // When the stream emits the readable event, we only want to start reading // data if the stream was not readable before, so we store the state in a // flag. diff --git a/spec/api-protocol-spec.ts b/spec/api-protocol-spec.ts index 3ba77351d8..ab33252c33 100644 --- a/spec/api-protocol-spec.ts +++ b/spec/api-protocol-spec.ts @@ -1194,6 +1194,30 @@ describe('protocol module', () => { expect(body).to.equal(text); }); + it('calls destroy on aborted body stream', async () => { + const abortController = new AbortController(); + + class TestStream extends stream.Readable { + _read () { + this.push('infinite data'); + + // Abort the request that reads from this stream. + abortController.abort(); + } + }; + const body = new TestStream(); + protocol.handle('test-scheme', () => { + return new Response(stream.Readable.toWeb(body) as ReadableStream<ArrayBufferView>); + }); + defer(() => { protocol.unhandle('test-scheme'); }); + + const res = net.fetch('test-scheme://foo', { + signal: abortController.signal + }); + await expect(res).to.be.rejectedWith('This operation was aborted'); + await expect(once(body, 'end')).to.be.rejectedWith('The operation was aborted'); + }); + it('accepts urls with no hostname in non-standard schemes', async () => { protocol.handle('test-scheme', (req) => new Response(req.url)); defer(() => { protocol.unhandle('test-scheme'); });
fix
5ced88a90a6471ceb6d90b8582de2d31f8991132
Max Schmitt
2024-01-24 16:50:55
docs: update Playwright automated-testing guide (#41081)
diff --git a/docs/tutorial/automated-testing.md b/docs/tutorial/automated-testing.md index 5f5c5d76ec..d2c565278c 100644 --- a/docs/tutorial/automated-testing.md +++ b/docs/tutorial/automated-testing.md @@ -196,32 +196,19 @@ support via Electron's support for the [Chrome DevTools Protocol][] (CDP). ### Install dependencies -You can install Playwright through your preferred Node.js package manager. The Playwright team -recommends using the `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` environment variable to avoid -unnecessary browser downloads when testing an Electron app. - -```sh npm2yarn -PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install --save-dev playwright -``` - -Playwright also comes with its own test runner, Playwright Test, which is built for end-to-end -testing. You can also install it as a dev dependency in your project: +You can install Playwright through your preferred Node.js package manager. It comes with its +own [test runner][playwright-intro], which is built for end-to-end testing: ```sh npm2yarn npm install --save-dev @playwright/test ``` :::caution Dependencies -This tutorial was written `[email protected]` and `@playwright/[email protected]`. Check out +This tutorial was written with `@playwright/[email protected]`. Check out [Playwright's releases][playwright-releases] page to learn about changes that might affect the code below. ::: -:::info Using third-party test runners -If you're interested in using an alternative test runner (e.g. Jest or Mocha), check out -Playwright's [Third-Party Test Runner][playwright-test-runners] guide. -::: - ### Write your tests Playwright launches your app in development mode through the `_electron.launch` API. @@ -229,8 +216,7 @@ To point this API to your Electron app, you can pass the path to your main proce entry point (here, it is `main.js`). ```js {5} @ts-nocheck -const { _electron: electron } = require('playwright') -const { test } = require('@playwright/test') +const { test, _electron: electron } = require('@playwright/test') test('launch app', async () => { const electronApp = await electron.launch({ args: ['main.js'] }) @@ -242,9 +228,8 @@ test('launch app', async () => { After that, you will access to an instance of Playwright's `ElectronApp` class. This is a powerful class that has access to main process modules for example: -```js {6-11} @ts-nocheck -const { _electron: electron } = require('playwright') -const { test } = require('@playwright/test') +```js {5-10} @ts-nocheck +const { test, _electron: electron } = require('@playwright/test') test('get isPackaged', async () => { const electronApp = await electron.launch({ args: ['main.js'] }) @@ -263,8 +248,7 @@ It can also create individual [Page][playwright-page] objects from Electron Brow For example, to grab the first BrowserWindow and save a screenshot: ```js {6-7} @ts-nocheck -const { _electron: electron } = require('playwright') -const { test } = require('@playwright/test') +const { test, _electron: electron } = require('@playwright/test') test('save screenshot', async () => { const electronApp = await electron.launch({ args: ['main.js'] }) @@ -275,12 +259,11 @@ test('save screenshot', async () => { }) ``` -Putting all this together using the PlayWright Test runner, let's create a `example.spec.js` +Putting all this together using the Playwright test-runner, let's create a `example.spec.js` test file with a single test and assertion: ```js title='example.spec.js' @ts-nocheck -const { _electron: electron } = require('playwright') -const { test, expect } = require('@playwright/test') +const { test, expect, _electron: electron } = require('@playwright/test') test('example test', async () => { const electronApp = await electron.launch({ args: ['.'] }) @@ -316,6 +299,7 @@ Running 1 test using 1 worker :::info Playwright Test will automatically run any files matching the `.*(test|spec)\.(js|ts|mjs)` regex. You can customize this match in the [Playwright Test configuration options][playwright-test-config]. +It also works with TypeScript out of the box. ::: :::tip Further reading @@ -473,10 +457,10 @@ test.after.always('cleanup', async t => { [chrome-driver]: https://sites.google.com/chromium.org/driver/ [Puppeteer]: https://github.com/puppeteer/puppeteer +[playwright-intro]: https://playwright.dev/docs/intro [playwright-electron]: https://playwright.dev/docs/api/class-electron/ [playwright-electronapplication]: https://playwright.dev/docs/api/class-electronapplication [playwright-page]: https://playwright.dev/docs/api/class-page -[playwright-releases]: https://github.com/microsoft/playwright/releases +[playwright-releases]: https://playwright.dev/docs/release-notes [playwright-test-config]: https://playwright.dev/docs/api/class-testconfig#test-config-test-match -[playwright-test-runners]: https://playwright.dev/docs/test-runners/ [Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
docs
406f644d26904303663f40d7713140267c9981cb
Alice Zhao
2024-06-05 09:34:47
feat: duplicate navigation related APIs to `contents.navigationHistory` (#41752) * refactor: move navigation related api to navigationHistory * docs: add deprecation messages to old web content methods * fix: add deprecation warnings to webcontents * fix: add deprecation warnings and make existing naviagation apis internal * Update docs/api/web-contents.md Co-authored-by: Sam Maddock <[email protected]> * Update docs/api/web-contents.md Co-authored-by: Sam Maddock <[email protected]> * Update docs/api/web-contents.md Co-authored-by: Sam Maddock <[email protected]> * Update docs/api/web-contents.md Co-authored-by: Sam Maddock <[email protected]> * docs: fix links * docs: add breaking change to 31 * docs: move breaking change to 32 * chore: re-run pipeline --------- Co-authored-by: Sam Maddock <[email protected]>
diff --git a/docs/api/navigation-history.md b/docs/api/navigation-history.md index 7eed76851c..9b7c491e19 100644 --- a/docs/api/navigation-history.md +++ b/docs/api/navigation-history.md @@ -9,6 +9,24 @@ Each navigation entry corresponds to a specific page. The indexing system follow ### Instance Methods +#### `navigationHistory.canGoBack()` + +Returns `boolean` - Whether the browser can go back to previous web page. + +#### `navigationHistory.canGoForward()` + +Returns `boolean` - Whether the browser can go forward to next web page. + +#### `navigationHistory.canGoToOffset(offset)` + +* `offset` Integer + +Returns `boolean` - Whether the web page can go to the specified `offset` from the current entry. + +#### `navigationHistory.clear()` + +Clears the navigation history. + #### `navigationHistory.getActiveIndex()` Returns `Integer` - The index of the current page, from which we would go back/forward or reload. @@ -24,6 +42,26 @@ Returns `Object`: If index is out of bounds (greater than history length or less than 0), null will be returned. +#### `navigationHistory.goBack()` + +Makes the browser go back a web page. + +#### `navigationHistory.goForward()` + +Makes the browser go forward a web page. + +#### `navigationHistory.goToIndex(index)` + +* `index` Integer + +Navigates browser to the specified absolute web page index. + +#### `navigationHistory.goToOffset(offset)` + +* `offset` Integer + +Navigates to the specified offset from the current entry. + #### `navigationHistory.length()` Returns `Integer` - History length. diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index bf17202915..9128e0f061 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -1124,44 +1124,60 @@ Reloads the current web page. Reloads current page and ignores cache. -#### `contents.canGoBack()` +#### `contents.canGoBack()` _Deprecated_ Returns `boolean` - Whether the browser can go back to previous web page. -#### `contents.canGoForward()` +**Deprecated:** Should use the new [`contents.navigationHistory.canGoBack`](navigation-history.md#navigationhistorycangoback) API. + +#### `contents.canGoForward()` _Deprecated_ Returns `boolean` - Whether the browser can go forward to next web page. -#### `contents.canGoToOffset(offset)` +**Deprecated:** Should use the new [`contents.navigationHistory.canGoForward`](navigation-history.md#navigationhistorycangoforward) API. + +#### `contents.canGoToOffset(offset)` _Deprecated_ * `offset` Integer Returns `boolean` - Whether the web page can go to `offset`. -#### `contents.clearHistory()` +**Deprecated:** Should use the new [`contents.navigationHistory.canGoToOffset`](navigation-history.md#navigationhistorycangotooffsetoffset) API. + +#### `contents.clearHistory()` _Deprecated_ Clears the navigation history. -#### `contents.goBack()` +**Deprecated:** Should use the new [`contents.navigationHistory.clear`](navigation-history.md#navigationhistoryclear) API. + +#### `contents.goBack()` _Deprecated_ Makes the browser go back a web page. -#### `contents.goForward()` +**Deprecated:** Should use the new [`contents.navigationHistory.goBack`](navigation-history.md#navigationhistorygoback) API. + +#### `contents.goForward()` _Deprecated_ Makes the browser go forward a web page. -#### `contents.goToIndex(index)` +**Deprecated:** Should use the new [`contents.navigationHistory.goForward`](navigation-history.md#navigationhistorygoforward) API. + +#### `contents.goToIndex(index)` _Deprecated_ * `index` Integer Navigates browser to the specified absolute web page index. -#### `contents.goToOffset(offset)` +**Deprecated:** Should use the new [`contents.navigationHistory.goToIndex`](navigation-history.md#navigationhistorygotoindexindex) API. + +#### `contents.goToOffset(offset)` _Deprecated_ * `offset` Integer Navigates to the specified offset from the "current entry". +**Deprecated:** Should use the new [`contents.navigationHistory.goToOffset`](navigation-history.md#navigationhistorygotooffsetoffset) API. + #### `contents.isCrashed()` Returns `boolean` - Whether the renderer process has crashed. diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 1e958e8aa5..7099131f69 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -44,6 +44,32 @@ contextBridge.exposeInMainWorld('electron', { }) ``` +### Deprecated: `clearHistory`, `canGoBack`, `goBack`, `canGoForward`, `goForward`, `canGoToOffset`, `goToOffset` on `WebContents` + +The navigation-related APIs are now deprecated. + +These APIs have been moved to the `navigationHistory` property of `WebContents` to provide a more structured and intuitive interface for managing navigation history. + +```js +// Deprecated +win.webContents.clearHistory() +win.webContents.canGoBack() +win.webContents.goBack() +win.webContents.canGoForward() +win.webContents.goForward() +win.webContents.canGoToOffset() +win.webContents.goToOffset(index) + +// Replace with +win.webContents.navigationHistory.clear() +win.webContents.navigationHistory.canGoBack() +win.webContents.navigationHistory.goBack() +win.webContents.navigationHistory.canGoForward() +win.webContents.navigationHistory.goForward() +win.webContents.navigationHistory.canGoToOffset() +win.webContents.navigationHistory.goToOffset(index) +``` + ## Planned Breaking API Changes (31.0) ### Removed: `WebSQL` support @@ -52,7 +78,7 @@ Chromium has removed support for WebSQL upstream, transitioning it to Android on [Chromium's intent to remove discussion](https://groups.google.com/a/chromium.org/g/blink-dev/c/fWYb6evVA-w/m/wGI863zaAAAJ) for more information. -### Behavior Changed: `nativeImage.toDataURL` will preseve PNG colorspace +### Behavior Changed: `nativeImage.toDataURL` will preserve PNG colorspace PNG decoder implementation has been changed to preserve colorspace data, the encoded data returned from this function now matches it. diff --git a/lib/browser/api/web-contents.ts b/lib/browser/api/web-contents.ts index 97364de7a8..0c5ff37d54 100644 --- a/lib/browser/api/web-contents.ts +++ b/lib/browser/api/web-contents.ts @@ -510,6 +510,54 @@ const environment = process._linkedBinding('electron_common_environment'); const loggingEnabled = () => { return environment.hasVar('ELECTRON_ENABLE_LOGGING') || commandLine.hasSwitch('enable-logging'); }; +// Deprecation warnings for navigation related APIs. +const canGoBackDeprecated = deprecate.warnOnce('webContents.canGoBack', 'webContents.navigationHistory.canGoBack'); +WebContents.prototype.canGoBack = function () { + canGoBackDeprecated(); + return this._canGoBack(); +}; + +const canGoForwardDeprecated = deprecate.warnOnce('webContents.canGoForward', 'webContents.navigationHistory.canGoForward'); +WebContents.prototype.canGoForward = function () { + canGoForwardDeprecated(); + return this._canGoForward(); +}; + +const canGoToOffsetDeprecated = deprecate.warnOnce('webContents.canGoToOffset', 'webContents.navigationHistory.canGoToOffset'); +WebContents.prototype.canGoToOffset = function () { + canGoToOffsetDeprecated(); + return this._canGoToOffset(); +}; + +const clearHistoryDeprecated = deprecate.warnOnce('webContents.clearHistory', 'webContents.navigationHistory.clear'); +WebContents.prototype.clearHistory = function () { + clearHistoryDeprecated(); + return this._clearHistory(); +}; + +const goBackDeprecated = deprecate.warnOnce('webContents.goBack', 'webContents.navigationHistory.goBack'); +WebContents.prototype.goBack = function () { + goBackDeprecated(); + return this._goBack(); +}; + +const goForwardDeprecated = deprecate.warnOnce('webContents.goForward', 'webContents.navigationHistory.goForward'); +WebContents.prototype.goForward = function () { + goForwardDeprecated(); + return this._goForward(); +}; + +const goToIndexDeprecated = deprecate.warnOnce('webContents.goToIndex', 'webContents.navigationHistory.goToIndex'); +WebContents.prototype.goToIndex = function (index: number) { + goToIndexDeprecated(); + return this._goToIndex(index); +}; + +const goToOffsetDeprecated = deprecate.warnOnce('webContents.goToOffset', 'webContents.navigationHistory.goToOffset'); +WebContents.prototype.goToOffset = function (index: number) { + goToOffsetDeprecated(); + return this._goToOffset(index); +}; // Add JavaScript wrappers for WebContents class. WebContents.prototype._init = function () { @@ -537,6 +585,14 @@ WebContents.prototype._init = function () { // maintaining a list of navigation entries for backward and forward navigation. Object.defineProperty(this, 'navigationHistory', { value: { + canGoBack: this._canGoBack.bind(this), + canGoForward: this._canGoForward.bind(this), + canGoToOffset: this._canGoToOffset.bind(this), + clear: this._clearHistory.bind(this), + goBack: this._goBack.bind(this), + goForward: this._goForward.bind(this), + goToIndex: this._goToIndex.bind(this), + goToOffset: this._goToOffset.bind(this), getActiveIndex: this._getActiveIndex.bind(this), length: this._historyLength.bind(this), getEntryAtIndex: this._getNavigationEntryAtIndex.bind(this) diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index b678a24f14..2db8e9a109 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -4276,19 +4276,19 @@ void WebContents::FillObjectTemplate(v8::Isolate* isolate, .SetMethod("isLoadingMainFrame", &WebContents::IsLoadingMainFrame) .SetMethod("isWaitingForResponse", &WebContents::IsWaitingForResponse) .SetMethod("stop", &WebContents::Stop) - .SetMethod("canGoBack", &WebContents::CanGoBack) - .SetMethod("goBack", &WebContents::GoBack) - .SetMethod("canGoForward", &WebContents::CanGoForward) - .SetMethod("goForward", &WebContents::GoForward) - .SetMethod("canGoToOffset", &WebContents::CanGoToOffset) - .SetMethod("goToOffset", &WebContents::GoToOffset) + .SetMethod("_canGoBack", &WebContents::CanGoBack) + .SetMethod("_goBack", &WebContents::GoBack) + .SetMethod("_canGoForward", &WebContents::CanGoForward) + .SetMethod("_goForward", &WebContents::GoForward) + .SetMethod("_canGoToOffset", &WebContents::CanGoToOffset) + .SetMethod("_goToOffset", &WebContents::GoToOffset) .SetMethod("canGoToIndex", &WebContents::CanGoToIndex) - .SetMethod("goToIndex", &WebContents::GoToIndex) + .SetMethod("_goToIndex", &WebContents::GoToIndex) .SetMethod("_getActiveIndex", &WebContents::GetActiveIndex) .SetMethod("_getNavigationEntryAtIndex", &WebContents::GetNavigationEntryAtIndex) .SetMethod("_historyLength", &WebContents::GetHistoryLength) - .SetMethod("clearHistory", &WebContents::ClearHistory) + .SetMethod("_clearHistory", &WebContents::ClearHistory) .SetMethod("isCrashed", &WebContents::IsCrashed) .SetMethod("forcefullyCrashRenderer", &WebContents::ForcefullyCrashRenderer) diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index a54990fcb8..3c98d6a35b 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -567,6 +567,84 @@ describe('webContents module', () => { w = new BrowserWindow({ show: false }); }); afterEach(closeAllWindows); + describe('navigationHistory.canGoBack and navigationHistory.goBack API', () => { + it('should not be able to go back if history is empty', async () => { + expect(w.webContents.navigationHistory.canGoBack()).to.be.false(); + }); + + it('should be able to go back if history is not empty', async () => { + await w.loadURL(urlPage1); + await w.loadURL(urlPage2); + expect(w.webContents.navigationHistory.getActiveIndex()).to.equal(1); + expect(w.webContents.navigationHistory.canGoBack()).to.be.true(); + w.webContents.navigationHistory.goBack(); + expect(w.webContents.navigationHistory.getActiveIndex()).to.equal(0); + }); + }); + + describe('navigationHistory.canGoForward and navigationHistory.goForward API', () => { + it('should not be able to go forward if history is empty', async () => { + expect(w.webContents.navigationHistory.canGoForward()).to.be.false(); + }); + + it('should not be able to go forward if current index is same as history length', async () => { + await w.loadURL(urlPage1); + await w.loadURL(urlPage2); + expect(w.webContents.navigationHistory.canGoForward()).to.be.false(); + }); + + it('should be able to go forward if history is not empty and active index is less than history length', async () => { + await w.loadURL(urlPage1); + await w.loadURL(urlPage2); + w.webContents.navigationHistory.goBack(); + expect(w.webContents.navigationHistory.getActiveIndex()).to.equal(0); + expect(w.webContents.navigationHistory.canGoForward()).to.be.true(); + w.webContents.navigationHistory.goForward(); + expect(w.webContents.navigationHistory.getActiveIndex()).to.equal(1); + }); + }); + + describe('navigationHistory.canGoToOffset(index) and navigationHistory.goToOffset(index) API', () => { + it('should not be able to go to invalid offset', async () => { + expect(w.webContents.navigationHistory.canGoToOffset(-1)).to.be.false(); + expect(w.webContents.navigationHistory.canGoToOffset(10)).to.be.false(); + }); + + it('should be able to go to valid negative offset', async () => { + await w.loadURL(urlPage1); + await w.loadURL(urlPage2); + await w.loadURL(urlPage3); + expect(w.webContents.navigationHistory.canGoToOffset(-2)).to.be.true(); + expect(w.webContents.navigationHistory.getActiveIndex()).to.equal(2); + w.webContents.navigationHistory.goToOffset(-2); + expect(w.webContents.navigationHistory.getActiveIndex()).to.equal(0); + }); + + it('should be able to go to valid positive offset', async () => { + await w.loadURL(urlPage1); + await w.loadURL(urlPage2); + await w.loadURL(urlPage3); + + w.webContents.navigationHistory.goBack(); + expect(w.webContents.navigationHistory.canGoToOffset(1)).to.be.true(); + expect(w.webContents.navigationHistory.getActiveIndex()).to.equal(1); + w.webContents.navigationHistory.goToOffset(1); + expect(w.webContents.navigationHistory.getActiveIndex()).to.equal(2); + }); + }); + + describe('navigationHistory.clear API', () => { + it('should be able clear history', async () => { + await w.loadURL(urlPage1); + await w.loadURL(urlPage2); + await w.loadURL(urlPage3); + + expect(w.webContents.navigationHistory.length()).to.equal(3); + w.webContents.navigationHistory.clear(); + expect(w.webContents.navigationHistory.length()).to.equal(1); + }); + }); + describe('navigationHistory.getEntryAtIndex(index) API ', () => { it('should fetch default navigation entry when no urls are loaded', async () => { const result = w.webContents.navigationHistory.getEntryAtIndex(0); diff --git a/typings/internal-electron.d.ts b/typings/internal-electron.d.ts index 21c9ebee29..1f09f9a473 100644 --- a/typings/internal-electron.d.ts +++ b/typings/internal-electron.d.ts @@ -88,6 +88,14 @@ declare namespace Electron { _getNavigationEntryAtIndex(index: number): Electron.EntryAtIndex | null; _getActiveIndex(): number; _historyLength(): number; + _canGoBack(): boolean; + _canGoForward(): boolean; + _canGoToOffset(): boolean; + _goBack(): void; + _goForward(): void; + _goToOffset(index: number): void; + _goToIndex(index: number): void; + _clearHistory():void canGoToIndex(index: number): boolean; destroy(): void; // <webview>
feat
e3e793d25bfa04f3003fdd09cb78c3ff4afc08e7
Bruno Pitrus
2023-09-28 18:49:09
chore: remove invalid constexpr qualification (#40006) GetPathConstant calls base::internal::flat_tree<Key, GetKeyFromValue, KeyCompare, Container>::find(Key const&) const which is not constexpr. GCC 12 and earlier raise a compile error on this.
diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index 675818dfb4..51fe3cffd5 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -433,7 +433,7 @@ IconLoader::IconSize GetIconSizeByString(const std::string& size) { } // Return the path constant from string. -constexpr int GetPathConstant(base::StringPiece name) { +int GetPathConstant(base::StringPiece name) { // clang-format off constexpr auto Lookup = base::MakeFixedFlatMapSorted<base::StringPiece, int>({ {"appData", DIR_APP_DATA},
chore
a8999bc529390e7a9a2515bfa23445b34b10860a
Shelley Vohr
2023-08-23 15:55:31
fix: ensure `BrowserView` bounds are always relative to window (#39605) fix: ensure BrowserView bounds are always relative to window
diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index 22dbf3825a..8bccf457a0 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -768,10 +768,20 @@ void BaseWindow::AddBrowserView(gin::Handle<BrowserView> browser_view) { browser_view->SetOwnerWindow(nullptr); } + // If the user set the BrowserView's bounds before adding it to the window, + // we need to get those initial bounds *before* adding it to the window + // so bounds isn't returned relative despite not being correctly positioned + // relative to the window. + auto bounds = browser_view->GetBounds(); + window_->AddBrowserView(browser_view->view()); window_->AddDraggableRegionProvider(browser_view.get()); browser_view->SetOwnerWindow(this); browser_views_.emplace_back().Reset(isolate(), browser_view.ToV8()); + + // Recalibrate bounds relative to the containing window. + if (!bounds.IsEmpty()) + browser_view->SetBounds(bounds); } } diff --git a/shell/browser/api/electron_api_browser_view.h b/shell/browser/api/electron_api_browser_view.h index 6cf9ee20fd..3025022830 100644 --- a/shell/browser/api/electron_api_browser_view.h +++ b/shell/browser/api/electron_api_browser_view.h @@ -66,6 +66,9 @@ class BrowserView : public gin::Wrappable<BrowserView>, BrowserView(const BrowserView&) = delete; BrowserView& operator=(const BrowserView&) = delete; + gfx::Rect GetBounds(); + void SetBounds(const gfx::Rect& bounds); + protected: BrowserView(gin::Arguments* args, const gin_helper::Dictionary& options); ~BrowserView() override; @@ -78,8 +81,6 @@ class BrowserView : public gin::Wrappable<BrowserView>, private: void SetAutoResize(AutoResizeFlags flags); - void SetBounds(const gfx::Rect& bounds); - gfx::Rect GetBounds(); void SetBackgroundColor(const std::string& color_name); v8::Local<v8::Value> GetWebContents(v8::Isolate*); diff --git a/shell/browser/native_browser_view_mac.mm b/shell/browser/native_browser_view_mac.mm index 14cc582d90..cf63032585 100644 --- a/shell/browser/native_browser_view_mac.mm +++ b/shell/browser/native_browser_view_mac.mm @@ -55,25 +55,27 @@ void NativeBrowserViewMac::SetBounds(const gfx::Rect& bounds) { auto* iwc_view = GetInspectableWebContentsView(); if (!iwc_view) return; + auto* view = iwc_view->GetNativeView().GetNativeNSView(); - auto* superview = view.superview; - const auto superview_height = superview ? superview.frame.size.height : 0; - view.frame = - NSMakeRect(bounds.x(), superview_height - bounds.y() - bounds.height(), - bounds.width(), bounds.height()); + const auto superview_height = + view.superview ? view.superview.frame.size.height : 0; + int y_coord = superview_height - bounds.y() - bounds.height(); + + view.frame = NSMakeRect(bounds.x(), y_coord, bounds.width(), bounds.height()); } gfx::Rect NativeBrowserViewMac::GetBounds() { auto* iwc_view = GetInspectableWebContentsView(); if (!iwc_view) return gfx::Rect(); + NSView* view = iwc_view->GetNativeView().GetNativeNSView(); const int superview_height = - (view.superview) ? view.superview.frame.size.height : 0; - return gfx::Rect( - view.frame.origin.x, - superview_height - view.frame.origin.y - view.frame.size.height, - view.frame.size.width, view.frame.size.height); + view.superview ? view.superview.frame.size.height : 0; + int y_coord = superview_height - view.frame.origin.y - view.frame.size.height; + + return gfx::Rect(view.frame.origin.x, y_coord, view.frame.size.width, + view.frame.size.height); } void NativeBrowserViewMac::SetBackgroundColor(SkColor color) { diff --git a/spec/api-browser-view-spec.ts b/spec/api-browser-view-spec.ts index a45790644b..ec4d5a38aa 100644 --- a/spec/api-browser-view-spec.ts +++ b/spec/api-browser-view-spec.ts @@ -147,6 +147,41 @@ describe('BrowserView module', () => { view.setBounds({} as any); }).to.throw(/conversion failure/); }); + + it('can set bounds after view is added to window', () => { + view = new BrowserView(); + + const bounds = { x: 0, y: 0, width: 50, height: 50 }; + + w.addBrowserView(view); + view.setBounds(bounds); + + expect(view.getBounds()).to.deep.equal(bounds); + }); + + it('can set bounds before view is added to window', () => { + view = new BrowserView(); + + const bounds = { x: 0, y: 0, width: 50, height: 50 }; + + view.setBounds(bounds); + w.addBrowserView(view); + + expect(view.getBounds()).to.deep.equal(bounds); + }); + + it('can update bounds', () => { + view = new BrowserView(); + w.addBrowserView(view); + + const bounds1 = { x: 0, y: 0, width: 50, height: 50 }; + view.setBounds(bounds1); + expect(view.getBounds()).to.deep.equal(bounds1); + + const bounds2 = { x: 0, y: 150, width: 50, height: 50 }; + view.setBounds(bounds2); + expect(view.getBounds()).to.deep.equal(bounds2); + }); }); describe('BrowserView.getBounds()', () => { @@ -156,6 +191,16 @@ describe('BrowserView module', () => { view.setBounds(bounds); expect(view.getBounds()).to.deep.equal(bounds); }); + + it('does not changer after being added to a window', () => { + view = new BrowserView(); + const bounds = { x: 10, y: 20, width: 30, height: 40 }; + view.setBounds(bounds); + expect(view.getBounds()).to.deep.equal(bounds); + + w.addBrowserView(view); + expect(view.getBounds()).to.deep.equal(bounds); + }); }); describe('BrowserWindow.setBrowserView()', () => {
fix
517d04de16701f0cf2a6ffe5d08adcc2c68c45f7
Samuel Attard
2024-09-23 09:39:54
build: add support for fetching github token from sudowoodo (#43808) * build: add support for fetching github token from sudowoodo * chore: update release notes cache for tests * build: support nightlies repo correctly * build: post token
diff --git a/.github/workflows/pipeline-segment-electron-build.yml b/.github/workflows/pipeline-segment-electron-build.yml index e2c5b5b5df..d4755acb7b 100644 --- a/.github/workflows/pipeline-segment-electron-build.yml +++ b/.github/workflows/pipeline-segment-electron-build.yml @@ -67,7 +67,8 @@ concurrency: env: ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }} ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }} - ELECTRON_GITHUB_TOKEN: ${{ secrets.ELECTRON_GITHUB_TOKEN }} + SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }} + SUDOWOODO_EXCHANGE_TOKEN: ${{ secrets.SUDOWOODO_EXCHANGE_TOKEN }} GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }} ELECTRON_OUT_DIR: Default diff --git a/.github/workflows/pipeline-segment-electron-test.yml b/.github/workflows/pipeline-segment-electron-test.yml index b6db08ebb9..eb78dd0dd9 100644 --- a/.github/workflows/pipeline-segment-electron-test.yml +++ b/.github/workflows/pipeline-segment-electron-test.yml @@ -38,7 +38,6 @@ permissions: env: ELECTRON_OUT_DIR: Default ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }} - ELECTRON_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: test: diff --git a/script/release/ci-release-build.js b/script/release/ci-release-build.js index 0ceef891d8..f430d2e77d 100644 --- a/script/release/ci-release-build.js +++ b/script/release/ci-release-build.js @@ -4,8 +4,9 @@ const assert = require('node:assert'); const got = require('got'); const { Octokit } = require('@octokit/rest'); +const { createGitHubTokenStrategy } = require('./github-token'); const octokit = new Octokit({ - auth: process.env.ELECTRON_GITHUB_TOKEN + authStrategy: createGitHubTokenStrategy('electron') }); const BUILD_APPVEYOR_URL = 'https://ci.appveyor.com/api/builds'; diff --git a/script/release/find-github-release.js b/script/release/find-github-release.js index 4f131c3a79..0c382bba82 100644 --- a/script/release/find-github-release.js +++ b/script/release/find-github-release.js @@ -1,9 +1,7 @@ if (!process.env.CI) require('dotenv-safe').load(); const { Octokit } = require('@octokit/rest'); -const octokit = new Octokit({ - auth: process.env.ELECTRON_GITHUB_TOKEN -}); +const { createGitHubTokenStrategy } = require('./github-token'); if (process.argv.length < 3) { console.log('Usage: find-release version'); @@ -13,6 +11,10 @@ if (process.argv.length < 3) { const version = process.argv[2]; const targetRepo = findRepo(); +const octokit = new Octokit({ + authStrategy: createGitHubTokenStrategy(targetRepo) +}); + function findRepo () { return version.indexOf('nightly') > 0 ? 'nightlies' : 'electron'; } diff --git a/script/release/get-asset.js b/script/release/get-asset.js index 086e0bf540..bb9bc90d5d 100644 --- a/script/release/get-asset.js +++ b/script/release/get-asset.js @@ -1,12 +1,13 @@ const { Octokit } = require('@octokit/rest'); const got = require('got'); - -const octokit = new Octokit({ - userAgent: 'electron-asset-fetcher', - auth: process.env.ELECTRON_GITHUB_TOKEN -}); +const { createGitHubTokenStrategy } = require('./github-token'); async function getAssetContents (repo, assetId) { + const octokit = new Octokit({ + userAgent: 'electron-asset-fetcher', + authStrategy: createGitHubTokenStrategy(repo) + }); + const requestOptions = octokit.repos.getReleaseAsset.endpoint({ owner: 'electron', repo, @@ -17,7 +18,7 @@ async function getAssetContents (repo, assetId) { }); const { url, headers } = requestOptions; - headers.authorization = `token ${process.env.ELECTRON_GITHUB_TOKEN}`; + headers.authorization = `token ${(await octokit.auth()).token}`; const response = await got(url, { followRedirect: false, diff --git a/script/release/github-token.js b/script/release/github-token.js new file mode 100644 index 0000000000..bb9b22da30 --- /dev/null +++ b/script/release/github-token.js @@ -0,0 +1,57 @@ +const { createTokenAuth } = require('@octokit/auth-token'); +const got = require('got').default; + +const cachedTokens = Object.create(null); + +async function ensureToken (repo) { + if (!cachedTokens[repo]) { + cachedTokens[repo] = await (async () => { + const { ELECTRON_GITHUB_TOKEN, SUDOWOODO_EXCHANGE_URL, SUDOWOODO_EXCHANGE_TOKEN } = process.env; + if (ELECTRON_GITHUB_TOKEN) { + return ELECTRON_GITHUB_TOKEN; + } + + if (SUDOWOODO_EXCHANGE_URL && SUDOWOODO_EXCHANGE_TOKEN) { + const resp = await got.post(SUDOWOODO_EXCHANGE_URL + '?repo=' + repo, { + headers: { + Authorization: SUDOWOODO_EXCHANGE_TOKEN + }, + throwHttpErrors: false + }); + if (resp.statusCode !== 200) { + console.error('bad sudowoodo exchange response code:', resp.statusCode); + throw new Error('non-200 status code received from sudowoodo exchange function'); + } + try { + return JSON.parse(resp.body).token; + } catch { + // Swallow as the error could include the token + throw new Error('Unexpected error parsing sudowoodo exchange response'); + } + } + + throw new Error('Could not find or fetch a valid GitHub Auth Token'); + })(); + } +} + +module.exports.createGitHubTokenStrategy = (repo) => () => { + let tokenAuth = null; + + async function ensureTokenAuth () { + if (!tokenAuth) { + await ensureToken(repo); + tokenAuth = createTokenAuth(cachedTokens[repo]); + } + } + + async function auth () { + await ensureTokenAuth(); + return await tokenAuth(); + } + auth.hook = async (...args) => { + await ensureTokenAuth(); + return await tokenAuth.hook(...args); + }; + return auth; +}; diff --git a/script/release/notes/index.js b/script/release/notes/index.js index 6dc5454a8f..ca78ab7721 100755 --- a/script/release/notes/index.js +++ b/script/release/notes/index.js @@ -9,8 +9,9 @@ const { ELECTRON_DIR } = require('../../lib/utils'); const notesGenerator = require('./notes.js'); const { Octokit } = require('@octokit/rest'); +const { createGitHubTokenStrategy } = require('../github-token'); const octokit = new Octokit({ - auth: process.env.ELECTRON_GITHUB_TOKEN + authStrategy: createGitHubTokenStrategy('electron') }); const semverify = version => version.replace(/^origin\//, '').replace(/[xy]/g, '0').replace(/-/g, '.'); diff --git a/script/release/notes/notes.js b/script/release/notes/notes.js index b7302e2613..1d406f17aa 100644 --- a/script/release/notes/notes.js +++ b/script/release/notes/notes.js @@ -8,11 +8,13 @@ const path = require('node:path'); const { GitProcess } = require('dugite'); const { Octokit } = require('@octokit/rest'); -const octokit = new Octokit({ - auth: process.env.ELECTRON_GITHUB_TOKEN -}); const { ELECTRON_DIR } = require('../../lib/utils'); +const { createGitHubTokenStrategy } = require('../github-token'); + +const octokit = new Octokit({ + authStrategy: createGitHubTokenStrategy('electron') +}); const MAX_FAIL_COUNT = 3; const CHECK_INTERVAL = 5000; diff --git a/script/release/prepare-release.js b/script/release/prepare-release.js index ed225afd93..ac916ac9a3 100755 --- a/script/release/prepare-release.js +++ b/script/release/prepare-release.js @@ -13,6 +13,7 @@ const path = require('node:path'); const readline = require('node:readline'); const releaseNotesGenerator = require('./notes/index.js'); const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils.js'); +const { createGitHubTokenStrategy } = require('./github-token'); const bumpType = args._[0]; const targetRepo = getRepo(); @@ -21,7 +22,7 @@ function getRepo () { } const octokit = new Octokit({ - auth: process.env.ELECTRON_GITHUB_TOKEN + authStrategy: createGitHubTokenStrategy(getRepo()) }); require('colors'); diff --git a/script/release/publish-to-npm.js b/script/release/publish-to-npm.js index 846384c228..67f01c92e4 100644 --- a/script/release/publish-to-npm.js +++ b/script/release/publish-to-npm.js @@ -10,10 +10,7 @@ const rootPackageJson = require('../../package.json'); const { Octokit } = require('@octokit/rest'); const { getAssetContents } = require('./get-asset'); -const octokit = new Octokit({ - userAgent: 'electron-npm-publisher', - auth: process.env.ELECTRON_GITHUB_TOKEN -}); +const { createGitHubTokenStrategy } = require('./github-token'); if (!process.env.ELECTRON_NPM_OTP) { console.error('Please set ELECTRON_NPM_OTP'); @@ -47,6 +44,11 @@ const currentElectronVersion = getElectronVersion(); const isNightlyElectronVersion = currentElectronVersion.includes('nightly'); const targetRepo = getRepo(); +const octokit = new Octokit({ + userAgent: 'electron-npm-publisher', + authStrategy: createGitHubTokenStrategy(targetRepo) +}); + function getRepo () { return isNightlyElectronVersion ? 'nightlies' : 'electron'; } diff --git a/script/release/release-artifact-cleanup.js b/script/release/release-artifact-cleanup.js index 7d64ef0b16..dd6d31e227 100755 --- a/script/release/release-artifact-cleanup.js +++ b/script/release/release-artifact-cleanup.js @@ -6,16 +6,17 @@ const args = require('minimist')(process.argv.slice(2), { default: { releaseID: '' } }); const { Octokit } = require('@octokit/rest'); - -const octokit = new Octokit({ - auth: process.env.ELECTRON_GITHUB_TOKEN -}); +const { createGitHubTokenStrategy } = require('./github-token'); require('colors'); const pass = '✓'.green; const fail = '✗'.red; async function deleteDraft (releaseId, targetRepo) { + const octokit = new Octokit({ + authStrategy: createGitHubTokenStrategy(targetRepo) + }); + try { const result = await octokit.repos.getRelease({ owner: 'electron', @@ -41,6 +42,10 @@ async function deleteDraft (releaseId, targetRepo) { } async function deleteTag (tag, targetRepo) { + const octokit = new Octokit({ + authStrategy: createGitHubTokenStrategy(targetRepo) + }); + try { await octokit.git.deleteRef({ owner: 'electron', diff --git a/script/release/release.js b/script/release/release.js index 5ebd8614bf..967f7750f0 100755 --- a/script/release/release.js +++ b/script/release/release.js @@ -25,13 +25,10 @@ const fail = '✗'.red; const { ELECTRON_DIR } = require('../lib/utils'); const { getElectronVersion } = require('../lib/get-version'); const getUrlHash = require('./get-url-hash'); +const { createGitHubTokenStrategy } = require('./github-token'); const pkgVersion = `v${getElectronVersion()}`; -const octokit = new Octokit({ - auth: process.env.ELECTRON_GITHUB_TOKEN -}); - function getRepo () { return pkgVersion.indexOf('nightly') > 0 ? 'nightlies' : 'electron'; } @@ -39,6 +36,10 @@ function getRepo () { const targetRepo = getRepo(); let failureCount = 0; +const octokit = new Octokit({ + authStrategy: createGitHubTokenStrategy(targetRepo) +}); + async function getDraftRelease (version, skipValidation) { const releaseInfo = await octokit.repos.listReleases({ owner: 'electron', @@ -392,7 +393,7 @@ async function verifyDraftGitHubReleaseAssets (release) { }); const { url, headers } = requestOptions; - headers.authorization = `token ${process.env.ELECTRON_GITHUB_TOKEN}`; + headers.authorization = `token ${(await octokit.auth()).token}`; const response = await got(url, { followRedirect: false, diff --git a/script/release/uploaders/upload-to-github.ts b/script/release/uploaders/upload-to-github.ts index 5b3443ff08..cfb3d1b8f4 100644 --- a/script/release/uploaders/upload-to-github.ts +++ b/script/release/uploaders/upload-to-github.ts @@ -1,10 +1,6 @@ import { Octokit } from '@octokit/rest'; import * as fs from 'node:fs'; - -const octokit = new Octokit({ - auth: process.env.ELECTRON_GITHUB_TOKEN, - log: console -}); +import { createGitHubTokenStrategy } from '../github-token'; if (!process.env.CI) require('dotenv-safe').load(); @@ -51,6 +47,11 @@ const targetRepo = getRepo(); const uploadUrl = `https://uploads.github.com/repos/electron/${targetRepo}/releases/${releaseId}/assets{?name,label}`; let retry = 0; +const octokit = new Octokit({ + authStrategy: createGitHubTokenStrategy(targetRepo), + log: console +}); + function uploadToGitHub () { console.log(`in uploadToGitHub for ${filePath}, ${fileName}`); const fileData = fs.createReadStream(filePath); diff --git a/spec/fixtures/release-notes/cache/electron-electron-commit-029127a8b6f7c511fca4612748ad5b50e43aadaa b/spec/fixtures/release-notes/cache/electron-electron-commit-029127a8b6f7c511fca4612748ad5b50e43aadaa new file mode 100644 index 0000000000..21e88cd9e0 --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-commit-029127a8b6f7c511fca4612748ad5b50e43aadaa @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/029127a8b6f7c511fca4612748ad5b50e43aadaa/pulls","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"2717","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:37 GMT","etag":"W/\"80e2d0edebd07c0cf53916bf23fee37544d3eb301e1a65595fff37115a465eae\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B2AD:4558739:66ECF364","x-ratelimit-limit":"60","x-ratelimit-remaining":"50","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"10","x-xss-protection":"0"},"data":[{"url":"https://api.github.com/repos/electron/electron/pulls/39745","id":1504592750,"node_id":"PR_kwDOAI8xS85ZrkNu","html_url":"https://github.com/electron/electron/pull/39745","diff_url":"https://github.com/electron/electron/pull/39745.diff","patch_url":"https://github.com/electron/electron/pull/39745.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/39745","number":39745,"state":"closed","locked":false,"title":"chore: bump chromium to 118.0.5993.0 (main)","user":{"login":"electron-roller[bot]","id":84116207,"node_id":"MDM6Qm90ODQxMTYyMDc=","avatar_url":"https://avatars.githubusercontent.com/in/115177?v=4","gravatar_id":"","url":"https://api.github.com/users/electron-roller%5Bbot%5D","html_url":"https://github.com/apps/electron-roller","followers_url":"https://api.github.com/users/electron-roller%5Bbot%5D/followers","following_url":"https://api.github.com/users/electron-roller%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/electron-roller%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/electron-roller%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron-roller%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/electron-roller%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/electron-roller%5Bbot%5D/repos","events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Updating Chromium to 118.0.5993.0.\n\nSee [all changes in 118.0.5991.0..118.0.5993.0](https://chromium.googlesource.com/chromium/src/+log/118.0.5991.0..118.0.5993.0?n=10000&pretty=fuller)\n\n<!--\nOriginal-Version: 118.0.5991.0\n-->\n\nNotes: Updated Chromium to 118.0.5993.0.","created_at":"2023-09-06T13:00:33Z","updated_at":"2023-09-06T23:28:42Z","closed_at":"2023-09-06T23:27:26Z","merged_at":"2023-09-06T23:27:26Z","merge_commit_sha":"029127a8b6f7c511fca4612748ad5b50e43aadaa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1034512799,"node_id":"MDU6TGFiZWwxMDM0NTEyNzk5","url":"https://api.github.com/repos/electron/electron/labels/semver/patch","name":"semver/patch","color":"6ac2dd","default":false,"description":"backwards-compatible bug fixes"},{"id":1243058793,"node_id":"MDU6TGFiZWwxMjQzMDU4Nzkz","url":"https://api.github.com/repos/electron/electron/labels/new-pr%20%F0%9F%8C%B1","name":"new-pr 🌱","color":"8af297","default":false,"description":"PR opened in the last 24 hours"},{"id":2968604945,"node_id":"MDU6TGFiZWwyOTY4NjA0OTQ1","url":"https://api.github.com/repos/electron/electron/labels/no-backport","name":"no-backport","color":"CB07C4","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/39745/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/39745/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/39745/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/7ba0be830a247d916c05d2471c5ce214d2598476","head":{"label":"electron:roller/chromium/main","ref":"roller/chromium/main","sha":"7ba0be830a247d916c05d2471c5ce214d2598476","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"base":{"label":"electron:main","ref":"main","sha":"34b79c15c2f2de2fa514538b7ccb4b3c473808ae","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/39745"},"html":{"href":"https://github.com/electron/electron/pull/39745"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/39745"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/39745/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/39745/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/39745/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/7ba0be830a247d916c05d2471c5ce214d2598476"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null}]} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-commit-8f7a48879ef8633a76279803637cdee7f7c6cd4f b/spec/fixtures/release-notes/cache/electron-electron-commit-8f7a48879ef8633a76279803637cdee7f7c6cd4f new file mode 100644 index 0000000000..ef8d9b637c --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-commit-8f7a48879ef8633a76279803637cdee7f7c6cd4f @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/8f7a48879ef8633a76279803637cdee7f7c6cd4f/pulls","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:38 GMT","etag":"W/\"fc25a1c4edee51c7c227cdb578189b0196dfeea4976c22509630ee1fc0b75919\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","transfer-encoding":"chunked","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B7DF:45590F1:66ECF366","x-ratelimit-limit":"60","x-ratelimit-remaining":"43","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"17","x-xss-protection":"0"},"data":[{"url":"https://api.github.com/repos/electron/electron/pulls/40076","id":1539965204,"node_id":"PR_kwDOAI8xS85bygEU","html_url":"https://github.com/electron/electron/pull/40076","diff_url":"https://github.com/electron/electron/pull/40076.diff","patch_url":"https://github.com/electron/electron/pull/40076.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/40076","number":40076,"state":"closed","locked":false,"title":"chore: bump chromium to 119.0.6045.0 (main)","user":{"login":"electron-roller[bot]","id":84116207,"node_id":"MDM6Qm90ODQxMTYyMDc=","avatar_url":"https://avatars.githubusercontent.com/in/115177?v=4","gravatar_id":"","url":"https://api.github.com/users/electron-roller%5Bbot%5D","html_url":"https://github.com/apps/electron-roller","followers_url":"https://api.github.com/users/electron-roller%5Bbot%5D/followers","following_url":"https://api.github.com/users/electron-roller%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/electron-roller%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/electron-roller%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron-roller%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/electron-roller%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/electron-roller%5Bbot%5D/repos","events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Updating Chromium to 119.0.6045.0.\r\n\r\nSee [all changes in 119.0.6043.0..119.0.6045.0](https://chromium.googlesource.com/chromium/src/+log/119.0.6043.0..119.0.6045.0?n=10000&pretty=fuller)\r\n\r\n<!--\r\nOriginal-Version: 119.0.6043.0\r\n-->\r\n\r\nNotes: Updated Chromium to 119.0.6045.0.","created_at":"2023-10-03T13:00:35Z","updated_at":"2023-10-06T00:56:09Z","closed_at":"2023-10-05T23:59:40Z","merged_at":"2023-10-05T23:59:40Z","merge_commit_sha":"8f7a48879ef8633a76279803637cdee7f7c6cd4f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1034512799,"node_id":"MDU6TGFiZWwxMDM0NTEyNzk5","url":"https://api.github.com/repos/electron/electron/labels/semver/patch","name":"semver/patch","color":"6ac2dd","default":false,"description":"backwards-compatible bug fixes"},{"id":1648234711,"node_id":"MDU6TGFiZWwxNjQ4MjM0NzEx","url":"https://api.github.com/repos/electron/electron/labels/roller/pause","name":"roller/pause","color":"fbca04","default":false,"description":""},{"id":2968604945,"node_id":"MDU6TGFiZWwyOTY4NjA0OTQ1","url":"https://api.github.com/repos/electron/electron/labels/no-backport","name":"no-backport","color":"CB07C4","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/40076/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/40076/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/40076/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/6a695f015bac8388dc450b46f548288bff58a433","head":{"label":"electron:roller/chromium/main","ref":"roller/chromium/main","sha":"6a695f015bac8388dc450b46f548288bff58a433","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"base":{"label":"electron:main","ref":"main","sha":"3392d9a2e74973960ca516adc1c1684e03f78414","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/40076"},"html":{"href":"https://github.com/electron/electron/pull/40076"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/40076"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/40076/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/40076/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/40076/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/6a695f015bac8388dc450b46f548288bff58a433"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null}]} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-commit-9d0e6d09f0be0abbeae46dd3d66afd96d2daacaa b/spec/fixtures/release-notes/cache/electron-electron-commit-9d0e6d09f0be0abbeae46dd3d66afd96d2daacaa new file mode 100644 index 0000000000..eb9fbc660d --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-commit-9d0e6d09f0be0abbeae46dd3d66afd96d2daacaa @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/9d0e6d09f0be0abbeae46dd3d66afd96d2daacaa/pulls","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"2667","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:37 GMT","etag":"W/\"1467bf4bc68e3bbb5c598d01f59d72ae71f38c1e45f7a20c7397ada84fbbb80c\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B4A7:4558AB7:66ECF365","x-ratelimit-limit":"60","x-ratelimit-remaining":"48","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"12","x-xss-protection":"0"},"data":[{"url":"https://api.github.com/repos/electron/electron/pulls/40045","id":1535161486,"node_id":"PR_kwDOAI8xS85bgLSO","html_url":"https://github.com/electron/electron/pull/40045","diff_url":"https://github.com/electron/electron/pull/40045.diff","patch_url":"https://github.com/electron/electron/pull/40045.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/40045","number":40045,"state":"closed","locked":false,"title":"chore: bump chromium to 119.0.6043.0 (main)","user":{"login":"electron-roller[bot]","id":84116207,"node_id":"MDM6Qm90ODQxMTYyMDc=","avatar_url":"https://avatars.githubusercontent.com/in/115177?v=4","gravatar_id":"","url":"https://api.github.com/users/electron-roller%5Bbot%5D","html_url":"https://github.com/apps/electron-roller","followers_url":"https://api.github.com/users/electron-roller%5Bbot%5D/followers","following_url":"https://api.github.com/users/electron-roller%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/electron-roller%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/electron-roller%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron-roller%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/electron-roller%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/electron-roller%5Bbot%5D/repos","events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Updating Chromium to 119.0.6043.0.\n\nSee [all changes in 119.0.6029.0..119.0.6043.0](https://chromium.googlesource.com/chromium/src/+log/119.0.6029.0..119.0.6043.0?n=10000&pretty=fuller)\n\n<!--\nOriginal-Version: 119.0.6029.0\n-->\n\nNotes: Updated Chromium to 119.0.6043.0.","created_at":"2023-09-29T05:27:06Z","updated_at":"2023-10-02T22:01:11Z","closed_at":"2023-10-02T22:01:07Z","merged_at":"2023-10-02T22:01:07Z","merge_commit_sha":"9d0e6d09f0be0abbeae46dd3d66afd96d2daacaa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1034512799,"node_id":"MDU6TGFiZWwxMDM0NTEyNzk5","url":"https://api.github.com/repos/electron/electron/labels/semver/patch","name":"semver/patch","color":"6ac2dd","default":false,"description":"backwards-compatible bug fixes"},{"id":1648234711,"node_id":"MDU6TGFiZWwxNjQ4MjM0NzEx","url":"https://api.github.com/repos/electron/electron/labels/roller/pause","name":"roller/pause","color":"fbca04","default":false,"description":""},{"id":2968604945,"node_id":"MDU6TGFiZWwyOTY4NjA0OTQ1","url":"https://api.github.com/repos/electron/electron/labels/no-backport","name":"no-backport","color":"CB07C4","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/40045/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/40045/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/40045/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/6fcb6a8d7ffc0b57f8d161bbdd9ff87a3dd5e934","head":{"label":"electron:roller/chromium/main","ref":"roller/chromium/main","sha":"6fcb6a8d7ffc0b57f8d161bbdd9ff87a3dd5e934","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"base":{"label":"electron:main","ref":"main","sha":"503ae86ab216406485bf437969da8c56266c3346","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/40045"},"html":{"href":"https://github.com/electron/electron/pull/40045"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/40045"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/40045/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/40045/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/40045/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/6fcb6a8d7ffc0b57f8d161bbdd9ff87a3dd5e934"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null}]} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-commit-d6c8ff2e7050f30dffd784915bcbd2a9f993cdb2 b/spec/fixtures/release-notes/cache/electron-electron-commit-d6c8ff2e7050f30dffd784915bcbd2a9f993cdb2 new file mode 100644 index 0000000000..a8852cb648 --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-commit-d6c8ff2e7050f30dffd784915bcbd2a9f993cdb2 @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/d6c8ff2e7050f30dffd784915bcbd2a9f993cdb2/pulls","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"2656","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:37 GMT","etag":"W/\"b1a96400c9529932fb835905524621cae9010fe39a87e5b4720587f8f5f1bf99\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B56F:4558C56:66ECF365","x-ratelimit-limit":"60","x-ratelimit-remaining":"47","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"13","x-xss-protection":"0"},"data":[{"url":"https://api.github.com/repos/electron/electron/pulls/39944","id":1524826900,"node_id":"PR_kwDOAI8xS85a4wMU","html_url":"https://github.com/electron/electron/pull/39944","diff_url":"https://github.com/electron/electron/pull/39944.diff","patch_url":"https://github.com/electron/electron/pull/39944.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/39944","number":39944,"state":"closed","locked":false,"title":"chore: bump chromium to 119.0.6029.0 (main)","user":{"login":"electron-roller[bot]","id":84116207,"node_id":"MDM6Qm90ODQxMTYyMDc=","avatar_url":"https://avatars.githubusercontent.com/in/115177?v=4","gravatar_id":"","url":"https://api.github.com/users/electron-roller%5Bbot%5D","html_url":"https://github.com/apps/electron-roller","followers_url":"https://api.github.com/users/electron-roller%5Bbot%5D/followers","following_url":"https://api.github.com/users/electron-roller%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/electron-roller%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/electron-roller%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron-roller%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/electron-roller%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/electron-roller%5Bbot%5D/repos","events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Updating Chromium to 119.0.6029.0.\n\nSee [all changes in 119.0.6019.2..119.0.6029.0](https://chromium.googlesource.com/chromium/src/+log/119.0.6019.2..119.0.6029.0?n=10000&pretty=fuller)\n\n<!--\nOriginal-Version: 119.0.6019.2\n-->\n\nNotes: Updated Chromium to 119.0.6029.0.","created_at":"2023-09-21T13:00:39Z","updated_at":"2023-09-29T05:26:44Z","closed_at":"2023-09-29T05:26:41Z","merged_at":"2023-09-29T05:26:41Z","merge_commit_sha":"d6c8ff2e7050f30dffd784915bcbd2a9f993cdb2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1034512799,"node_id":"MDU6TGFiZWwxMDM0NTEyNzk5","url":"https://api.github.com/repos/electron/electron/labels/semver/patch","name":"semver/patch","color":"6ac2dd","default":false,"description":"backwards-compatible bug fixes"},{"id":1648234711,"node_id":"MDU6TGFiZWwxNjQ4MjM0NzEx","url":"https://api.github.com/repos/electron/electron/labels/roller/pause","name":"roller/pause","color":"fbca04","default":false,"description":""},{"id":2968604945,"node_id":"MDU6TGFiZWwyOTY4NjA0OTQ1","url":"https://api.github.com/repos/electron/electron/labels/no-backport","name":"no-backport","color":"CB07C4","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/39944/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/39944/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/39944/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/bcb310340b17faa47fa68eae5db91d908995ffe0","head":{"label":"electron:roller/chromium/main","ref":"roller/chromium/main","sha":"bcb310340b17faa47fa68eae5db91d908995ffe0","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"base":{"label":"electron:main","ref":"main","sha":"dd7395ebedf0cfef3129697f9585035a4ddbde63","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/39944"},"html":{"href":"https://github.com/electron/electron/pull/39944"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/39944"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/39944/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/39944/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/39944/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/bcb310340b17faa47fa68eae5db91d908995ffe0"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null}]} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-commit-d9ba26273ad3e7a34c905eccbd5dabda4eb7b402 b/spec/fixtures/release-notes/cache/electron-electron-commit-d9ba26273ad3e7a34c905eccbd5dabda4eb7b402 new file mode 100644 index 0000000000..d85f99aa23 --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-commit-d9ba26273ad3e7a34c905eccbd5dabda4eb7b402 @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/d9ba26273ad3e7a34c905eccbd5dabda4eb7b402/pulls","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"2671","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:37 GMT","etag":"W/\"43d13a3642303cd5f8d90df11c58df1d9952cb3c42dacdfb39e02e1d60d2d54f\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B3BD:4558915:66ECF365","x-ratelimit-limit":"60","x-ratelimit-remaining":"49","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"11","x-xss-protection":"0"},"data":[{"url":"https://api.github.com/repos/electron/electron/pulls/39714","id":1498359807,"node_id":"PR_kwDOAI8xS85ZTyf_","html_url":"https://github.com/electron/electron/pull/39714","diff_url":"https://github.com/electron/electron/pull/39714.diff","patch_url":"https://github.com/electron/electron/pull/39714.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/39714","number":39714,"state":"closed","locked":false,"title":"chore: bump chromium to 118.0.5991.0 (main)","user":{"login":"electron-roller[bot]","id":84116207,"node_id":"MDM6Qm90ODQxMTYyMDc=","avatar_url":"https://avatars.githubusercontent.com/in/115177?v=4","gravatar_id":"","url":"https://api.github.com/users/electron-roller%5Bbot%5D","html_url":"https://github.com/apps/electron-roller","followers_url":"https://api.github.com/users/electron-roller%5Bbot%5D/followers","following_url":"https://api.github.com/users/electron-roller%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/electron-roller%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/electron-roller%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron-roller%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/electron-roller%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/electron-roller%5Bbot%5D/repos","events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Updating Chromium to 118.0.5991.0.\n\nSee [all changes in 118.0.5975.0..118.0.5991.0](https://chromium.googlesource.com/chromium/src/+log/118.0.5975.0..118.0.5991.0?n=10000&pretty=fuller)\n\n<!--\nOriginal-Version: 118.0.5975.0\n-->\n\nNotes: Updated Chromium to 118.0.5991.0.","created_at":"2023-09-01T06:55:20Z","updated_at":"2023-09-06T01:18:00Z","closed_at":"2023-09-06T01:17:57Z","merged_at":"2023-09-06T01:17:57Z","merge_commit_sha":"d9ba26273ad3e7a34c905eccbd5dabda4eb7b402","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1034512799,"node_id":"MDU6TGFiZWwxMDM0NTEyNzk5","url":"https://api.github.com/repos/electron/electron/labels/semver/patch","name":"semver/patch","color":"6ac2dd","default":false,"description":"backwards-compatible bug fixes"},{"id":1648234711,"node_id":"MDU6TGFiZWwxNjQ4MjM0NzEx","url":"https://api.github.com/repos/electron/electron/labels/roller/pause","name":"roller/pause","color":"fbca04","default":false,"description":""},{"id":2968604945,"node_id":"MDU6TGFiZWwyOTY4NjA0OTQ1","url":"https://api.github.com/repos/electron/electron/labels/no-backport","name":"no-backport","color":"CB07C4","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/39714/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/39714/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/39714/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/6bf3066e43060001074a8a38168024531dbceec3","head":{"label":"electron:roller/chromium/main","ref":"roller/chromium/main","sha":"6bf3066e43060001074a8a38168024531dbceec3","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"base":{"label":"electron:main","ref":"main","sha":"54d8402a6ca8a357d7695c1c6d01d5040e42926a","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/39714"},"html":{"href":"https://github.com/electron/electron/pull/39714"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/39714"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/39714/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/39714/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/39714/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/6bf3066e43060001074a8a38168024531dbceec3"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null}]} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-issue-39714-comments b/spec/fixtures/release-notes/cache/electron-electron-issue-39714-comments new file mode 100644 index 0000000000..5770c77857 --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-issue-39714-comments @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/issues/39714/comments?per_page=100","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"645","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:38 GMT","etag":"W/\"6fcb725196d33f08ba1ccba10f866b6bc0a51030d157259b2cce6d2758910e24\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B64D:4558DD8:66ECF365","x-ratelimit-limit":"60","x-ratelimit-remaining":"46","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"14","x-xss-protection":"0"},"data":[{"url":"https://api.github.com/repos/electron/electron/issues/comments/1707509099","html_url":"https://github.com/electron/electron/pull/39714#issuecomment-1707509099","issue_url":"https://api.github.com/repos/electron/electron/issues/39714","id":1707509099,"node_id":"IC_kwDOAI8xS85lxoVr","user":{"login":"release-clerk[bot]","id":42386326,"node_id":"MDM6Qm90NDIzODYzMjY=","avatar_url":"https://avatars.githubusercontent.com/in/16104?v=4","gravatar_id":"","url":"https://api.github.com/users/release-clerk%5Bbot%5D","html_url":"https://github.com/apps/release-clerk","followers_url":"https://api.github.com/users/release-clerk%5Bbot%5D/followers","following_url":"https://api.github.com/users/release-clerk%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/release-clerk%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/release-clerk%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-clerk%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/release-clerk%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/release-clerk%5Bbot%5D/repos","events_url":"https://api.github.com/users/release-clerk%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/release-clerk%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2023-09-06T01:18:00Z","updated_at":"2023-09-06T01:18:00Z","author_association":"NONE","body":"**Release Notes Persisted**\n\n> Updated Chromium to 118.0.5991.0.","reactions":{"url":"https://api.github.com/repos/electron/electron/issues/comments/1707509099/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null}]} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-issue-39944-comments b/spec/fixtures/release-notes/cache/electron-electron-issue-39944-comments new file mode 100644 index 0000000000..288d1b4afe --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-issue-39944-comments @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/issues/39944/comments?per_page=100","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"869","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:38 GMT","etag":"W/\"b34114fbdb2350380ab4adac1c9c48568bebf0e5c0a427ecaa40402f7166456c\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B74B:4558FC8:66ECF366","x-ratelimit-limit":"60","x-ratelimit-remaining":"44","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"16","x-xss-protection":"0"},"data":[{"url":"https://api.github.com/repos/electron/electron/issues/comments/1732251450","html_url":"https://github.com/electron/electron/pull/39944#issuecomment-1732251450","issue_url":"https://api.github.com/repos/electron/electron/issues/39944","id":1732251450,"node_id":"IC_kwDOAI8xS85nQA86","user":{"login":"codebytere","id":2036040,"node_id":"MDQ6VXNlcjIwMzYwNDA=","avatar_url":"https://avatars.githubusercontent.com/u/2036040?v=4","gravatar_id":"","url":"https://api.github.com/users/codebytere","html_url":"https://github.com/codebytere","followers_url":"https://api.github.com/users/codebytere/followers","following_url":"https://api.github.com/users/codebytere/following{/other_user}","gists_url":"https://api.github.com/users/codebytere/gists{/gist_id}","starred_url":"https://api.github.com/users/codebytere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codebytere/subscriptions","organizations_url":"https://api.github.com/users/codebytere/orgs","repos_url":"https://api.github.com/users/codebytere/repos","events_url":"https://api.github.com/users/codebytere/events{/privacy}","received_events_url":"https://api.github.com/users/codebytere/received_events","type":"User","site_admin":false},"created_at":"2023-09-23T08:19:47Z","updated_at":"2023-09-23T08:19:47Z","author_association":"MEMBER","body":"Needs https://github.com/electron/build-tools/pull/516","reactions":{"url":"https://api.github.com/repos/electron/electron/issues/comments/1732251450/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null},{"url":"https://api.github.com/repos/electron/electron/issues/comments/1740333567","html_url":"https://github.com/electron/electron/pull/39944#issuecomment-1740333567","issue_url":"https://api.github.com/repos/electron/electron/issues/39944","id":1740333567,"node_id":"IC_kwDOAI8xS85nu2H_","user":{"login":"release-clerk[bot]","id":42386326,"node_id":"MDM6Qm90NDIzODYzMjY=","avatar_url":"https://avatars.githubusercontent.com/in/16104?v=4","gravatar_id":"","url":"https://api.github.com/users/release-clerk%5Bbot%5D","html_url":"https://github.com/apps/release-clerk","followers_url":"https://api.github.com/users/release-clerk%5Bbot%5D/followers","following_url":"https://api.github.com/users/release-clerk%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/release-clerk%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/release-clerk%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-clerk%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/release-clerk%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/release-clerk%5Bbot%5D/repos","events_url":"https://api.github.com/users/release-clerk%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/release-clerk%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2023-09-29T05:26:44Z","updated_at":"2023-09-29T05:26:44Z","author_association":"NONE","body":"**Release Notes Persisted**\n\n> Updated Chromium to 119.0.6029.0.","reactions":{"url":"https://api.github.com/repos/electron/electron/issues/comments/1740333567/reactions","total_count":2,"+1":1,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":1,"eyes":0},"performed_via_github_app":null}]} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-issue-40045-comments b/spec/fixtures/release-notes/cache/electron-electron-issue-40045-comments new file mode 100644 index 0000000000..f7ecc0e3c7 --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-issue-40045-comments @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/issues/40045/comments?per_page=100","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"645","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:38 GMT","etag":"W/\"597a0b18dff7544d3742956759f06c9233095b92fdc8e3a1ac78afaf61a42b5c\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B6D4:4558ED3:66ECF366","x-ratelimit-limit":"60","x-ratelimit-remaining":"45","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"15","x-xss-protection":"0"},"data":[{"url":"https://api.github.com/repos/electron/electron/issues/comments/1743831479","html_url":"https://github.com/electron/electron/pull/40045#issuecomment-1743831479","issue_url":"https://api.github.com/repos/electron/electron/issues/40045","id":1743831479,"node_id":"IC_kwDOAI8xS85n8MG3","user":{"login":"release-clerk[bot]","id":42386326,"node_id":"MDM6Qm90NDIzODYzMjY=","avatar_url":"https://avatars.githubusercontent.com/in/16104?v=4","gravatar_id":"","url":"https://api.github.com/users/release-clerk%5Bbot%5D","html_url":"https://github.com/apps/release-clerk","followers_url":"https://api.github.com/users/release-clerk%5Bbot%5D/followers","following_url":"https://api.github.com/users/release-clerk%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/release-clerk%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/release-clerk%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-clerk%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/release-clerk%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/release-clerk%5Bbot%5D/repos","events_url":"https://api.github.com/users/release-clerk%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/release-clerk%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2023-10-02T22:01:11Z","updated_at":"2023-10-02T22:01:11Z","author_association":"NONE","body":"**Release Notes Persisted**\n\n> Updated Chromium to 119.0.6043.0.","reactions":{"url":"https://api.github.com/repos/electron/electron/issues/comments/1743831479/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null}]} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-issue-40076-comments b/spec/fixtures/release-notes/cache/electron-electron-issue-40076-comments new file mode 100644 index 0000000000..411ab60c17 --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-issue-40076-comments @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/issues/40076/comments?per_page=100","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"894","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:38 GMT","etag":"W/\"b11c58261437bdbb984540cd6090cfe239f8f4b5b7af801f6f711e7f0bbe5915\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B8AF:4559259:66ECF366","x-ratelimit-limit":"60","x-ratelimit-remaining":"42","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"18","x-xss-protection":"0"},"data":[{"url":"https://api.github.com/repos/electron/electron/issues/comments/1749810095","html_url":"https://github.com/electron/electron/pull/40076#issuecomment-1749810095","issue_url":"https://api.github.com/repos/electron/electron/issues/40076","id":1749810095,"node_id":"IC_kwDOAI8xS85oS_uv","user":{"login":"release-clerk[bot]","id":42386326,"node_id":"MDM6Qm90NDIzODYzMjY=","avatar_url":"https://avatars.githubusercontent.com/in/16104?v=4","gravatar_id":"","url":"https://api.github.com/users/release-clerk%5Bbot%5D","html_url":"https://github.com/apps/release-clerk","followers_url":"https://api.github.com/users/release-clerk%5Bbot%5D/followers","following_url":"https://api.github.com/users/release-clerk%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/release-clerk%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/release-clerk%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-clerk%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/release-clerk%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/release-clerk%5Bbot%5D/repos","events_url":"https://api.github.com/users/release-clerk%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/release-clerk%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2023-10-05T23:59:43Z","updated_at":"2023-10-05T23:59:43Z","author_association":"NONE","body":"**Release Notes Persisted**\n\n> Updated Chromium to 119.0.6045.0.","reactions":{"url":"https://api.github.com/repos/electron/electron/issues/comments/1749810095/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null},{"url":"https://api.github.com/repos/electron/electron/issues/comments/1749846515","html_url":"https://github.com/electron/electron/pull/40076#issuecomment-1749846515","issue_url":"https://api.github.com/repos/electron/electron/issues/40076","id":1749846515,"node_id":"IC_kwDOAI8xS85oTInz","user":{"login":"ckerr","id":70381,"node_id":"MDQ6VXNlcjcwMzgx","avatar_url":"https://avatars.githubusercontent.com/u/70381?v=4","gravatar_id":"","url":"https://api.github.com/users/ckerr","html_url":"https://github.com/ckerr","followers_url":"https://api.github.com/users/ckerr/followers","following_url":"https://api.github.com/users/ckerr/following{/other_user}","gists_url":"https://api.github.com/users/ckerr/gists{/gist_id}","starred_url":"https://api.github.com/users/ckerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckerr/subscriptions","organizations_url":"https://api.github.com/users/ckerr/orgs","repos_url":"https://api.github.com/users/ckerr/repos","events_url":"https://api.github.com/users/ckerr/events{/privacy}","received_events_url":"https://api.github.com/users/ckerr/received_events","type":"User","site_admin":false},"created_at":"2023-10-06T00:56:09Z","updated_at":"2023-10-06T00:56:09Z","author_association":"MEMBER","body":"Ah, merged while I was reading. :sweat_smile: FWIW @jkleinsc here's a tardy :+1: on the glib/gio changes","reactions":{"url":"https://api.github.com/repos/electron/electron/issues/comments/1749846515/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null}]} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-pull-39714 b/spec/fixtures/release-notes/cache/electron-electron-pull-39714 new file mode 100644 index 0000000000..e1166b21a3 --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-pull-39714 @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/d9ba26273ad3e7a34c905eccbd5dabda4eb7b402/pulls","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"2671","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:37 GMT","etag":"W/\"43d13a3642303cd5f8d90df11c58df1d9952cb3c42dacdfb39e02e1d60d2d54f\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B3BD:4558915:66ECF365","x-ratelimit-limit":"60","x-ratelimit-remaining":"49","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"11","x-xss-protection":"0"},"data":{"url":"https://api.github.com/repos/electron/electron/pulls/39714","id":1498359807,"node_id":"PR_kwDOAI8xS85ZTyf_","html_url":"https://github.com/electron/electron/pull/39714","diff_url":"https://github.com/electron/electron/pull/39714.diff","patch_url":"https://github.com/electron/electron/pull/39714.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/39714","number":39714,"state":"closed","locked":false,"title":"chore: bump chromium to 118.0.5991.0 (main)","user":{"login":"electron-roller[bot]","id":84116207,"node_id":"MDM6Qm90ODQxMTYyMDc=","avatar_url":"https://avatars.githubusercontent.com/in/115177?v=4","gravatar_id":"","url":"https://api.github.com/users/electron-roller%5Bbot%5D","html_url":"https://github.com/apps/electron-roller","followers_url":"https://api.github.com/users/electron-roller%5Bbot%5D/followers","following_url":"https://api.github.com/users/electron-roller%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/electron-roller%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/electron-roller%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron-roller%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/electron-roller%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/electron-roller%5Bbot%5D/repos","events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Updating Chromium to 118.0.5991.0.\n\nSee [all changes in 118.0.5975.0..118.0.5991.0](https://chromium.googlesource.com/chromium/src/+log/118.0.5975.0..118.0.5991.0?n=10000&pretty=fuller)\n\n<!--\nOriginal-Version: 118.0.5975.0\n-->\n\nNotes: Updated Chromium to 118.0.5991.0.","created_at":"2023-09-01T06:55:20Z","updated_at":"2023-09-06T01:18:00Z","closed_at":"2023-09-06T01:17:57Z","merged_at":"2023-09-06T01:17:57Z","merge_commit_sha":"d9ba26273ad3e7a34c905eccbd5dabda4eb7b402","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1034512799,"node_id":"MDU6TGFiZWwxMDM0NTEyNzk5","url":"https://api.github.com/repos/electron/electron/labels/semver/patch","name":"semver/patch","color":"6ac2dd","default":false,"description":"backwards-compatible bug fixes"},{"id":1648234711,"node_id":"MDU6TGFiZWwxNjQ4MjM0NzEx","url":"https://api.github.com/repos/electron/electron/labels/roller/pause","name":"roller/pause","color":"fbca04","default":false,"description":""},{"id":2968604945,"node_id":"MDU6TGFiZWwyOTY4NjA0OTQ1","url":"https://api.github.com/repos/electron/electron/labels/no-backport","name":"no-backport","color":"CB07C4","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/39714/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/39714/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/39714/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/6bf3066e43060001074a8a38168024531dbceec3","head":{"label":"electron:roller/chromium/main","ref":"roller/chromium/main","sha":"6bf3066e43060001074a8a38168024531dbceec3","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"base":{"label":"electron:main","ref":"main","sha":"54d8402a6ca8a357d7695c1c6d01d5040e42926a","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/39714"},"html":{"href":"https://github.com/electron/electron/pull/39714"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/39714"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/39714/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/39714/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/39714/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/6bf3066e43060001074a8a38168024531dbceec3"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null}} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-pull-39745 b/spec/fixtures/release-notes/cache/electron-electron-pull-39745 new file mode 100644 index 0000000000..9bde239b59 --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-pull-39745 @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/029127a8b6f7c511fca4612748ad5b50e43aadaa/pulls","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"2717","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:37 GMT","etag":"W/\"80e2d0edebd07c0cf53916bf23fee37544d3eb301e1a65595fff37115a465eae\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B2AD:4558739:66ECF364","x-ratelimit-limit":"60","x-ratelimit-remaining":"50","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"10","x-xss-protection":"0"},"data":{"url":"https://api.github.com/repos/electron/electron/pulls/39745","id":1504592750,"node_id":"PR_kwDOAI8xS85ZrkNu","html_url":"https://github.com/electron/electron/pull/39745","diff_url":"https://github.com/electron/electron/pull/39745.diff","patch_url":"https://github.com/electron/electron/pull/39745.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/39745","number":39745,"state":"closed","locked":false,"title":"chore: bump chromium to 118.0.5993.0 (main)","user":{"login":"electron-roller[bot]","id":84116207,"node_id":"MDM6Qm90ODQxMTYyMDc=","avatar_url":"https://avatars.githubusercontent.com/in/115177?v=4","gravatar_id":"","url":"https://api.github.com/users/electron-roller%5Bbot%5D","html_url":"https://github.com/apps/electron-roller","followers_url":"https://api.github.com/users/electron-roller%5Bbot%5D/followers","following_url":"https://api.github.com/users/electron-roller%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/electron-roller%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/electron-roller%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron-roller%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/electron-roller%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/electron-roller%5Bbot%5D/repos","events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Updating Chromium to 118.0.5993.0.\n\nSee [all changes in 118.0.5991.0..118.0.5993.0](https://chromium.googlesource.com/chromium/src/+log/118.0.5991.0..118.0.5993.0?n=10000&pretty=fuller)\n\n<!--\nOriginal-Version: 118.0.5991.0\n-->\n\nNotes: Updated Chromium to 118.0.5993.0.","created_at":"2023-09-06T13:00:33Z","updated_at":"2023-09-06T23:28:42Z","closed_at":"2023-09-06T23:27:26Z","merged_at":"2023-09-06T23:27:26Z","merge_commit_sha":"029127a8b6f7c511fca4612748ad5b50e43aadaa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1034512799,"node_id":"MDU6TGFiZWwxMDM0NTEyNzk5","url":"https://api.github.com/repos/electron/electron/labels/semver/patch","name":"semver/patch","color":"6ac2dd","default":false,"description":"backwards-compatible bug fixes"},{"id":1243058793,"node_id":"MDU6TGFiZWwxMjQzMDU4Nzkz","url":"https://api.github.com/repos/electron/electron/labels/new-pr%20%F0%9F%8C%B1","name":"new-pr 🌱","color":"8af297","default":false,"description":"PR opened in the last 24 hours"},{"id":2968604945,"node_id":"MDU6TGFiZWwyOTY4NjA0OTQ1","url":"https://api.github.com/repos/electron/electron/labels/no-backport","name":"no-backport","color":"CB07C4","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/39745/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/39745/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/39745/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/7ba0be830a247d916c05d2471c5ce214d2598476","head":{"label":"electron:roller/chromium/main","ref":"roller/chromium/main","sha":"7ba0be830a247d916c05d2471c5ce214d2598476","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"base":{"label":"electron:main","ref":"main","sha":"34b79c15c2f2de2fa514538b7ccb4b3c473808ae","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/39745"},"html":{"href":"https://github.com/electron/electron/pull/39745"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/39745"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/39745/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/39745/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/39745/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/7ba0be830a247d916c05d2471c5ce214d2598476"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null}} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-pull-39944 b/spec/fixtures/release-notes/cache/electron-electron-pull-39944 new file mode 100644 index 0000000000..374b574670 --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-pull-39944 @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/d6c8ff2e7050f30dffd784915bcbd2a9f993cdb2/pulls","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"2656","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:37 GMT","etag":"W/\"b1a96400c9529932fb835905524621cae9010fe39a87e5b4720587f8f5f1bf99\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B56F:4558C56:66ECF365","x-ratelimit-limit":"60","x-ratelimit-remaining":"47","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"13","x-xss-protection":"0"},"data":{"url":"https://api.github.com/repos/electron/electron/pulls/39944","id":1524826900,"node_id":"PR_kwDOAI8xS85a4wMU","html_url":"https://github.com/electron/electron/pull/39944","diff_url":"https://github.com/electron/electron/pull/39944.diff","patch_url":"https://github.com/electron/electron/pull/39944.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/39944","number":39944,"state":"closed","locked":false,"title":"chore: bump chromium to 119.0.6029.0 (main)","user":{"login":"electron-roller[bot]","id":84116207,"node_id":"MDM6Qm90ODQxMTYyMDc=","avatar_url":"https://avatars.githubusercontent.com/in/115177?v=4","gravatar_id":"","url":"https://api.github.com/users/electron-roller%5Bbot%5D","html_url":"https://github.com/apps/electron-roller","followers_url":"https://api.github.com/users/electron-roller%5Bbot%5D/followers","following_url":"https://api.github.com/users/electron-roller%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/electron-roller%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/electron-roller%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron-roller%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/electron-roller%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/electron-roller%5Bbot%5D/repos","events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Updating Chromium to 119.0.6029.0.\n\nSee [all changes in 119.0.6019.2..119.0.6029.0](https://chromium.googlesource.com/chromium/src/+log/119.0.6019.2..119.0.6029.0?n=10000&pretty=fuller)\n\n<!--\nOriginal-Version: 119.0.6019.2\n-->\n\nNotes: Updated Chromium to 119.0.6029.0.","created_at":"2023-09-21T13:00:39Z","updated_at":"2023-09-29T05:26:44Z","closed_at":"2023-09-29T05:26:41Z","merged_at":"2023-09-29T05:26:41Z","merge_commit_sha":"d6c8ff2e7050f30dffd784915bcbd2a9f993cdb2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1034512799,"node_id":"MDU6TGFiZWwxMDM0NTEyNzk5","url":"https://api.github.com/repos/electron/electron/labels/semver/patch","name":"semver/patch","color":"6ac2dd","default":false,"description":"backwards-compatible bug fixes"},{"id":1648234711,"node_id":"MDU6TGFiZWwxNjQ4MjM0NzEx","url":"https://api.github.com/repos/electron/electron/labels/roller/pause","name":"roller/pause","color":"fbca04","default":false,"description":""},{"id":2968604945,"node_id":"MDU6TGFiZWwyOTY4NjA0OTQ1","url":"https://api.github.com/repos/electron/electron/labels/no-backport","name":"no-backport","color":"CB07C4","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/39944/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/39944/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/39944/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/bcb310340b17faa47fa68eae5db91d908995ffe0","head":{"label":"electron:roller/chromium/main","ref":"roller/chromium/main","sha":"bcb310340b17faa47fa68eae5db91d908995ffe0","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"base":{"label":"electron:main","ref":"main","sha":"dd7395ebedf0cfef3129697f9585035a4ddbde63","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/39944"},"html":{"href":"https://github.com/electron/electron/pull/39944"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/39944"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/39944/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/39944/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/39944/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/bcb310340b17faa47fa68eae5db91d908995ffe0"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null}} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-pull-40045 b/spec/fixtures/release-notes/cache/electron-electron-pull-40045 new file mode 100644 index 0000000000..996570b00e --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-pull-40045 @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/9d0e6d09f0be0abbeae46dd3d66afd96d2daacaa/pulls","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-length":"2667","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:37 GMT","etag":"W/\"1467bf4bc68e3bbb5c598d01f59d72ae71f38c1e45f7a20c7397ada84fbbb80c\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B4A7:4558AB7:66ECF365","x-ratelimit-limit":"60","x-ratelimit-remaining":"48","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"12","x-xss-protection":"0"},"data":{"url":"https://api.github.com/repos/electron/electron/pulls/40045","id":1535161486,"node_id":"PR_kwDOAI8xS85bgLSO","html_url":"https://github.com/electron/electron/pull/40045","diff_url":"https://github.com/electron/electron/pull/40045.diff","patch_url":"https://github.com/electron/electron/pull/40045.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/40045","number":40045,"state":"closed","locked":false,"title":"chore: bump chromium to 119.0.6043.0 (main)","user":{"login":"electron-roller[bot]","id":84116207,"node_id":"MDM6Qm90ODQxMTYyMDc=","avatar_url":"https://avatars.githubusercontent.com/in/115177?v=4","gravatar_id":"","url":"https://api.github.com/users/electron-roller%5Bbot%5D","html_url":"https://github.com/apps/electron-roller","followers_url":"https://api.github.com/users/electron-roller%5Bbot%5D/followers","following_url":"https://api.github.com/users/electron-roller%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/electron-roller%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/electron-roller%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron-roller%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/electron-roller%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/electron-roller%5Bbot%5D/repos","events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Updating Chromium to 119.0.6043.0.\n\nSee [all changes in 119.0.6029.0..119.0.6043.0](https://chromium.googlesource.com/chromium/src/+log/119.0.6029.0..119.0.6043.0?n=10000&pretty=fuller)\n\n<!--\nOriginal-Version: 119.0.6029.0\n-->\n\nNotes: Updated Chromium to 119.0.6043.0.","created_at":"2023-09-29T05:27:06Z","updated_at":"2023-10-02T22:01:11Z","closed_at":"2023-10-02T22:01:07Z","merged_at":"2023-10-02T22:01:07Z","merge_commit_sha":"9d0e6d09f0be0abbeae46dd3d66afd96d2daacaa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1034512799,"node_id":"MDU6TGFiZWwxMDM0NTEyNzk5","url":"https://api.github.com/repos/electron/electron/labels/semver/patch","name":"semver/patch","color":"6ac2dd","default":false,"description":"backwards-compatible bug fixes"},{"id":1648234711,"node_id":"MDU6TGFiZWwxNjQ4MjM0NzEx","url":"https://api.github.com/repos/electron/electron/labels/roller/pause","name":"roller/pause","color":"fbca04","default":false,"description":""},{"id":2968604945,"node_id":"MDU6TGFiZWwyOTY4NjA0OTQ1","url":"https://api.github.com/repos/electron/electron/labels/no-backport","name":"no-backport","color":"CB07C4","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/40045/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/40045/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/40045/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/6fcb6a8d7ffc0b57f8d161bbdd9ff87a3dd5e934","head":{"label":"electron:roller/chromium/main","ref":"roller/chromium/main","sha":"6fcb6a8d7ffc0b57f8d161bbdd9ff87a3dd5e934","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"base":{"label":"electron:main","ref":"main","sha":"503ae86ab216406485bf437969da8c56266c3346","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/40045"},"html":{"href":"https://github.com/electron/electron/pull/40045"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/40045"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/40045/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/40045/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/40045/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/6fcb6a8d7ffc0b57f8d161bbdd9ff87a3dd5e934"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null}} \ No newline at end of file diff --git a/spec/fixtures/release-notes/cache/electron-electron-pull-40076 b/spec/fixtures/release-notes/cache/electron-electron-pull-40076 new file mode 100644 index 0000000000..84bd9002d8 --- /dev/null +++ b/spec/fixtures/release-notes/cache/electron-electron-pull-40076 @@ -0,0 +1 @@ +{"status":200,"url":"https://api.github.com/repos/electron/electron/commits/8f7a48879ef8633a76279803637cdee7f7c6cd4f/pulls","headers":{"accept-ranges":"bytes","access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"public, max-age=60, s-maxage=60","content-encoding":"gzip","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Fri, 20 Sep 2024 04:00:38 GMT","etag":"W/\"fc25a1c4edee51c7c227cdb578189b0196dfeea4976c22509630ee1fc0b75919\"","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","transfer-encoding":"chunked","vary":"Accept,Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"C623:36E55D:247B7DF:45590F1:66ECF366","x-ratelimit-limit":"60","x-ratelimit-remaining":"43","x-ratelimit-reset":"1726805543","x-ratelimit-resource":"core","x-ratelimit-used":"17","x-xss-protection":"0"},"data":{"url":"https://api.github.com/repos/electron/electron/pulls/40076","id":1539965204,"node_id":"PR_kwDOAI8xS85bygEU","html_url":"https://github.com/electron/electron/pull/40076","diff_url":"https://github.com/electron/electron/pull/40076.diff","patch_url":"https://github.com/electron/electron/pull/40076.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/40076","number":40076,"state":"closed","locked":false,"title":"chore: bump chromium to 119.0.6045.0 (main)","user":{"login":"electron-roller[bot]","id":84116207,"node_id":"MDM6Qm90ODQxMTYyMDc=","avatar_url":"https://avatars.githubusercontent.com/in/115177?v=4","gravatar_id":"","url":"https://api.github.com/users/electron-roller%5Bbot%5D","html_url":"https://github.com/apps/electron-roller","followers_url":"https://api.github.com/users/electron-roller%5Bbot%5D/followers","following_url":"https://api.github.com/users/electron-roller%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/electron-roller%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/electron-roller%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron-roller%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/electron-roller%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/electron-roller%5Bbot%5D/repos","events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/electron-roller%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Updating Chromium to 119.0.6045.0.\r\n\r\nSee [all changes in 119.0.6043.0..119.0.6045.0](https://chromium.googlesource.com/chromium/src/+log/119.0.6043.0..119.0.6045.0?n=10000&pretty=fuller)\r\n\r\n<!--\r\nOriginal-Version: 119.0.6043.0\r\n-->\r\n\r\nNotes: Updated Chromium to 119.0.6045.0.","created_at":"2023-10-03T13:00:35Z","updated_at":"2023-10-06T00:56:09Z","closed_at":"2023-10-05T23:59:40Z","merged_at":"2023-10-05T23:59:40Z","merge_commit_sha":"8f7a48879ef8633a76279803637cdee7f7c6cd4f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1034512799,"node_id":"MDU6TGFiZWwxMDM0NTEyNzk5","url":"https://api.github.com/repos/electron/electron/labels/semver/patch","name":"semver/patch","color":"6ac2dd","default":false,"description":"backwards-compatible bug fixes"},{"id":1648234711,"node_id":"MDU6TGFiZWwxNjQ4MjM0NzEx","url":"https://api.github.com/repos/electron/electron/labels/roller/pause","name":"roller/pause","color":"fbca04","default":false,"description":""},{"id":2968604945,"node_id":"MDU6TGFiZWwyOTY4NjA0OTQ1","url":"https://api.github.com/repos/electron/electron/labels/no-backport","name":"no-backport","color":"CB07C4","default":false,"description":""}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/electron/electron/pulls/40076/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/40076/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/40076/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/6a695f015bac8388dc450b46f548288bff58a433","head":{"label":"electron:roller/chromium/main","ref":"roller/chromium/main","sha":"6a695f015bac8388dc450b46f548288bff58a433","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"base":{"label":"electron:main","ref":"main","sha":"3392d9a2e74973960ca516adc1c1684e03f78414","user":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"node_id":"MDEwOlJlcG9zaXRvcnk5Mzg0MjY3","name":"electron","full_name":"electron/electron","private":false,"owner":{"login":"electron","id":13409222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDA5MjIy","avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=4","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/electron/electron","description":":electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2024-09-20T03:36:40Z","pushed_at":"2024-09-20T03:35:04Z","git_url":"git://github.com/electron/electron.git","ssh_url":"[email protected]:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"https://electronjs.org","size":156304,"stargazers_count":113719,"watchers_count":113719,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":15312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":946,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":["c-plus-plus","chrome","css","electron","html","javascript","nodejs","v8","works-with-codespaces"],"visibility":"public","forks":15312,"open_issues":946,"watchers":113719,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/40076"},"html":{"href":"https://github.com/electron/electron/pull/40076"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/40076"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/40076/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/40076/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/40076/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/6a695f015bac8388dc450b46f548288bff58a433"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null}} \ No newline at end of file
build
80f34ecd2cca9b1ae1f31d6ce1b9d20afef4cc91
Shelley Vohr
2024-03-12 17:39:29
test: re-enable `app.getGPUInfo()` specs on Linux (#41568) test: re-enable getGPUInfo() specs on Linux
diff --git a/spec/api-app-spec.ts b/spec/api-app-spec.ts index 5194dced3c..30531b8745 100644 --- a/spec/api-app-spec.ts +++ b/spec/api-app-spec.ts @@ -1446,8 +1446,7 @@ describe('app module', () => { }); }); - // FIXME https://github.com/electron/electron/issues/24224 - ifdescribe(process.platform !== 'linux')('getGPUInfo() API', () => { + ifdescribe(!process.env.IS_ASAN)('getGPUInfo() API', () => { const appPath = path.join(fixturesPath, 'api', 'gpu-info.js'); const getGPUInfo = async (type: string) => {
test
33d7c9ac3e19ba8f0b853938797630f9f69c22c4
Charles Kerr
2024-09-24 00:36:55
refactor: hide printing impl details in api::WebContents (#43893) * refactor: move api::WebContents::OnGetDeviceNameToUse() into an anonymous namespace * refactor: move api::WebContents::OnPDFCreated() into an anonymous namespace * refactor: remove unused #include
diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index c3359b4bf3..8b586fa3fc 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -2911,14 +2911,16 @@ bool WebContents::IsCurrentlyAudible() { } #if BUILDFLAG(ENABLE_PRINTING) -void WebContents::OnGetDeviceNameToUse( - base::Value::Dict print_settings, - printing::CompletionCallback print_callback, - // <error, device_name> - std::pair<std::string, std::u16string> info) { +namespace { + +void OnGetDeviceNameToUse(base::WeakPtr<content::WebContents> web_contents, + base::Value::Dict print_settings, + printing::CompletionCallback print_callback, + // <error, device_name> + std::pair<std::string, std::u16string> info) { // The content::WebContents might be already deleted at this point, and the // PrintViewManagerElectron class does not do null check. - if (!web_contents()) { + if (!web_contents) { if (print_callback) std::move(print_callback).Run(false, "failed"); return; @@ -2940,15 +2942,40 @@ void WebContents::OnGetDeviceNameToUse( } auto* print_view_manager = - PrintViewManagerElectron::FromWebContents(web_contents()); + PrintViewManagerElectron::FromWebContents(web_contents.get()); if (!print_view_manager) return; - content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents()); + content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents.get()); print_view_manager->PrintNow(rfh, std::move(print_settings), std::move(print_callback)); } +void OnPDFCreated(gin_helper::Promise<v8::Local<v8::Value>> promise, + print_to_pdf::PdfPrintResult print_result, + scoped_refptr<base::RefCountedMemory> data) { + if (print_result != print_to_pdf::PdfPrintResult::kPrintSuccess) { + promise.RejectWithErrorMessage( + "Failed to generate PDF: " + + print_to_pdf::PdfPrintResultToString(print_result)); + return; + } + + v8::Isolate* isolate = promise.isolate(); + gin_helper::Locker locker(isolate); + v8::HandleScope handle_scope(isolate); + v8::Context::Scope context_scope( + v8::Local<v8::Context>::New(isolate, promise.GetContext())); + + v8::Local<v8::Value> buffer = + node::Buffer::Copy(isolate, reinterpret_cast<const char*>(data->front()), + data->size()) + .ToLocalChecked(); + + promise.Resolve(buffer); +} +} // namespace + void WebContents::Print(gin::Arguments* args) { auto options = gin_helper::Dictionary::CreateEmpty(args->isolate()); base::Value::Dict settings; @@ -3108,9 +3135,8 @@ void WebContents::Print(gin::Arguments* args) { print_task_runner_->PostTaskAndReplyWithResult( FROM_HERE, base::BindOnce(&GetDeviceNameToUse, device_name), - base::BindOnce(&WebContents::OnGetDeviceNameToUse, - weak_factory_.GetWeakPtr(), std::move(settings), - std::move(callback))); + base::BindOnce(&OnGetDeviceNameToUse, web_contents()->GetWeakPtr(), + std::move(settings), std::move(callback))); } // Partially duplicated and modified from @@ -3168,36 +3194,10 @@ v8::Local<v8::Promise> WebContents::PrintToPDF(const base::Value& settings) { params->params->document_cookie = unique_id.value_or(0); manager->PrintToPdf(rfh, page_ranges, std::move(params), - base::BindOnce(&WebContents::OnPDFCreated, GetWeakPtr(), - std::move(promise))); + base::BindOnce(&OnPDFCreated, std::move(promise))); return handle; } - -void WebContents::OnPDFCreated( - gin_helper::Promise<v8::Local<v8::Value>> promise, - print_to_pdf::PdfPrintResult print_result, - scoped_refptr<base::RefCountedMemory> data) { - if (print_result != print_to_pdf::PdfPrintResult::kPrintSuccess) { - promise.RejectWithErrorMessage( - "Failed to generate PDF: " + - print_to_pdf::PdfPrintResultToString(print_result)); - return; - } - - v8::Isolate* isolate = promise.isolate(); - gin_helper::Locker locker(isolate); - v8::HandleScope handle_scope(isolate); - v8::Context::Scope context_scope( - v8::Local<v8::Context>::New(isolate, promise.GetContext())); - - v8::Local<v8::Value> buffer = - node::Buffer::Copy(isolate, reinterpret_cast<const char*>(data->front()), - data->size()) - .ToLocalChecked(); - - promise.Resolve(buffer); -} #endif void WebContents::AddWorkSpace(gin::Arguments* args, diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 1cfe2a1e9c..918d7c0c21 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -46,10 +46,6 @@ #include "shell/common/gin_helper/pinnable.h" #include "ui/base/models/image_model.h" -#if BUILDFLAG(ENABLE_PRINTING) -#include "shell/browser/printing/print_view_manager_electron.h" -#endif - #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) #include "extensions/common/mojom/view_type.mojom-forward.h" @@ -247,16 +243,9 @@ class WebContents final : public ExclusiveAccessContext, void HandleNewRenderFrame(content::RenderFrameHost* render_frame_host); #if BUILDFLAG(ENABLE_PRINTING) - void OnGetDeviceNameToUse(base::Value::Dict print_settings, - printing::CompletionCallback print_callback, - // <error, device_name> - std::pair<std::string, std::u16string> info); void Print(gin::Arguments* args); // Print current page as PDF. v8::Local<v8::Promise> PrintToPDF(const base::Value& settings); - void OnPDFCreated(gin_helper::Promise<v8::Local<v8::Value>> promise, - print_to_pdf::PdfPrintResult print_result, - scoped_refptr<base::RefCountedMemory> data); #endif void SetNextChildWebPreferences(const gin_helper::Dictionary); diff --git a/shell/browser/bluetooth/electron_bluetooth_delegate.cc b/shell/browser/bluetooth/electron_bluetooth_delegate.cc index 8db70add67..c23f601776 100644 --- a/shell/browser/bluetooth/electron_bluetooth_delegate.cc +++ b/shell/browser/bluetooth/electron_bluetooth_delegate.cc @@ -9,6 +9,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "device/bluetooth/bluetooth_device.h"
refactor
48c9149a52f73111f30f858f5340709a12e533e0
Robo
2024-11-20 02:48:15
fix: utility process exit code for graceful termination (reland) (#44726) * chore: reland "fix: utility process exit code for graceful termination" This reverts commit 1cae73ba092ccf5620c5fce8b896bade3a601346. * fix: exit code on posix when killed via api * chore: fix code style
diff --git a/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch b/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch index 4d7eb0de3f..f9b2591d1e 100644 --- a/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch +++ b/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch @@ -11,7 +11,7 @@ ServiceProcessHost::Observer functions, but we need to pass the exit code to the observer. diff --git a/content/browser/service_process_host_impl.cc b/content/browser/service_process_host_impl.cc -index f6082bada22c5f4e70af60ea6f555b0f363919c5..228f947edbe04bce242df62080052d9c383f1709 100644 +index f6082bada22c5f4e70af60ea6f555b0f363919c5..f691676a629bf82f81117599ae0bd0a4870c9f61 100644 --- a/content/browser/service_process_host_impl.cc +++ b/content/browser/service_process_host_impl.cc @@ -73,12 +73,15 @@ class ServiceProcessTracker { @@ -33,19 +33,7 @@ index f6082bada22c5f4e70af60ea6f555b0f363919c5..228f947edbe04bce242df62080052d9c processes_.erase(iter); } -@@ -87,6 +90,11 @@ class ServiceProcessTracker { - observers_.AddObserver(observer); - } - -+ bool HasObserver(ServiceProcessHost::Observer* observer) { -+ DCHECK_CURRENTLY_ON(BrowserThread::UI); -+ return observers_.HasObserver(observer); -+ } -+ - void RemoveObserver(ServiceProcessHost::Observer* observer) { - // NOTE: Some tests may remove observers after BrowserThreads are shut down. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || -@@ -154,7 +162,7 @@ class UtilityProcessClient : public UtilityProcessHost::Client { +@@ -154,7 +157,7 @@ class UtilityProcessClient : public UtilityProcessHost::Client { process_info_->service_process_id()); } @@ -54,7 +42,7 @@ index f6082bada22c5f4e70af60ea6f555b0f363919c5..228f947edbe04bce242df62080052d9c // TODO(crbug.com/40654042): It is unclear how we can observe // |OnProcessCrashed()| without observing |OnProcessLaunched()| first, but // it can happen on Android. Ignore the notification in this case. -@@ -162,7 +170,7 @@ class UtilityProcessClient : public UtilityProcessHost::Client { +@@ -162,7 +165,7 @@ class UtilityProcessClient : public UtilityProcessHost::Client { return; GetServiceProcessTracker().NotifyCrashed( @@ -63,18 +51,6 @@ index f6082bada22c5f4e70af60ea6f555b0f363919c5..228f947edbe04bce242df62080052d9c } private: -@@ -232,6 +240,11 @@ void ServiceProcessHost::AddObserver(Observer* observer) { - GetServiceProcessTracker().AddObserver(observer); - } - -+// static -+bool ServiceProcessHost::HasObserver(Observer* observer) { -+ return GetServiceProcessTracker().HasObserver(observer); -+} -+ - // static - void ServiceProcessHost::RemoveObserver(Observer* observer) { - GetServiceProcessTracker().RemoveObserver(observer); diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc index cdc2046f465110b60285da81fb0db7cdce064a59..8feca9f1c294b3de15d74dfc94508ee2a43e5fc3 100644 --- a/content/browser/utility_process_host.cc @@ -101,23 +77,8 @@ index 66cbabae31236758eef35bab211d4874f8a5c699..88515741fa08176ba9e952759c3a52e1 }; // This class is self-owned. It must be instantiated using new, and shouldn't -diff --git a/content/public/browser/service_process_host.h b/content/public/browser/service_process_host.h -index 611a52e908f4cb70fbe5628e220a082e45320b70..d7fefab99f86515007aff5f523a423a421850c47 100644 ---- a/content/public/browser/service_process_host.h -+++ b/content/public/browser/service_process_host.h -@@ -235,6 +235,10 @@ class CONTENT_EXPORT ServiceProcessHost { - // removed before destruction. Must be called from the UI thread only. - static void AddObserver(Observer* observer); - -+ // Returns true if the given observer is currently registered. -+ // Must be called from the UI thread only. -+ static bool HasObserver(Observer* observer); -+ - // Removes a registered observer. This must be called some time before - // |*observer| is destroyed and must be called from the UI thread only. - static void RemoveObserver(Observer* observer); diff --git a/content/public/browser/service_process_info.h b/content/public/browser/service_process_info.h -index 1a8656aef341cd3b23af588fb00569b79d6cd100..f904af7ee6bbacf4474e0939855ecf9f2c9a5eaa 100644 +index 1a8656aef341cd3b23af588fb00569b79d6cd100..6af523eb27a8c1e5529721c029e5b3ba0708b9fc 100644 --- a/content/public/browser/service_process_info.h +++ b/content/public/browser/service_process_info.h @@ -64,7 +64,13 @@ class CONTENT_EXPORT ServiceProcessInfo { @@ -129,7 +90,7 @@ index 1a8656aef341cd3b23af588fb00569b79d6cd100..f904af7ee6bbacf4474e0939855ecf9f + private: + // The exit code of the process, if it has exited. -+ int exit_code_; ++ int exit_code_ = 0; + // The name of the service interface for which the process was launched. std::string service_interface_name_; diff --git a/shell/browser/api/electron_api_utility_process.cc b/shell/browser/api/electron_api_utility_process.cc index 5c1fd14be0..de128ddd52 100644 --- a/shell/browser/api/electron_api_utility_process.cc +++ b/shell/browser/api/electron_api_utility_process.cc @@ -145,8 +145,8 @@ UtilityProcessWrapper::UtilityProcessWrapper( } } - if (!content::ServiceProcessHost::HasObserver(this)) - content::ServiceProcessHost::AddObserver(this); + // Watch for service process termination events. + content::ServiceProcessHost::AddObserver(this); mojo::PendingReceiver<node::mojom::NodeService> receiver = node_service_remote_.BindNewPipeAndPassReceiver(); @@ -258,6 +258,23 @@ void UtilityProcessWrapper::HandleTermination(uint64_t exit_code) { pid_ = base::kNullProcessId; CloseConnectorPort(); + if (killed_) { +#if BUILDFLAG(IS_POSIX) + // UtilityProcessWrapper::Kill relies on base::Process::Terminate + // to gracefully shutdown the process which is performed by sending + // SIGTERM signal. When listening for exit events via ServiceProcessHost + // observers, the exit code on posix is obtained via + // BrowserChildProcessHostImpl::GetTerminationInfo which inturn relies + // on waitpid to extract the exit signal. If the process is unavailable, + // then the exit_code will be set to 0, otherwise we get the signal that + // was sent during the base::Process::Terminate call. For a user, this is + // still a graceful shutdown case so lets' convert the exit code to the + // expected value. + if (exit_code == SIGTERM || exit_code == SIGKILL) { + exit_code = 0; + } +#endif + } EmitWithoutEvent("exit", exit_code); Unpin(); } @@ -337,7 +354,7 @@ void UtilityProcessWrapper::PostMessage(gin::Arguments* args) { connector_->Accept(&mojo_message); } -bool UtilityProcessWrapper::Kill() const { +bool UtilityProcessWrapper::Kill() { if (pid_ == base::kNullProcessId) return false; base::Process process = base::Process::Open(pid_); @@ -350,6 +367,7 @@ bool UtilityProcessWrapper::Kill() const { // process reap should be signaled through the zygote via // content::ZygoteCommunication::EnsureProcessTerminated. base::EnsureProcessTerminated(std::move(process)); + killed_ = result; return result; } diff --git a/shell/browser/api/electron_api_utility_process.h b/shell/browser/api/electron_api_utility_process.h index 7d5eae1710..c7fb48b0dd 100644 --- a/shell/browser/api/electron_api_utility_process.h +++ b/shell/browser/api/electron_api_utility_process.h @@ -76,7 +76,7 @@ class UtilityProcessWrapper final void HandleTermination(uint64_t exit_code); void PostMessage(gin::Arguments* args); - bool Kill() const; + bool Kill(); v8::Local<v8::Value> GetOSProcessId(v8::Isolate* isolate) const; // mojo::MessageReceiver @@ -106,6 +106,7 @@ class UtilityProcessWrapper final int stderr_read_fd_ = -1; bool connector_closed_ = false; bool terminated_ = false; + bool killed_ = false; std::unique_ptr<mojo::Connector> connector_; blink::MessagePortDescriptor host_port_; mojo::Receiver<node::mojom::NodeServiceClient> receiver_{this}; diff --git a/spec/api-utility-process-spec.ts b/spec/api-utility-process-spec.ts index 9967303214..364b7e8648 100644 --- a/spec/api-utility-process-spec.ts +++ b/spec/api-utility-process-spec.ts @@ -215,7 +215,8 @@ describe('utilityProcess module', () => { }); await once(child, 'spawn'); expect(child.kill()).to.be.true(); - await once(child, 'exit'); + const [code] = await once(child, 'exit'); + expect(code).to.equal(0); }); });
fix
8212616c761d95c9088770fbe6a05615a53cff4f
Milan Burda
2022-10-12 02:01:57
chore: remove WebKit leftovers after it was renamed to Blink (#35966)
diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 91efc6bb13..6319e6bd6f 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -951,7 +951,6 @@ step-minimize-workspace-size-from-checkout: &step-minimize-workspace-size-from-c rm -rf src/ios/chrome rm -rf src/third_party/blink/web_tests rm -rf src/third_party/blink/perf_tests - rm -rf src/third_party/WebKit/LayoutTests rm -rf third_party/electron_node/deps/openssl rm -rf third_party/electron_node/deps/v8 rm -rf chrome/test/data/xr/webvr_info diff --git a/appveyor.yml b/appveyor.yml index a7cdfe726c..574e5edf04 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -149,7 +149,7 @@ for: if ($env:SAVE_GCLIENT_SRC -eq 'true') { # archive current source for future use # only run on x64/woa to avoid contention saving - $(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30) + $(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30) if ($LASTEXITCODE -ne 0) { Write-warning "Could not save source to shared drive; continuing anyway" } diff --git a/docs/development/build-instructions-gn.md b/docs/development/build-instructions-gn.md index e066fd6780..4532a71ea6 100644 --- a/docs/development/build-instructions-gn.md +++ b/docs/development/build-instructions-gn.md @@ -146,7 +146,7 @@ $ ninja -C out/Release electron ``` This will build all of what was previously 'libchromiumcontent' (i.e. the -`content/` directory of `chromium` and its dependencies, incl. WebKit and V8), +`content/` directory of `chromium` and its dependencies, incl. Blink and V8), so it will take a while. The built executable will be under `./out/Testing`: diff --git a/shell/renderer/api/electron_api_spell_check_client.cc b/shell/renderer/api/electron_api_spell_check_client.cc index 12d2e207bf..916022a5d7 100644 --- a/shell/renderer/api/electron_api_spell_check_client.cc +++ b/shell/renderer/api/electron_api_spell_check_client.cc @@ -64,7 +64,7 @@ class SpellCheckClient::SpellcheckRequest { private: std::u16string text_; // Text to be checked in this task. std::vector<Word> word_list_; // List of Words found in text - // The interface to send the misspelled ranges to WebKit. + // The interface to send the misspelled ranges to Blink. std::unique_ptr<blink::WebTextCheckingCompletion> completion_; }; diff --git a/shell/renderer/api/electron_api_spell_check_client.h b/shell/renderer/api/electron_api_spell_check_client.h index bee731c1a6..c3a6b62c69 100644 --- a/shell/renderer/api/electron_api_spell_check_client.h +++ b/shell/renderer/api/electron_api_spell_check_client.h @@ -89,7 +89,7 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient, SpellcheckCharAttribute character_attributes_; // Represents word iterators used in this spellchecker. The |text_iterator_| - // splits text provided by WebKit into words, contractions, or concatenated + // splits text provided by Blink into words, contractions, or concatenated // words. The |contraction_iterator_| splits a concatenated word extracted by // |text_iterator_| into word components so we can treat a concatenated word // consisting only of correct words as a correct word. @@ -97,7 +97,7 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient, SpellcheckWordIterator contraction_iterator_; // The parameters of a pending background-spellchecking request. - // (When WebKit sends two or more requests, we cancel the previous + // (When Blink sends two or more requests, we cancel the previous // requests so we do not have to use vectors.) std::unique_ptr<SpellcheckRequest> pending_request_param_; diff --git a/spec/node-spec.ts b/spec/node-spec.ts index d30b1f8a5b..d682d12752 100644 --- a/spec/node-spec.ts +++ b/spec/node-spec.ts @@ -341,7 +341,7 @@ describe('node feature', () => { describe('Buffer', () => { useRemoteContext(); - itremote('can be created from WebKit external string', () => { + itremote('can be created from Blink external string', () => { const p = document.createElement('p'); p.innerText = '闲云潭影日悠悠,物换星移几度秋'; const b = Buffer.from(p.innerText);
chore
514a9319b9d81fa1f374a193ecfbb793b6de28ad
Shelley Vohr
2023-10-25 12:01:34
refactor: use non-deprecated `NSKeyedArchiver` APIs (#40315) * refactor: use non-deprecated NSKeyedArchiver APIs * chore: update patches --------- Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
diff --git a/patches/squirrel.mac/.patches b/patches/squirrel.mac/.patches index c36e985935..b6b24976e8 100644 --- a/patches/squirrel.mac/.patches +++ b/patches/squirrel.mac/.patches @@ -4,5 +4,5 @@ fix_use_kseccschecknestedcode_kseccsstrictvalidate_in_the_sec.patch feat_add_new_squirrel_mac_bundle_installation_method_behind_flag.patch refactor_use_posix_spawn_instead_of_nstask_so_we_can_disclaim_the.patch fix_abort_installation_attempt_at_the_final_mile_if_the_app_is.patch -chore_disable_api_deprecation_warnings_in_nskeyedarchiver.patch feat_add_ability_to_prevent_version_downgrades.patch +refactor_use_non-deprecated_nskeyedarchiver_apis.patch diff --git a/patches/squirrel.mac/chore_disable_api_deprecation_warnings_in_nskeyedarchiver.patch b/patches/squirrel.mac/chore_disable_api_deprecation_warnings_in_nskeyedarchiver.patch deleted file mode 100644 index c4760ca747..0000000000 --- a/patches/squirrel.mac/chore_disable_api_deprecation_warnings_in_nskeyedarchiver.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr <[email protected]> -Date: Thu, 22 Jun 2023 12:52:10 +0200 -Subject: chore: disable API deprecation warnings in NSKeyedArchiver - -This should be updated to use the newer APIs. - -Upstream PR at https://github.com/Squirrel/Squirrel.Mac/pull/273 - -diff --git a/Squirrel/SQRLInstaller.m b/Squirrel/SQRLInstaller.m -index f502df2f88424ea902a061adfeb30358daf212e4..a18fedc3e47eb9c8bb7afc42aeab7cef3df742a3 100644 ---- a/Squirrel/SQRLInstaller.m -+++ b/Squirrel/SQRLInstaller.m -@@ -182,14 +182,20 @@ - (SQRLInstallerOwnedBundle *)ownedBundle { - id archiveData = CFBridgingRelease(CFPreferencesCopyValue((__bridge CFStringRef)SQRLInstallerOwnedBundleKey, (__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost)); - if (![archiveData isKindOfClass:NSData.class]) return nil; - -+#pragma clang diagnostic push -+#pragma clang diagnostic ignored "-Wdeprecated-declarations" - SQRLInstallerOwnedBundle *ownedBundle = [NSKeyedUnarchiver unarchiveObjectWithData:archiveData]; - if (![ownedBundle isKindOfClass:SQRLInstallerOwnedBundle.class]) return nil; -+#pragma clang diagnostic pop - - return ownedBundle; - } - - - (void)setOwnedBundle:(SQRLInstallerOwnedBundle *)ownedBundle { -+#pragma clang diagnostic push -+#pragma clang diagnostic ignored "-Wdeprecated-declarations" - NSData *archiveData = (ownedBundle == nil ? nil : [NSKeyedArchiver archivedDataWithRootObject:ownedBundle]); -+#pragma clang diagnostic pop - CFPreferencesSetValue((__bridge CFStringRef)SQRLInstallerOwnedBundleKey, (__bridge CFPropertyListRef)archiveData, (__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost); - CFPreferencesSynchronize((__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost); - } diff --git a/patches/squirrel.mac/refactor_use_non-deprecated_nskeyedarchiver_apis.patch b/patches/squirrel.mac/refactor_use_non-deprecated_nskeyedarchiver_apis.patch new file mode 100644 index 0000000000..c18ba2b778 --- /dev/null +++ b/patches/squirrel.mac/refactor_use_non-deprecated_nskeyedarchiver_apis.patch @@ -0,0 +1,50 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr <[email protected]> +Date: Thu, 22 Jun 2023 12:26:24 +0200 +Subject: refactor: use non-deprecated NSKeyedArchiver APIs + +Refs https://chromium-review.googlesource.com/c/chromium/src/+/4628901 + +Several NSKeyedArchiver methods have been deprecated and replaced as of macOS 10.13: + +- unarchiveObjectWithData -> unarchivedObjectOfClass:fromData:error: +- archivedDataWithRootObject -> archivedDataWithRootObject:requiringSecureCoding:error: + +diff --git a/Squirrel/SQRLInstaller.m b/Squirrel/SQRLInstaller.m +index f502df2f88424ea902a061adfeb30358daf212e4..8db6406ec7f0cb51140ea2ee39c04f91626f6e18 100644 +--- a/Squirrel/SQRLInstaller.m ++++ b/Squirrel/SQRLInstaller.m +@@ -182,14 +182,30 @@ - (SQRLInstallerOwnedBundle *)ownedBundle { + id archiveData = CFBridgingRelease(CFPreferencesCopyValue((__bridge CFStringRef)SQRLInstallerOwnedBundleKey, (__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost)); + if (![archiveData isKindOfClass:NSData.class]) return nil; + +- SQRLInstallerOwnedBundle *ownedBundle = [NSKeyedUnarchiver unarchiveObjectWithData:archiveData]; +- if (![ownedBundle isKindOfClass:SQRLInstallerOwnedBundle.class]) return nil; ++ NSError *error; ++ SQRLInstallerOwnedBundle *ownedBundle = [NSKeyedUnarchiver unarchivedObjectOfClass:[SQRLInstallerOwnedBundle class] ++ fromData:archiveData ++ error:&error]; ++ if (error) { ++ NSLog(@"Couldn't unarchive ownedBundle - %@", error.localizedDescription); ++ return nil; ++ } + + return ownedBundle; + } + + - (void)setOwnedBundle:(SQRLInstallerOwnedBundle *)ownedBundle { +- NSData *archiveData = (ownedBundle == nil ? nil : [NSKeyedArchiver archivedDataWithRootObject:ownedBundle]); ++ NSData *archiveData = nil; ++ if (ownedBundle != nil) { ++ NSError *error; ++ archiveData = [NSKeyedArchiver archivedDataWithRootObject:ownedBundle ++ requiringSecureCoding:NO ++ error:&error]; ++ ++ if (error) ++ NSLog(@"Couldn't archive ownedBundle - %@", error.localizedDescription); ++ } ++ + CFPreferencesSetValue((__bridge CFStringRef)SQRLInstallerOwnedBundleKey, (__bridge CFPropertyListRef)archiveData, (__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost); + CFPreferencesSynchronize((__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost); + }
refactor
5904d31264faf7a3ca3c5d53ca8611c1a7e629a4
Charles Kerr
2024-09-18 16:23:29
perf: hold `V8FunctionInvoker` args in a `std::array` (#43752) perf: hold V8FunctionInvoker args in a std::array
diff --git a/shell/common/gin_helper/callback.h b/shell/common/gin_helper/callback.h index 2bd104d243..7be65ec6d4 100644 --- a/shell/common/gin_helper/callback.h +++ b/shell/common/gin_helper/callback.h @@ -5,8 +5,8 @@ #ifndef ELECTRON_SHELL_COMMON_GIN_HELPER_CALLBACK_H_ #define ELECTRON_SHELL_COMMON_GIN_HELPER_CALLBACK_H_ +#include <array> #include <utility> -#include <vector> #include "base/functional/bind.h" #include "shell/common/gin_converters/std_converter.h" @@ -54,7 +54,7 @@ struct V8FunctionInvoker<v8::Local<v8::Value>(ArgTypes...)> { isolate, context->GetMicrotaskQueue(), true, v8::MicrotasksScope::kRunMicrotasks}; v8::Context::Scope context_scope(context); - std::vector<v8::Local<v8::Value>> args{ + std::array<v8::Local<v8::Value>, sizeof...(raw)> args{ gin::ConvertToV8(isolate, std::forward<ArgTypes>(raw))...}; v8::MaybeLocal<v8::Value> ret = holder->Call( context, holder, args.size(), args.empty() ? nullptr : &args.front()); @@ -80,7 +80,7 @@ struct V8FunctionInvoker<void(ArgTypes...)> { isolate, context->GetMicrotaskQueue(), true, v8::MicrotasksScope::kRunMicrotasks}; v8::Context::Scope context_scope(context); - std::vector<v8::Local<v8::Value>> args{ + std::array<v8::Local<v8::Value>, sizeof...(raw)> args{ gin::ConvertToV8(isolate, std::forward<ArgTypes>(raw))...}; holder ->Call(context, holder, args.size(), @@ -105,7 +105,7 @@ struct V8FunctionInvoker<ReturnType(ArgTypes...)> { isolate, context->GetMicrotaskQueue(), true, v8::MicrotasksScope::kRunMicrotasks}; v8::Context::Scope context_scope(context); - std::vector<v8::Local<v8::Value>> args{ + std::array<v8::Local<v8::Value>, sizeof...(raw)> args{ gin::ConvertToV8(isolate, std::forward<ArgTypes>(raw))...}; v8::Local<v8::Value> result; auto maybe_result = holder->Call(context, holder, args.size(),
perf
7ebc427bf5d6c04ecc4b382a97bc2c28ab7934c9
Keeley Hammond
2024-09-30 22:14:46
build: update appveyor to node 20.17 (#44026) * build: update appveyor to node 20.17 * build: bake new images with npm dir * build: use e-131.0.6734.0-node-20.17-1
diff --git a/appveyor-woa.yml b/appveyor-woa.yml index d34824f1a8..8f1b628acf 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-131.0.6734.0 +image: e-131.0.6734.0-node-20.17-1 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default diff --git a/appveyor.yml b/appveyor.yml index 006b2fd311..b602131605 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-131.0.6734.0 +image: e-131.0.6734.0-node-20.17-1 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default diff --git a/script/setup-win-for-dev.bat b/script/setup-win-for-dev.bat index af870d068b..f83509d2bb 100644 --- a/script/setup-win-for-dev.bat +++ b/script/setup-win-for-dev.bat @@ -56,11 +56,15 @@ REM Install Windows SDK choco install windows-sdk-11-version-22h2-all REM Install nodejs python git and yarn needed dependencies -choco install -y --force nodejs --version=20.9.0 +choco install -y --force nodejs --version=20.17.0 choco install -y python2 git yarn choco install python --version 3.7.9 call C:\ProgramData\chocolatey\bin\RefreshEnv.cmd SET PATH=C:\Python27\;C:\Python27\Scripts;C:\Python39\;C:\Python39\Scripts;%PATH% +if exist "C:\Users\appveyor\AppData\Roaming\npm" ( + rm -rf "C:\Users\appveyor\AppData\Roaming\npm" + mkdir "C:\Users\appveyor\AppData\Roaming\npm" +) if not exist "C:\Users\appveyor\AppData\Roaming\npm" ( mkdir "C:\Users\appveyor\AppData\Roaming\npm" )
build
99b0d63c8457742b50a7980d26c4dfe392228dac
Jeremy Rose
2022-12-05 17:53:07
ci(not-really): autoclose issues with blocked/need-repro and no response (#36532)
diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 11d9945852..427db8209d 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -11,10 +11,9 @@ jobs: issue-labeled: permissions: issues: write # for actions-cool/issues-helper to update issues - pull-requests: write # for actions-cool/issues-helper to update PRs runs-on: ubuntu-latest steps: - - name: blocked/need-repro + - name: blocked/need-repro label added if: github.event.label.name == 'blocked/need-repro' uses: actions-cool/issues-helper@dad28fdb88da5f082c04659b7373d85790f9b135 # v3.3.0 with: @@ -27,4 +26,3 @@ jobs: Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests. Now adding the `blocked/need-repro` label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed. - diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b5278ad8ea..47333e4954 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -23,3 +23,14 @@ jobs: This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue. exempt-issue-labels: "discussion,security \U0001F512,enhancement :sparkles:" only-pr-labels: not-a-real-label + pending-repro: + steps: + - uses: actions/stale@3de2653986ebd134983c79fe2be5d45cc3d9f4e1 + with: + days-before-stale: -1 + days-before-close: 10 + stale-issue-label: blocked/need-repro + stale-pr-label: not-a-real-label + operations-per-run: 1750 + close-issue-message: > + Unfortunately, without a way to reproduce this issue, we're unable to continue investigation. This issue has been closed and will not be monitored further. If you're able to provide a minimal test case that reproduces this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue.
ci
0222686e9af18c673435afa8418450da2319a2de
nashaofu
2024-04-18 06:46:52
docs: update build docs,support Powershell on Windows (#41567) * docs: update build docs,support Powershell on Windows * chore: fix capitalization
diff --git a/docs/development/build-instructions-gn.md b/docs/development/build-instructions-gn.md index acf7cf048a..7cc709cddb 100644 --- a/docs/development/build-instructions-gn.md +++ b/docs/development/build-instructions-gn.md @@ -110,20 +110,49 @@ $ export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools On Windows: ```sh +# cmd $ cd src $ set CHROMIUM_BUILDTOOLS_PATH=%cd%\buildtools + +# PowerShell +$ cd src +$ $env:CHROMIUM_BUILDTOOLS_PATH = "$(Get-Location)\buildtools" ``` **To generate Testing build config of Electron:** +On Linux & MacOS + +```sh +$ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")" +``` + +On Windows: + ```sh +# cmd $ gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\")" + +# PowerShell +gn gen out/Testing --args="import(\`"//electron/build/args/testing.gn\`")" ``` **To generate Release build config of Electron:** +On Linux & MacOS + +```sh +$ gn gen out/Release --args="import(\"//electron/build/args/release.gn\")" +``` + +On Windows: + ```sh +# cmd $ gn gen out/Release --args="import(\"//electron/build/args/release.gn\")" + +# PowerShell +$ gn gen out/Release --args="import(\`"//electron/build/args/release.gn\`")" ``` **Note:** This will generate a `out/Testing` or `out/Release` build directory under `src/` with the testing or release build depending upon the configuration passed above. You can replace `Testing|Release` with another names, but it should be a subdirectory of `out`.
docs
ee7cf5a6d40096a887166cfe714cd6de79052b64
Shelley Vohr
2022-10-11 16:06:34
fix: `webContents.printToPDF` option plumbing (#35975) fix: contents.printToPDF option plumbing
diff --git a/lib/browser/api/web-contents.ts b/lib/browser/api/web-contents.ts index 640c1f79e5..b38000b11e 100644 --- a/lib/browser/api/web-contents.ts +++ b/lib/browser/api/web-contents.ts @@ -174,13 +174,13 @@ WebContents.prototype.printToPDF = async function (options) { headerTemplate: '', footerTemplate: '', printBackground: false, - scale: 1, + scale: 1.0, paperWidth: 8.5, - paperHeight: 11, - marginTop: 0, - marginBottom: 0, - marginLeft: 0, - marginRight: 0, + paperHeight: 11.0, + marginTop: 0.0, + marginBottom: 0.0, + marginLeft: 0.0, + marginRight: 0.0, pageRanges: '', preferCSSPageSize: false }; @@ -210,7 +210,7 @@ WebContents.prototype.printToPDF = async function (options) { if (typeof options.scale !== 'number') { return Promise.reject(new Error('scale must be a Number')); } - printSettings.scaleFactor = options.scale; + printSettings.scale = options.scale; } const { pageSize } = options; diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 5fef7db997..f9dd705037 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -2857,12 +2857,12 @@ v8::Local<v8::Promise> WebContents::PrintToPDF(const base::Value& settings) { settings.GetDict().FindBool("displayHeaderFooter"); auto print_background = settings.GetDict().FindBool("shouldPrintBackgrounds"); auto scale = settings.GetDict().FindDouble("scale"); - auto paper_width = settings.GetDict().FindInt("paperWidth"); - auto paper_height = settings.GetDict().FindInt("paperHeight"); - auto margin_top = settings.GetDict().FindIntByDottedPath("margins.top"); - auto margin_bottom = settings.GetDict().FindIntByDottedPath("margins.bottom"); - auto margin_left = settings.GetDict().FindIntByDottedPath("margins.left"); - auto margin_right = settings.GetDict().FindIntByDottedPath("margins.right"); + auto paper_width = settings.GetDict().FindDouble("paperWidth"); + auto paper_height = settings.GetDict().FindDouble("paperHeight"); + auto margin_top = settings.GetDict().FindDouble("marginTop"); + auto margin_bottom = settings.GetDict().FindDouble("marginBottom"); + auto margin_left = settings.GetDict().FindDouble("marginLeft"); + auto margin_right = settings.GetDict().FindDouble("marginRight"); auto page_ranges = *settings.GetDict().FindString("pageRanges"); auto header_template = *settings.GetDict().FindString("headerTemplate"); auto footer_template = *settings.GetDict().FindString("footerTemplate");
fix
3b69a542fbb1a84a3d2b531a152f18e9e88b1666
github-actions[bot]
2023-03-13 19:44:27
build: update appveyor image to latest version (#37561) * build: update appveyor image to latest version * build: update appveyor-woa.yml with latest image * build: modify action to update both appveyor & appveyor-woa --------- Co-authored-by: jkleinsc <[email protected]> Co-authored-by: Keeley Hammond <[email protected]>
diff --git a/.github/workflows/update_appveyor_image.yml b/.github/workflows/update_appveyor_image.yml index 977cd9d669..08644e4571 100644 --- a/.github/workflows/update_appveyor_image.yml +++ b/.github/workflows/update_appveyor_image.yml @@ -47,6 +47,12 @@ jobs: diff -w -B appveyor.yml appveyor2.yml > appveyor.diff || true patch -f appveyor.yml < appveyor.diff rm appveyor2.yml appveyor.diff + - name: (Optionally) Generate Commit Diff for WOA + if: ${{ env.APPVEYOR_IMAGE_VERSION }} + run: | + diff -w -B appveyor-woa.yml appveyor-woa2.yml > appveyor-woa.diff || true + patch -f appveyor-woa.yml < appveyor-woa.diff + rm appveyor-woa2.yml appveyor-woa.diff - name: (Optionally) Commit and Pull Request if: ${{ env.APPVEYOR_IMAGE_VERSION }} uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3 diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 6066059457..b05c6e1ee0 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-112.0.5607.0-vs2022 +image: e-113.0.5636.0 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default diff --git a/appveyor.yml b/appveyor.yml index d1ac6aa8f5..7c5352760b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-112.0.5607.0-vs2022 +image: e-113.0.5636.0 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default
build
46d316692d79aa988f1bb29c198da099d5221bbd
Robo
2025-02-11 15:04:07
fix: asan build on macOS (#45541) * fix: asan build on macOS * chore: fix build
diff --git a/patches/node/.patches b/patches/node/.patches index 71feba8eed..4434a36703 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -38,3 +38,4 @@ build_use_third_party_simdutf.patch fix_remove_fastapitypedarray_usage.patch test_handle_explicit_resource_management_globals.patch linux_try_preadv64_pwritev64_before_preadv_pwritev_4683.patch +build_remove_explicit_linker_call_to_libm_on_macos.patch diff --git a/patches/node/build_remove_explicit_linker_call_to_libm_on_macos.patch b/patches/node/build_remove_explicit_linker_call_to_libm_on_macos.patch new file mode 100644 index 0000000000..7ef14abffd --- /dev/null +++ b/patches/node/build_remove_explicit_linker_call_to_libm_on_macos.patch @@ -0,0 +1,59 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: deepak1556 <[email protected]> +Date: Mon, 3 Feb 2025 21:44:36 +0900 +Subject: build: remove explicit linker call to libm on macOS + +/usr/lib/libm.tbd is available via libSystem.*.dylib and +reexports sanitizer symbols. When building for asan +this becomes an issue as the linker will resolve the symbols +from the system library rather from libclang_rt.* + +For V8 that rely on specific version of these symbols +that get bundled as part of clang, for ex: +https://source.chromium.org/chromium/chromium/src/+/main:v8/src/heap/cppgc/platform.cc;l=93-97 +accepting nullptr for shadow_offset in `asan_get_shadow_mapping`, +linking to system version that doesn't support this will lead to +a crash. + +Clang driver eventually links with `-lSystem` +https://github.com/llvm/llvm-project/blob/e82f93890daefeb38fe2a22ee3db87a89948ec57/clang/lib/Driver/ToolChains/Darwin.cpp#L1628-L1631, +this is done after linking the sanitizer libraries which +ensures right order of resolution for the symbols. + +PR-URL: https://github.com/nodejs/node/pull/56901 +Reviewed-By: Joyee Cheung <[email protected]> +Reviewed-By: Chengzhong Wu <[email protected]> +Reviewed-By: Luigi Pinca <[email protected]> +Reviewed-By: Shelley Vohr <[email protected]> + +diff --git a/deps/brotli/unofficial.gni b/deps/brotli/unofficial.gni +index 5e07e106672a04508a77584c109c97a67926c858..91001fa43ea4807d061f296eaeccb7512e34863e 100644 +--- a/deps/brotli/unofficial.gni ++++ b/deps/brotli/unofficial.gni +@@ -25,7 +25,7 @@ template("brotli_gn_build") { + } else if (target_os == "freebsd") { + defines = [ "OS_FREEBSD" ] + } +- if (!is_win) { ++ if (is_linux) { + libs = [ "m" ] + } + if (is_clang || !is_win) { +diff --git a/deps/uv/unofficial.gni b/deps/uv/unofficial.gni +index 7a73f891e3fc3261b77af97af63fca2eade49849..bda1b5dc899558c2b4a22377dde9fb3bcce5488c 100644 +--- a/deps/uv/unofficial.gni ++++ b/deps/uv/unofficial.gni +@@ -82,11 +82,11 @@ template("uv_gn_build") { + ] + } + if (is_posix) { +- libs = [ "m" ] + ldflags = [ "-pthread" ] + } + if (is_linux) { +- libs += [ ++ libs = [ ++ "m", + "dl", + "rt", + ]
fix
5b18cc46bc4ef293a5cfe54c52b94447bd7dc11c
Charles Kerr
2024-08-02 09:02:11
chore: bump chromium to 129.0.6630.0 (main) (#43087) * chore: bump chromium in DEPS to 129.0.6623.0 * chore: update mas_avoid_private_macos_api_usage.patch.patch remove the changes to media/audio/mac/audio_manager_mac.cc, since upstream has also made this change now. Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5738654 * chore: update fix_disable_scope_reuse_associated_dchecks.patch We had been removing a couple of `DCHECK`. Upstream changed their code to limit when these `DCHECK`s get called, so let's see if our change is still needed. Xref: https://chromium-review.googlesource.com/c/v8/v8/+/5739076 * chore: e patches all * Bump the Chrome macOS deployment target to 11.0 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5734361 BREAKING CHANGE: Bump the Chrome macOS deployment target to 11.0 * src: stop using deprecated fields of `v8::FastApiCallbackOptions` Xref: https://github.com/nodejs/node/commit/d0000b118d9d7966afda4da209e09830d2a4aa95 Xref: https://chromium-review.googlesource.com/c/v8/v8/+/5741336 Xref: https://chromium-review.googlesource.com/c/v8/v8/+/5741199 * fixup! chore: update fix_disable_scope_reuse_associated_dchecks.patch chore: re-disable DCHECKs yep, it is still needed * refactor use non-deprecated variant of openApplicationAtURL old version is deprecated now in macOS 11 Xref: https://developer.apple.com/documentation/appkit/nsworkspace/1534810-launchapplicationaturl Xref: https://developer.apple.com/documentation/appkit/nsworkspace/3172700-openapplicationaturl * chore: bump chromium in DEPS to 129.0.6626.0 * chore: e patches all * chore: disable NSUserNotification deprecation errors * chore: disable NSWindowStyleMaskTexturedBackground deprecation errors Xref: https://github.com/electron/electron/issues/43125 * chore: disable deprecation errors in platform_util_mac.mm * chore: disable launchApplication deprecation errors * chore: bump chromium in DEPS to 129.0.6630.0 * chore: update refactor_expose_file_system_access_blocklist.patch apply patch manually due to context shear Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5745444 * chore: update deps_add_v8_object_setinternalfieldfornodecore.patch no manual changes. patch applied with fuzz 1 (offset -5 lines) * chore: e patches all * fix: add clang_x64_v8_arm64/snapshot_blob.bin to the zip manifest Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5746173 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
diff --git a/BUILD.gn b/BUILD.gn index 47085deb52..8839a1d56d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -38,7 +38,7 @@ if (is_mac) { import("build/rules.gni") assert( - mac_deployment_target == "10.15", + mac_deployment_target == "11.0", "Chromium has updated the mac_deployment_target, please update this assert, update the supported versions documentation (docs/tutorial/support.md) and flag this as a breaking change") } diff --git a/DEPS b/DEPS index fe54874a9f..ce79fb59cb 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ gclient_gn_args_from = 'src' vars = { 'chromium_version': - '129.0.6616.0', + '129.0.6630.0', 'node_version': 'v20.16.0', 'nan_version': diff --git a/README.md b/README.md index bc52ab87b1..7d5f9cc870 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ For more installation options and troubleshooting tips, see Each Electron release provides binaries for macOS, Windows, and Linux. -* macOS (Catalina and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11. +* macOS (Big Sur and up): Electron provides 64-bit Intel and Apple Silicon / ARM binaries for macOS. * Windows (Windows 10 and up): Electron provides `ia32` (`x86`), `x64` (`amd64`), and `arm64` binaries for Windows. Windows on ARM support was added in Electron 5.0.8. Support for Windows 7, 8 and 8.1 was [removed in Electron 23, in line with Chromium's Windows deprecation policy](https://www.electronjs.org/blog/windows-7-to-8-1-deprecation-notice). * Linux: The prebuilt binaries of Electron are built on Ubuntu 20.04. They have also been verified to work on: * Ubuntu 18.04 and newer diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 1f5774ca12..454f8243fd 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -14,6 +14,13 @@ This document uses the following convention to categorize breaking changes: ## Planned Breaking API Changes (33.0) +### Removed: macOS 10.15 support + +macOS 10.15 (Catalina) is no longer supported by [Chromium](https://chromium-review.googlesource.com/c/chromium/src/+/5734361). + +Older versions of Electron will continue to run on Catalina, but macOS 11 (Big Sur) +or later will be required to run Electron v33.0.0 and higher. + ### Deprecated: `systemPreferences.accessibilityDisplayShouldReduceTransparency` The `systemPreferences.accessibilityDisplayShouldReduceTransparency` property is now deprecated in favor of the new `nativeTheme.prefersReducedTransparency`, which provides identical information and works cross-platform. diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index 495fec0fdf..fbeaf4163f 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -10,10 +10,10 @@ DidCreateScriptContext is called, not all JS APIs are available in the context, which can cause some preload scripts to trip. diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h -index c313c0342f0e470db13a4c95473decbc8dbdcbd3..10c6596a8cd06aebf19b4302a60eb78eb09f29de 100644 +index ad0092ef2e13853e4bb8b923481559a043b00ab7..1c2dfd23f18733e21312992877ae1499634d3849 100644 --- a/content/public/renderer/render_frame_observer.h +++ b/content/public/renderer/render_frame_observer.h -@@ -145,6 +145,8 @@ class CONTENT_EXPORT RenderFrameObserver +@@ -150,6 +150,8 @@ class CONTENT_EXPORT RenderFrameObserver virtual void DidHandleOnloadEvents() {} virtual void DidCreateScriptContext(v8::Local<v8::Context> context, int32_t world_id) {} @@ -23,7 +23,7 @@ index c313c0342f0e470db13a4c95473decbc8dbdcbd3..10c6596a8cd06aebf19b4302a60eb78e int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index d833b71a88e91b128236233323fdf6c3d2972f9f..5b6c4847a1d14cb5e092b065be733f0a2a088046 100644 +index b9e128fb9004bef258b1f7729ca57c72d3087c0b..57dda67651116b7a91e58306cfa1a24d50c14676 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -4689,6 +4689,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context, @@ -40,7 +40,7 @@ index d833b71a88e91b128236233323fdf6c3d2972f9f..5b6c4847a1d14cb5e092b065be733f0a int world_id) { for (auto& observer : observers_) diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h -index 7dff22180ef00c04ef1291929448d5fe8c1bb79a..1b611f429beac2de78f3ae9e3cbedc94e7793dc0 100644 +index 8ecebbc688791772b6a66dfc8057f6df40fa2f94..8ccff650148f30fd8bcc40797e97fb4c11e6ac93 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h @@ -643,6 +643,8 @@ class CONTENT_EXPORT RenderFrameImpl @@ -53,7 +53,7 @@ index 7dff22180ef00c04ef1291929448d5fe8c1bb79a..1b611f429beac2de78f3ae9e3cbedc94 int world_id) override; void DidChangeScrollOffset() override; diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h -index 5bedd97cb999b3bf063b2cf46d95b655ac35afb4..4f5b7f661f11629602454d2f295a806fb7d63b70 100644 +index 1a8345bb370a682e017a25b31013e384c68f451c..9de96f995fdbc0419db2c352a81b6fae2edf20b4 100644 --- a/third_party/blink/public/web/web_local_frame_client.h +++ b/third_party/blink/public/web/web_local_frame_client.h @@ -647,6 +647,9 @@ class BLINK_EXPORT WebLocalFrameClient { @@ -123,10 +123,10 @@ index 1ea7ea4a054bea4711eeb6da14b83f54f7527cb1..ee3048b311f35483fd57bead855e3618 int32_t world_id) override; diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h -index d4e7bbc860b9cc2c27cdd8393a184e90d44214b9..66a37e0b6bcfe9714c1a11d76aa1789ccfc3862f 100644 +index a270e9311886e4ff1cffd4bf31a72997e0ad4542..9c44fee91a1b4db78e278758688c262792e1c302 100644 --- a/third_party/blink/renderer/core/loader/empty_clients.h +++ b/third_party/blink/renderer/core/loader/empty_clients.h -@@ -412,6 +412,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient { +@@ -408,6 +408,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient { void DidCreateScriptContext(v8::Local<v8::Context>, int32_t world_id) override {} diff --git a/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch b/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch index 68e731c7f9..9ca0963e79 100644 --- a/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch +++ b/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch @@ -8,10 +8,10 @@ decorations in maximized mode where needed, preventing empty space caused by decoration shadows and rounded titlebars around the window while maximized. diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc -index ca2fc0b1b3fe9f7fd65f55f8924b4b5e324bfdd4..da8ebfad6404c59471dc31625aeb4e68659116a3 100644 +index 3ad76e316d4dc2009f0637618b39f16c24c64809..853edba64e5c7473d32889425223cd07b7975a72 100644 --- a/ui/gtk/gtk_ui.cc +++ b/ui/gtk/gtk_ui.cc -@@ -577,11 +577,12 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() { +@@ -582,11 +582,12 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() { } ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame, diff --git a/patches/chromium/add_ui_scopedcliboardwriter_writeunsaferawdata.patch b/patches/chromium/add_ui_scopedcliboardwriter_writeunsaferawdata.patch index 3d50d0d5df..dc6ecfe4a7 100644 --- a/patches/chromium/add_ui_scopedcliboardwriter_writeunsaferawdata.patch +++ b/patches/chromium/add_ui_scopedcliboardwriter_writeunsaferawdata.patch @@ -8,10 +8,10 @@ was removed as part of the Raw Clipboard API scrubbing. https://bugs.chromium.org/p/chromium/issues/detail?id=1217643 diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc -index 6022a0af4241fe65bd03d7cbf95785e8879dc78e..ec9e4c6ece9014b66e7d65e99cda2b956a9a5d80 100644 +index 2edb0b7c59bbe65d543c65738db0dd5a5b487c23..76d74f86ebdb2b7498cceba0d52728c05e0d9385 100644 --- a/ui/base/clipboard/scoped_clipboard_writer.cc +++ b/ui/base/clipboard/scoped_clipboard_writer.cc -@@ -229,6 +229,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting( +@@ -234,6 +234,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting( } #endif // BUILDFLAG(IS_CHROMEOS_ASH) diff --git a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch index 02ed8e259d..836bb5c396 100644 --- a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch +++ b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch @@ -6,7 +6,7 @@ Subject: allow disabling blink scheduler throttling per RenderView This allows us to disable throttling for hidden windows. diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc -index b5934f99861b11afe1b695ac25886ee0d059d0ab..419f823a094c1b163d7a5b441f1b034c0dada66b 100644 +index 68ef2666b57f95f0a4f463c34ca4b074b9e38d87..d399155b4221f4ea49cc57b14d2cd08493d040e7 100644 --- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc +++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc @@ -163,6 +163,12 @@ class MockPageBroadcast : public blink::mojom::PageBroadcast { diff --git a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch index e337860a09..450fe3e20f 100644 --- a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch +++ b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch @@ -33,10 +33,10 @@ index 7ef8050aa89bb4132680c6d00d5d6ab3ecfdc713..bcf823da79171196447708b12c6bfd15 "//base", "//build:branding_buildflags", diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 4e5bc3a5d19cf77687503b0abbc36390527b7b79..84c39a1afb36c59bfcf1fbd4c8fa2b22cba8f6cd 100644 +index 61c43d1fbd0823dd818de119201856c6ead600ba..fbdd0eb1738e46d78083c0814c306fdee046c829 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -4771,7 +4771,7 @@ static_library("browser") { +@@ -4605,7 +4605,7 @@ static_library("browser") { # On Windows, the hashes are embedded in //chrome:chrome_initial rather # than here in :chrome_dll. @@ -46,10 +46,10 @@ index 4e5bc3a5d19cf77687503b0abbc36390527b7b79..84c39a1afb36c59bfcf1fbd4c8fa2b22 sources += [ "certificate_viewer_stub.cc" ] } diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index a3fabbe86e5bca5334a4258e20aa3dd083031f7a..9014ac1d7bbbc92c94e5962f09bf5a2c38159576 100644 +index d462dcaf73b0b35b2de4b5db06cef90e5e242ee6..6291442ad205a1af5d25d03e3ef65e285045f3bf 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -7177,9 +7177,12 @@ test("unit_tests") { +@@ -7147,9 +7147,12 @@ test("unit_tests") { "//chrome/browser/safe_browsing/incident_reporting/verifier_test:verifier_test_dll_2", ] @@ -63,7 +63,7 @@ index a3fabbe86e5bca5334a4258e20aa3dd083031f7a..9014ac1d7bbbc92c94e5962f09bf5a2c "//chrome//services/util_win:unit_tests", "//chrome/app:chrome_dll_resources", "//chrome/app:win_unit_tests", -@@ -8201,6 +8204,10 @@ test("unit_tests") { +@@ -8176,6 +8179,10 @@ test("unit_tests") { "../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc", ] @@ -74,7 +74,7 @@ index a3fabbe86e5bca5334a4258e20aa3dd083031f7a..9014ac1d7bbbc92c94e5962f09bf5a2c sources += [ # The importer code is not used on Android. "../common/importer/firefox_importer_utils_unittest.cc", -@@ -8276,7 +8283,6 @@ test("unit_tests") { +@@ -8248,7 +8255,6 @@ test("unit_tests") { # Non-android deps for "unit_tests" target. deps += [ diff --git a/patches/chromium/build_make_libcxx_abi_unstable_false_for_electron.patch b/patches/chromium/build_make_libcxx_abi_unstable_false_for_electron.patch index 9ca190a794..c266daafce 100644 --- a/patches/chromium/build_make_libcxx_abi_unstable_false_for_electron.patch +++ b/patches/chromium/build_make_libcxx_abi_unstable_false_for_electron.patch @@ -6,7 +6,7 @@ Subject: build: make libcxx_abi_unstable false for electron https://nornagon.medium.com/a-libc-odyssey-973e51649063 diff --git a/buildtools/third_party/libc++/__config_site b/buildtools/third_party/libc++/__config_site -index fa27e632ead9758daebf8170e85deb1b459dfb5b..d0b6f567d2f2883cb33920b23444a0ab8ec207af 100644 +index 0d8e1cbe3d59a77bbef5eef0c2fa438923df8a52..1ee58aecb0b95536c3fe922125d9891335d16a9c 100644 --- a/buildtools/third_party/libc++/__config_site +++ b/buildtools/third_party/libc++/__config_site @@ -18,7 +18,9 @@ diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index e902aa436a..f18dc000f8 100644 --- a/patches/chromium/can_create_window.patch +++ b/patches/chromium/can_create_window.patch @@ -9,10 +9,10 @@ potentially prevent a window from being created. TODO(loc): this patch is currently broken. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index ba4144d79029ac05076d5cef01ea39d07a7630c2..952d0e3c3da884fef62494d81a1632c0806e40c8 100644 +index d04b3371729218029b1fcec462820eea0c595d23..c3d4f2dbf0131a80ce2e18c3f1f35f3b4aa5b6f7 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -8833,6 +8833,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -8852,6 +8852,7 @@ void RenderFrameHostImpl::CreateNewWindow( last_committed_origin_, params->window_container_type, params->target_url, params->referrer.To<Referrer>(), params->frame_name, params->disposition, *params->features, @@ -21,10 +21,10 @@ index ba4144d79029ac05076d5cef01ea39d07a7630c2..952d0e3c3da884fef62494d81a1632c0 &no_javascript_access); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 46d708a611db0e70d97fd811bd39ebf44783c227..7213f6d9b24bc505b1ab2044cdc50e5b36a3bad3 100644 +index c15230dc2060270b5b6d61b0264cce73d461748b..68b5d176f3b98e639f0c1c563b81a55f66c3b6d3 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4727,6 +4727,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4728,6 +4728,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( new_contents_impl->is_popup_ = params.disposition == WindowOpenDisposition::NEW_POPUP; @@ -37,7 +37,7 @@ index 46d708a611db0e70d97fd811bd39ebf44783c227..7213f6d9b24bc505b1ab2044cdc50e5b // If the new frame has a name, make sure any SiteInstances that can find // this named frame have proxies for it. Must be called after // SetSessionStorageNamespace, since this calls CreateRenderView, which uses -@@ -4768,12 +4774,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4769,12 +4775,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( AddWebContentsDestructionObserver(new_contents_impl); } @@ -79,7 +79,7 @@ index dc4110d8878b83c537f8ba32ecbf445ff766341f..83c3de7a2d65310faa4b52d9f5949901 bool opener_suppressed, bool* no_javascript_access) { diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index 77e3d993b3dc0b0e4121e98f8b05cef05d9cadd0..86154854493f5ad8b05b8f1649a126945d454f3d 100644 +index d4d906bdaac87eee0351612584473684e4fcc389..793c55425396998f7dfeba3c7dc0e59e90ef3874 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -189,6 +189,7 @@ class NetworkService; @@ -148,10 +148,10 @@ index 138761070b63c16ea440f9eee98fe1139e7c0b09..f7bfa43693cff1a55a1e59950f1ecb06 // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 7b443a718ba4d9aff69ba66a6e1ee40c760a03bb..d833b71a88e91b128236233323fdf6c3d2972f9f 100644 +index 812a7eb391f28a309446636858c9ec06a56cc8d4..b9e128fb9004bef258b1f7729ca57c72d3087c0b 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -6664,6 +6664,10 @@ WebView* RenderFrameImpl::CreateNewWindow( +@@ -6671,6 +6671,10 @@ WebView* RenderFrameImpl::CreateNewWindow( request.HasUserGesture(), GetWebFrame()->IsAdFrame(), GetWebFrame()->IsAdScriptInStack()); diff --git a/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch b/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch index e6e60c3f3e..d7e7866b2a 100644 --- a/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch +++ b/patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch @@ -34,10 +34,10 @@ index e5b304f90ef8f005921a646219aa6e8f032b575c..f5bb3f3e9bb16d25f781747de5b70aff Widget* GetWidget(); const Widget* GetWidget() const; diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 9f6c259cd5a664cf8384e412ba78af11361562fd..00c496989ec89e6c849b200bac59932159f6a6dc 100644 +index 0b199e2df281aed6224787aaf467ed95ddf61f8f..a7f5a0cebcd8834fd39badbac7740baad1fc0456 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -3132,15 +3132,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3122,15 +3122,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, SetMsgHandled(FALSE); // We must let Windows handle the caption buttons if it's drawing them, or // they won't work. diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index b165ab1598..7dfc958997 100644 --- a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch +++ b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch @@ -80,10 +80,10 @@ index 28cd699814f32a7a569d63936b9544567a66d9c4..fd461fa448d983481dc4c0c7d03b1945 } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc -index 255714d953d3177347a395a2cc235961fbb16650..03074109ef58a2c18cef7ef7632eebb148411a7b 100644 +index 92aa9eb2d38485a388cd6da519fa8feaf8ce0178..ad05a3c7fd5ac74d0af44fa55b83899e41c655e6 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc -@@ -2094,12 +2094,11 @@ bool Browser::IsWebContentsCreationOverridden( +@@ -2117,12 +2117,11 @@ bool Browser::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -99,10 +99,10 @@ index 255714d953d3177347a395a2cc235961fbb16650..03074109ef58a2c18cef7ef7632eebb1 WebContents* Browser::CreateCustomWebContents( diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h -index 58b91584d6140a4f0d68abc6de79f69d935d48fe..5860efd8ea5712c5bc3114fe0c1caacbfa00fdb6 100644 +index dcd6b10b61f6afde1e8f46c75a83d7982766d8d9..7cf7c88602c9e1c8292cc8ba49150c663032a948 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h -@@ -986,8 +986,7 @@ class Browser : public TabStripModelObserver, +@@ -993,8 +993,7 @@ class Browser : public TabStripModelObserver, content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -141,7 +141,7 @@ index ca72b324bf7c3b81ac94b53f0ff454d2df177950..d60ef3075d126e2bbd50c8469f2bf67c // The profile used for the presentation. raw_ptr<Profile, DanglingUntriaged> otr_profile_; diff --git a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc -index 1b29ac2afdbbc10ea59649b741e17583abf10536..cef3d60636e39cab514c45a085cc3a1d6587729a 100644 +index 7350c38fa03a7f3176e0727631863eba470683ca..3792bc743d4eeea5305a69f9a2dab9e29a1d1d5d 100644 --- a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc +++ b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc @@ -75,8 +75,7 @@ class HatsNextWebDialog::HatsWebView : public views::WebView { @@ -218,10 +218,10 @@ index c5b0d3b23b8da318ae55fcac2515a1187f261469..16ed1f46c9afde0ff25750128b4fcff6 void AddNewContents(content::WebContents* source, std::unique_ptr<content::WebContents> new_contents, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 970d56419b675b461b9c1e2fffadc2302c3d94a0..a473ff79dd958560365087a2bc3156191cf450ef 100644 +index bf42c63ea9282b814a35eb56fd64db4411516a9a..05f2d3dbeb8aae82cacec6c223f2defb1174151d 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4629,8 +4629,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4630,8 +4630,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( if (delegate_ && delegate_->IsWebContentsCreationOverridden( source_site_instance, params.window_container_type, diff --git a/patches/chromium/chore_remove_reference_to_chrome_browser_themes.patch b/patches/chromium/chore_remove_reference_to_chrome_browser_themes.patch index b7bddb7a37..ecd1c8ebc5 100644 --- a/patches/chromium/chore_remove_reference_to_chrome_browser_themes.patch +++ b/patches/chromium/chore_remove_reference_to_chrome_browser_themes.patch @@ -11,10 +11,10 @@ not need this dependency. refs https://chromium-review.googlesource.com/c/chromium/src/+/5573603 diff --git a/chrome/browser/ui/color/BUILD.gn b/chrome/browser/ui/color/BUILD.gn -index 9d3db1e12d5f7a888879e6d2b0c67f49c1bd0be8..13f048055e1b8de14f6066f2567f60eed67cd16d 100644 +index 55ec05de53365f160a692d706588df5bfc782401..f54c4be56f802c6cc1776c2b2fd67835ae4bed5e 100644 --- a/chrome/browser/ui/color/BUILD.gn +++ b/chrome/browser/ui/color/BUILD.gn -@@ -89,9 +89,6 @@ source_set("mixers") { +@@ -88,9 +88,6 @@ source_set("mixers") { ] } diff --git a/patches/chromium/command-ismediakey.patch b/patches/chromium/command-ismediakey.patch index bea48b838e..88f44553e1 100644 --- a/patches/chromium/command-ismediakey.patch +++ b/patches/chromium/command-ismediakey.patch @@ -66,10 +66,10 @@ index 3c2fc1707e38345c114e140104ffc5a93d704918..40dac9fd7beb7a1a589a479a8035391d bool is_listening_ = false; diff --git a/chrome/browser/extensions/global_shortcut_listener_win.cc b/chrome/browser/extensions/global_shortcut_listener_win.cc -index 2ce5b0038cb613d0a70d7c086e470f4428160b4b..5fa64783dc49193770fa316be92e82f4d73e901b 100644 +index ac1142e268b88b7332f556344491288d8539a5c9..c23852622e292b056d8dbbeb2a83dd29de1743fd 100644 --- a/chrome/browser/extensions/global_shortcut_listener_win.cc +++ b/chrome/browser/extensions/global_shortcut_listener_win.cc -@@ -63,6 +63,8 @@ void GlobalShortcutListenerWin::OnWndProc(HWND hwnd, +@@ -64,6 +64,8 @@ void GlobalShortcutListenerWin::OnWndProc(HWND hwnd, modifiers |= (LOWORD(lparam) & MOD_SHIFT) ? ui::EF_SHIFT_DOWN : 0; modifiers |= (LOWORD(lparam) & MOD_ALT) ? ui::EF_ALT_DOWN : 0; modifiers |= (LOWORD(lparam) & MOD_CONTROL) ? ui::EF_CONTROL_DOWN : 0; @@ -78,7 +78,7 @@ index 2ce5b0038cb613d0a70d7c086e470f4428160b4b..5fa64783dc49193770fa316be92e82f4 ui::Accelerator accelerator( ui::KeyboardCodeForWindowsKeyCode(key_code), modifiers); -@@ -93,6 +95,7 @@ bool GlobalShortcutListenerWin::RegisterAcceleratorImpl( +@@ -94,6 +96,7 @@ bool GlobalShortcutListenerWin::RegisterAcceleratorImpl( modifiers |= accelerator.IsShiftDown() ? MOD_SHIFT : 0; modifiers |= accelerator.IsCtrlDown() ? MOD_CONTROL : 0; modifiers |= accelerator.IsAltDown() ? MOD_ALT : 0; @@ -158,10 +158,10 @@ index a955d19eedfe56ae3a115ce4c77fea016fd66d49..ad2557495a02cae03dd2b87df8659a6f } diff --git a/ui/base/x/x11_global_shortcut_listener.cc b/ui/base/x/x11_global_shortcut_listener.cc -index e18825e295cf55d0b6cd899fbab1f0a477ade370..9b69bc04d13ac294d213988269649cafa9122012 100644 +index fd4f6d05235aff8383fe1c2a089883022871f27c..163b1975faed07351855098ac69ef5c2915621b1 100644 --- a/ui/base/x/x11_global_shortcut_listener.cc +++ b/ui/base/x/x11_global_shortcut_listener.cc -@@ -31,11 +31,13 @@ const x11::ModMask kModifiersMasks[] = { +@@ -36,11 +36,13 @@ const x11::ModMask kModifiersMasks[] = { x11::ModMask GetNativeModifiers(bool is_alt_down, bool is_ctrl_down, @@ -177,7 +177,7 @@ index e18825e295cf55d0b6cd899fbab1f0a477ade370..9b69bc04d13ac294d213988269649caf } } // namespace -@@ -81,8 +83,9 @@ uint32_t XGlobalShortcutListener::DispatchEvent(const PlatformEvent& event) { +@@ -86,8 +88,9 @@ uint32_t XGlobalShortcutListener::DispatchEvent(const PlatformEvent& event) { bool XGlobalShortcutListener::RegisterAccelerator(KeyboardCode key_code, bool is_alt_down, bool is_ctrl_down, @@ -189,7 +189,7 @@ index e18825e295cf55d0b6cd899fbab1f0a477ade370..9b69bc04d13ac294d213988269649caf auto keysym = XKeysymForWindowsKeyCode(key_code, false); auto keycode = connection_->KeysymToKeycode(keysym); -@@ -107,7 +110,7 @@ bool XGlobalShortcutListener::RegisterAccelerator(KeyboardCode key_code, +@@ -112,7 +115,7 @@ bool XGlobalShortcutListener::RegisterAccelerator(KeyboardCode key_code, } registered_combinations_.insert( @@ -198,7 +198,7 @@ index e18825e295cf55d0b6cd899fbab1f0a477ade370..9b69bc04d13ac294d213988269649caf return true; } -@@ -115,8 +118,9 @@ bool XGlobalShortcutListener::RegisterAccelerator(KeyboardCode key_code, +@@ -120,8 +123,9 @@ bool XGlobalShortcutListener::RegisterAccelerator(KeyboardCode key_code, void XGlobalShortcutListener::UnregisterAccelerator(KeyboardCode key_code, bool is_alt_down, bool is_ctrl_down, @@ -210,7 +210,7 @@ index e18825e295cf55d0b6cd899fbab1f0a477ade370..9b69bc04d13ac294d213988269649caf auto keysym = XKeysymForWindowsKeyCode(key_code, false); auto keycode = connection_->KeysymToKeycode(keysym); -@@ -124,7 +128,7 @@ void XGlobalShortcutListener::UnregisterAccelerator(KeyboardCode key_code, +@@ -129,7 +133,7 @@ void XGlobalShortcutListener::UnregisterAccelerator(KeyboardCode key_code, connection_->UngrabKey({keycode, x_root_window_, modifiers | mask}); registered_combinations_.erase( @@ -219,7 +219,7 @@ index e18825e295cf55d0b6cd899fbab1f0a477ade370..9b69bc04d13ac294d213988269649caf } void XGlobalShortcutListener::OnKeyPressEvent(const KeyEvent& event) { -@@ -134,14 +138,15 @@ void XGlobalShortcutListener::OnKeyPressEvent(const KeyEvent& event) { +@@ -139,14 +143,15 @@ void XGlobalShortcutListener::OnKeyPressEvent(const KeyEvent& event) { const bool is_alt_down = event.flags() & EF_ALT_DOWN; const bool is_ctrl_down = event.flags() & EF_CONTROL_DOWN; const bool is_shift_down = event.flags() & EF_SHIFT_DOWN; diff --git a/patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch b/patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch index 085525ad58..faf5a42094 100644 --- a/patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch +++ b/patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch @@ -95,7 +95,7 @@ index f482ce44b4339e0cf2a57a6a4f9db4d1be5fa178..49604d211b4d406fd59e7da3c4a648dd friend class ContentClientCreator; friend class ContentClientInitializer; diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc -index ee092cf1223844f999de54937737fb3451e0f8fc..9f87f9ec88daa6e12dad43e997e3139c86d87554 100644 +index 74f67a1c85c8430e1924eae3fb82dc708db4a0f8..a63cff7e09f56128f594800928d4e4633f42cec9 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc @@ -595,8 +595,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out, diff --git a/patches/chromium/disable_compositor_recycling.patch b/patches/chromium/disable_compositor_recycling.patch index 1245f554b3..2b9e279cd7 100644 --- a/patches/chromium/disable_compositor_recycling.patch +++ b/patches/chromium/disable_compositor_recycling.patch @@ -6,7 +6,7 @@ Subject: fix: disabling compositor recycling Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron. diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index 362b8c764317815dd69f7339b6d1eb614bc4fa16..ddc1f29b5392c94a3b6247a70c181985009ebe39 100644 +index fd3eeb9f52367e0c0fca33b82036290d02d4ca0d..5aa97cc936de10882841c2ea28f0b8bc480ba904 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -557,7 +557,11 @@ diff --git a/patches/chromium/disable_hidden.patch b/patches/chromium/disable_hidden.patch index 1d345e6a26..65eefeaf59 100644 --- a/patches/chromium/disable_hidden.patch +++ b/patches/chromium/disable_hidden.patch @@ -6,7 +6,7 @@ Subject: disable_hidden.patch Electron uses this to disable background throttling for hidden windows. diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index 2f1e760394a86c8e4f26e95a0837dabce9c61ddd..9910b595e250e5635310e33a66a00d654f41556a 100644 +index daa7119d62f77f46b2e539a6eed99d204461dc32..872270420493edb219d724a412242b6a0db114af 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -778,6 +778,9 @@ void RenderWidgetHostImpl::WasHidden() { diff --git a/patches/chromium/enable_reset_aspect_ratio.patch b/patches/chromium/enable_reset_aspect_ratio.patch index e056eb2fbc..03ae876154 100644 --- a/patches/chromium/enable_reset_aspect_ratio.patch +++ b/patches/chromium/enable_reset_aspect_ratio.patch @@ -19,10 +19,10 @@ index 3ddfd8a33bf8b6995067d0127dceffdef5dd934c..19f64aada7f8bc6b209a3f82c4087427 excluded_margin); } diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index a3cd6a4bc6c8f69f46fe16695329315a9b7c6bad..527de61ee739e78aec61d82138d1b56fc668e0bd 100644 +index 6bc81c605948eca2aa05089a939e3bd2ab79976b..73f62b38d4595e9dd3befba196756b311266013d 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -965,8 +965,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen, +@@ -959,8 +959,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen, void HWNDMessageHandler::SetAspectRatio(float aspect_ratio, const gfx::Size& excluded_margin) { diff --git a/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch b/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch index b139d537ac..0b1494dd4c 100644 --- a/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch +++ b/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch @@ -9,7 +9,7 @@ correctly tagged with MAP_JIT we need to use gins page allocator instead of the default V8 allocator. This probably can't be usptreamed. diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h -index a927d004d3cb5f03c0111b5a0af9668fe848b5fd..c19698b699e1f645aa03d4bcc1684aad74a40792 100644 +index 4a7725f038b00f6a7e2ba8edcda711a4c5b42628..addc8683b12eeef9deb5b7e0e816fdaca53511aa 100644 --- a/gin/public/v8_platform.h +++ b/gin/public/v8_platform.h @@ -32,6 +32,7 @@ class GIN_EXPORT V8Platform : public v8::Platform { @@ -21,7 +21,7 @@ index a927d004d3cb5f03c0111b5a0af9668fe848b5fd..c19698b699e1f645aa03d4bcc1684aad ThreadIsolatedAllocator* GetThreadIsolatedAllocator() override; #endif diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc -index 2bd35bd906038490cc6bc357a5e3974b64957775..0c54875a87822aae770dc2de3dbe3fa7d54444c5 100644 +index 9d9b8cbc6088be42beefd251ed86c64145b56eba..e3364349f371488428bec3a707bba17e5fa4eda0 100644 --- a/gin/v8_platform.cc +++ b/gin/v8_platform.cc @@ -205,6 +205,10 @@ ThreadIsolatedAllocator* V8Platform::GetThreadIsolatedAllocator() { diff --git a/patches/chromium/expose_setuseragent_on_networkcontext.patch b/patches/chromium/expose_setuseragent_on_networkcontext.patch index 9b73e5527c..494d5f95e3 100644 --- a/patches/chromium/expose_setuseragent_on_networkcontext.patch +++ b/patches/chromium/expose_setuseragent_on_networkcontext.patch @@ -33,10 +33,10 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4 } // namespace net diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index fccf51257d286956bce543d761a13a3a05c87288..2cbe1c5557f2be98ccb7229cd39e186ae81fcfd4 100644 +index 0d6d4d646bd6e7c187b5174edff2ddb0c51d7867..deb9e51c9c6a185dbd45fabe7e7b7454e8870026 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -1727,6 +1727,13 @@ void NetworkContext::SetNetworkConditions( +@@ -1728,6 +1728,13 @@ void NetworkContext::SetNetworkConditions( std::move(network_conditions)); } @@ -51,7 +51,7 @@ index fccf51257d286956bce543d761a13a3a05c87288..2cbe1c5557f2be98ccb7229cd39e186a // This may only be called on NetworkContexts created with the constructor // that calls MakeURLRequestContext(). diff --git a/services/network/network_context.h b/services/network/network_context.h -index 6d0e259f0753d0f3962b8f9a35383ce0f5c7b2ea..a8ffcd3991afdb7f9cb1db27d6db54562344a7d0 100644 +index b0df50eca7d4bed289940ebdf968a36fd891297b..02c6fabb412cfbf3c33602d29a0e2d52d375a855 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h @@ -315,6 +315,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext @@ -63,7 +63,7 @@ index 6d0e259f0753d0f3962b8f9a35383ce0f5c7b2ea..a8ffcd3991afdb7f9cb1db27d6db5456 void SetEnableReferrers(bool enable_referrers) override; #if BUILDFLAG(IS_CT_SUPPORTED) diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index e9a96598f11fd0160e6990356b8ea0b0a1555d90..a68562314b93e2d3983dcc1f115ad8794331748f 100644 +index 1686353217d288c2faaef98f8cd445baf8ee0df5..bfb21675e01fb3e04e7a56e045d10d3e2196c81e 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom @@ -1299,6 +1299,9 @@ interface NetworkContext { diff --git a/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch b/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch index 733d5e5fc2..a47eab6faa 100644 --- a/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch +++ b/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch @@ -62,10 +62,10 @@ index 9caf18c2106c7ef081a7ff35517be07077e7df0e..1d1a85c27e8577ab1f613c15f76344f1 SEQUENCE_CHECKER(sequence_checker_); }; diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index b5bdcf72d8b337b53dc3adbc579b9701e649cd7d..063014273fb23544518873887283a664cb13e396 100644 +index c1523bbdbf16e1df1bf158b7b053dce09116f2fc..06831ec767f6ba81e76f52322fc2d81a45c2c275 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -677,6 +677,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { +@@ -682,6 +682,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { // ...unless --force-dark-mode was specified in which case caveat emptor. if (InForcedColorsMode() && !IsForcedDarkMode()) return false; diff --git a/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch b/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch index 5f72e0770d..d64ac2ed0c 100644 --- a/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch +++ b/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch @@ -199,10 +199,10 @@ index 58985ce62dc569256bad5e94de9c0d125fc470d0..33436784b691c860d58f8b4dfcc6718e &SelectFileDialogLinuxKde::OnSelectSingleFolderDialogResponse, this, parent)); diff --git a/ui/shell_dialogs/select_file_dialog_linux_portal.cc b/ui/shell_dialogs/select_file_dialog_linux_portal.cc -index d94540d0a7bf90f57acdaf8ca6665cf283a646bf..9a892a2d1ac1480d3af7968c9dcaa7c69806fd0e 100644 +index 1ce06cc0044eecc8662fadcd086f27872e7618b6..d77ea886d4b28f92fe7fe4ee20fa61f0f5386273 100644 --- a/ui/shell_dialogs/select_file_dialog_linux_portal.cc +++ b/ui/shell_dialogs/select_file_dialog_linux_portal.cc -@@ -216,6 +216,8 @@ void SelectFileDialogLinuxPortal::SelectFileImpl( +@@ -221,6 +221,8 @@ void SelectFileDialogLinuxPortal::SelectFileImpl( weak_factory_.GetWeakPtr())); info_->type = type; info_->main_task_runner = base::SequencedTaskRunner::GetCurrentDefault(); @@ -211,7 +211,7 @@ index d94540d0a7bf90f57acdaf8ca6665cf283a646bf..9a892a2d1ac1480d3af7968c9dcaa7c6 if (owning_window) { if (auto* root = owning_window->GetRootWindow()) { -@@ -552,7 +554,9 @@ void SelectFileDialogLinuxPortal::DialogInfo::AppendOptions( +@@ -557,7 +559,9 @@ void SelectFileDialogLinuxPortal::DialogInfo::AppendOptions( response_handle_token); if (type == SelectFileDialog::Type::SELECT_UPLOAD_FOLDER) { @@ -222,7 +222,7 @@ index d94540d0a7bf90f57acdaf8ca6665cf283a646bf..9a892a2d1ac1480d3af7968c9dcaa7c6 l10n_util::GetStringUTF8( IDS_SELECT_UPLOAD_FOLDER_DIALOG_UPLOAD_BUTTON)); } -@@ -561,12 +565,13 @@ void SelectFileDialogLinuxPortal::DialogInfo::AppendOptions( +@@ -566,12 +570,13 @@ void SelectFileDialogLinuxPortal::DialogInfo::AppendOptions( type == SelectFileDialog::Type::SELECT_UPLOAD_FOLDER || type == SelectFileDialog::Type::SELECT_EXISTING_FOLDER) { AppendBoolOption(&options_writer, kFileChooserOptionDirectory, true); diff --git a/patches/chromium/feat_configure_launch_options_for_service_process.patch b/patches/chromium/feat_configure_launch_options_for_service_process.patch index 59618fb3a2..96218a3fc6 100644 --- a/patches/chromium/feat_configure_launch_options_for_service_process.patch +++ b/patches/chromium/feat_configure_launch_options_for_service_process.patch @@ -184,7 +184,7 @@ index bdd5bec301f5fcff2d3e3d7994ecbc4eae46da36..45cf31157c535a0cdc9236a07e2ffffd host->GetChildProcess()->BindServiceInterface(std::move(receiver)); } diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc -index 82f42c80eaa698aaa5da1d52c8e6486be1fb9bb6..1a8dd3c6950c1654c054d036acfdc83bd8b61c0b 100644 +index 182146ad10e77db9983a816ba1fe4ba1f940bb91..6f5984fe4b555cd581fb8fd677213b1ddc0720fa 100644 --- a/content/browser/utility_process_host.cc +++ b/content/browser/utility_process_host.cc @@ -178,11 +178,13 @@ const ChildProcessData& UtilityProcessHost::GetData() { diff --git a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch index f3b1d3fa6c..61ecbc5991 100644 --- a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch +++ b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch @@ -203,10 +203,10 @@ index d149ef23deaf591e472fcd00a7ea32b2e4052b98..6e93321d2856d40a00fa04fe03a2bb72 const raw_ptr<GpuServiceImpl> gpu_service_impl_; diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc -index 5dccc2360cd1f3d83ffc59697aeb559a19b0547a..5fe62069b15e6370e63645b257d931be2a714bc3 100644 +index 7d58c00ddee8b8e14f89b9ba0f82f734294a4828..b9f7c11f28a7fd61cac594cac862d6524b83296d 100644 --- a/components/viz/service/display_embedder/software_output_device_mac.cc +++ b/components/viz/service/display_embedder/software_output_device_mac.cc -@@ -106,6 +106,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage( +@@ -111,6 +111,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage( SkCanvas* SoftwareOutputDeviceMac::BeginPaint( const gfx::Rect& new_damage_rect) { @@ -215,7 +215,7 @@ index 5dccc2360cd1f3d83ffc59697aeb559a19b0547a..5fe62069b15e6370e63645b257d931be // Record the previous paint buffer. Buffer* previous_paint_buffer = buffer_queue_.empty() ? nullptr : buffer_queue_.back().get(); -@@ -194,6 +196,7 @@ void SoftwareOutputDeviceMac::EndPaint() { +@@ -199,6 +201,7 @@ void SoftwareOutputDeviceMac::EndPaint() { ca_layer_params.is_empty = false; ca_layer_params.scale_factor = scale_factor_; ca_layer_params.pixel_size = pixel_size_; @@ -520,7 +520,7 @@ index 796ae2688436eb07f19909641d1620dd02f10cdb..c9e0eee0b329caf46669b419b1cd10cf waiting_on_draw_ack_ = true; diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc -index 4022dff593fb718b6e97c35fbf928af129495aaf..d51b9d9c7eb7e2cef09d9d7745d4b54a27b69168 100644 +index 3914375bdb741e347ea561935dfcd9162b05dbd6..ff21b6e7610e034ef65e23560dd011b2a29e74ae 100644 --- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc +++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc @@ -100,7 +100,8 @@ RootCompositorFrameSinkImpl::Create( @@ -562,7 +562,7 @@ index febb2718cb34ea4d9f411f068d8c01a89c7db888..be8bd51cb61c20ef3df8552972a0ac2f gpu::SyncPointManager* GetSyncPointManager() override; }; diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc -index b9ad5c8cbeb5b3684af6d84f70aa8aace69dc01a..55ea89b5c08daf3dd5cdf332be96ff43b8590233 100644 +index 2ea7347d2abe0a4ac9c1e57ea5249660ca2203fc..d71e6349fa887ddaf2d03438e72b4d696d9bf9c5 100644 --- a/content/browser/compositor/viz_process_transport_factory.cc +++ b/content/browser/compositor/viz_process_transport_factory.cc @@ -390,8 +390,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( @@ -595,7 +595,7 @@ index d7deccb6e6ec63592cd840a05403f402238e645e..4c4356b8def15ed3156db38d0a593b83 // Sends the created child window to the browser process so that it can be diff --git a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom -index b2862af94fb95ace58123a96f457c579588b83a0..20bdc378d204e9ef7a8c3e1229b5b1abac0f1628 100644 +index 7f71e53cce852ad30a6e14b6dbe12df30a3367b0..0e7b9c3ed19c16cf7d9566df0c07c95720b64999 100644 --- a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom +++ b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom @@ -34,6 +34,7 @@ struct RootCompositorFrameSinkParams { diff --git a/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch b/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch index 1599bde93a..6907cea679 100644 --- a/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch +++ b/patches/chromium/feat_enable_passing_exit_code_on_service_process_crash.patch @@ -76,7 +76,7 @@ index 45cf31157c535a0cdc9236a07e2ffffd166ba412..9c89cdb3a290a7b0e68539ccd5383f2a void ServiceProcessHost::RemoveObserver(Observer* observer) { GetServiceProcessTracker().RemoveObserver(observer); diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc -index 1a8dd3c6950c1654c054d036acfdc83bd8b61c0b..e5297de039019285217192ade914b6f761f94480 100644 +index 6f5984fe4b555cd581fb8fd677213b1ddc0720fa..61d57482e244e32bc86c74574f0e77a0b39d72f2 100644 --- a/content/browser/utility_process_host.cc +++ b/content/browser/utility_process_host.cc @@ -509,7 +509,7 @@ void UtilityProcessHost::OnProcessCrashed(int exit_code) { diff --git a/patches/chromium/fix_activate_background_material_on_windows.patch b/patches/chromium/fix_activate_background_material_on_windows.patch index 380665ce4e..cebabd608e 100644 --- a/patches/chromium/fix_activate_background_material_on_windows.patch +++ b/patches/chromium/fix_activate_background_material_on_windows.patch @@ -14,10 +14,10 @@ This patch likely can't be upstreamed as-is, as Chromium doesn't have this use case in mind currently. diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 8bb4db2d74146718dfb3192ef272dbc2f0fe5921..e0f61ff2a3f1412346ce3dbe1d9de88a86a3de38 100644 +index 16b2e484757c686f6cfb5b2b014b406c3e0d21ae..ff9770991c6d1ceec19ce2e2f199475f5eaddada 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -907,13 +907,13 @@ void HWNDMessageHandler::FrameTypeChanged() { +@@ -906,13 +906,13 @@ void HWNDMessageHandler::FrameTypeChanged() { void HWNDMessageHandler::PaintAsActiveChanged() { if (!delegate_->HasNonClientView() || !delegate_->CanActivate() || @@ -33,7 +33,7 @@ index 8bb4db2d74146718dfb3192ef272dbc2f0fe5921..e0f61ff2a3f1412346ce3dbe1d9de88a } void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon, -@@ -2261,17 +2261,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message, +@@ -2251,17 +2251,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message, if (IsVisible()) delegate_->SchedulePaint(); diff --git a/patches/chromium/fix_aspect_ratio_with_max_size.patch b/patches/chromium/fix_aspect_ratio_with_max_size.patch index b6dda3d9a1..ab2a89e6d0 100644 --- a/patches/chromium/fix_aspect_ratio_with_max_size.patch +++ b/patches/chromium/fix_aspect_ratio_with_max_size.patch @@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the BrowserWindow. diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 527de61ee739e78aec61d82138d1b56fc668e0bd..9f6c259cd5a664cf8384e412ba78af11361562fd 100644 +index 73f62b38d4595e9dd3befba196756b311266013d..0b199e2df281aed6224787aaf467ed95ddf61f8f 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -3682,14 +3682,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param, +@@ -3672,14 +3672,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param, delegate_->GetMinMaxSize(&min_window_size, &max_window_size); min_window_size = delegate_->DIPToScreenSize(min_window_size); max_window_size = delegate_->DIPToScreenSize(max_window_size); diff --git a/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch b/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch index b4dd471956..ea1c6c7206 100644 --- a/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch +++ b/patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch @@ -23,10 +23,10 @@ Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397. Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266. diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc -index ae85fffc2b1a6870ad2cae6938fd481a76195d7a..a24055ac5c89fdb2987f003e3ec902d8d2bc8f31 100644 +index fae6cb2e6eeac865825bfcbc79f0fb96aa66d266..1ebc636d40543183d06f8623ae0698c4331a6609 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -10653,6 +10653,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() { +@@ -10704,6 +10704,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() { } } diff --git a/patches/chromium/fix_crash_when_saving_edited_pdf_files.patch b/patches/chromium/fix_crash_when_saving_edited_pdf_files.patch index 460b317346..5d80c1329b 100644 --- a/patches/chromium/fix_crash_when_saving_edited_pdf_files.patch +++ b/patches/chromium/fix_crash_when_saving_edited_pdf_files.patch @@ -13,10 +13,10 @@ This patch can be removed should we choose to support chrome.fileSystem or support it enough to fix the crash. diff --git a/chrome/browser/resources/pdf/pdf_viewer.ts b/chrome/browser/resources/pdf/pdf_viewer.ts -index 8f516ab1d3772b27f4568b36d3f87dddcdd57ed7..cf82067ba9ff479dd3c9fb213fae9f9993e9cf35 100644 +index 1830f8b4066fab1586cd1a560c73178a0ddaee2d..58ebde85c37cd5650dd55f993631afc249be300c 100644 --- a/chrome/browser/resources/pdf/pdf_viewer.ts +++ b/chrome/browser/resources/pdf/pdf_viewer.ts -@@ -1012,7 +1012,15 @@ export class PdfViewerElement extends PdfViewerBaseElement { +@@ -1015,7 +1015,15 @@ export class PdfViewerElement extends PdfViewerBaseElement { dataArray = [result.dataToSave]; } @@ -32,7 +32,7 @@ index 8f516ab1d3772b27f4568b36d3f87dddcdd57ed7..cf82067ba9ff479dd3c9fb213fae9f99 const fileName = this.attachments_[index].name; chrome.fileSystem.chooseEntry( {type: 'saveFile', suggestedName: fileName}, -@@ -1034,6 +1042,7 @@ export class PdfViewerElement extends PdfViewerBaseElement { +@@ -1037,6 +1045,7 @@ export class PdfViewerElement extends PdfViewerBaseElement { // </if> }); }); @@ -40,7 +40,7 @@ index 8f516ab1d3772b27f4568b36d3f87dddcdd57ed7..cf82067ba9ff479dd3c9fb213fae9f99 } /** -@@ -1157,7 +1166,15 @@ export class PdfViewerElement extends PdfViewerBaseElement { +@@ -1160,7 +1169,15 @@ export class PdfViewerElement extends PdfViewerBaseElement { } // Create blob before callback to avoid race condition. @@ -56,7 +56,7 @@ index 8f516ab1d3772b27f4568b36d3f87dddcdd57ed7..cf82067ba9ff479dd3c9fb213fae9f99 chrome.fileSystem.chooseEntry( { type: 'saveFile', -@@ -1182,6 +1199,7 @@ export class PdfViewerElement extends PdfViewerBaseElement { +@@ -1185,6 +1202,7 @@ export class PdfViewerElement extends PdfViewerBaseElement { // </if> }); }); diff --git a/patches/chromium/fix_disabling_background_throttling_in_compositor.patch b/patches/chromium/fix_disabling_background_throttling_in_compositor.patch index fda5bc58d7..1da12c6810 100644 --- a/patches/chromium/fix_disabling_background_throttling_in_compositor.patch +++ b/patches/chromium/fix_disabling_background_throttling_in_compositor.patch @@ -12,7 +12,7 @@ invisible state of the `viz::DisplayScheduler` owned by the `ui::Compositor`. diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc -index 56f22ef70665d66692ca9d50e6b822a6ce3740de..dfd02e5e83684aa2f6c7188598095ed09a80bd80 100644 +index f580d434560f90a107bab988f224c48bf591531e..2ee85fb2951c743fd50ae46b56af941b9eae279d 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc @@ -342,7 +342,8 @@ void Compositor::SetLayerTreeFrameSink( diff --git a/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch b/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch index 42eba4d1c9..5367427125 100644 --- a/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch +++ b/patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch @@ -87,10 +87,10 @@ index 0c7d5b2c1d3e97420913bd643bb2a524a76fc286..653793fa480f035ce11e079b370bf5ed // The view with active text input state, i.e., a focused <input> element. // It will be nullptr if no such view exists. Note that the active view diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 8696a4043d27daab5f62ba9fbc3fba461cc52a00..915cc43be14bbcb3d255c05270fdb44a1cd5c512 100644 +index 639f34cac9f58c3e757ed9b10050e2c185fe6a0c..508c94a98423b310dcf606d726d976758e55c3bd 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -9158,7 +9158,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( +@@ -9176,7 +9176,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( "WebContentsImpl::OnFocusedElementChangedInFrame", "render_frame_host", frame); RenderWidgetHostViewBase* root_view = diff --git a/patches/chromium/fix_properly_honor_printing_page_ranges.patch b/patches/chromium/fix_properly_honor_printing_page_ranges.patch index 3c9fe5381c..c459b0ede5 100644 --- a/patches/chromium/fix_properly_honor_printing_page_ranges.patch +++ b/patches/chromium/fix_properly_honor_printing_page_ranges.patch @@ -100,10 +100,10 @@ index c6a080107949c435565d6e57646f36fd5e3b912d..e37331436cf5d4bca41bb39a288d395e } else { // No need to bother, we don't know how many pages are available. diff --git a/ui/gtk/printing/print_dialog_gtk.cc b/ui/gtk/printing/print_dialog_gtk.cc -index ccde64439b6f287eb7ac33f437535320e84fb04e..0491de8e3762bdff7676f134eba1d5d5e2893531 100644 +index 1a2c8f974e3d38478b6fdea41ec3c7e668e141db..0e560956b03855647f8e90bee585200764db4b46 100644 --- a/ui/gtk/printing/print_dialog_gtk.cc +++ b/ui/gtk/printing/print_dialog_gtk.cc -@@ -242,6 +242,24 @@ void PrintDialogGtk::UpdateSettings( +@@ -247,6 +247,24 @@ void PrintDialogGtk::UpdateSettings( gtk_print_settings_set_n_copies(gtk_settings_, settings->copies()); gtk_print_settings_set_collate(gtk_settings_, settings->collate()); diff --git a/patches/chromium/fix_remove_caption-removing_style_call.patch b/patches/chromium/fix_remove_caption-removing_style_call.patch index 110c3a3496..52c1563557 100644 --- a/patches/chromium/fix_remove_caption-removing_style_call.patch +++ b/patches/chromium/fix_remove_caption-removing_style_call.patch @@ -18,10 +18,10 @@ or resizing, but Electron does not seem to run into that issue for opaque frameless windows even with that block commented out. diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 00c496989ec89e6c849b200bac59932159f6a6dc..8bb4db2d74146718dfb3192ef272dbc2f0fe5921 100644 +index a7f5a0cebcd8834fd39badbac7740baad1fc0456..16b2e484757c686f6cfb5b2b014b406c3e0d21ae 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -1740,7 +1740,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { +@@ -1730,7 +1730,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0); diff --git a/patches/chromium/fix_restore_original_resize_performance_on_macos.patch b/patches/chromium/fix_restore_original_resize_performance_on_macos.patch index 4fc58c62ef..4d0b59a53b 100644 --- a/patches/chromium/fix_restore_original_resize_performance_on_macos.patch +++ b/patches/chromium/fix_restore_original_resize_performance_on_macos.patch @@ -11,7 +11,7 @@ This patch should be upstreamed as a conditional revert of the logic in desktop vs mobile runtimes. i.e. restore the old logic only on desktop platforms diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index 2a1a4470abfc8ad8895a3506d8791c4db042e7bc..3dcd794216e56c86b762573ed621e9e86157b227 100644 +index ad8d5236fe2b9f55462445b2fc332a27e588a8e0..f392a2d3d4066deef9ea22a2affe098d95f64111 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -2021,9 +2021,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() { diff --git a/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch b/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch index 9b25969786..0504f13940 100644 --- a/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch +++ b/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch @@ -97,10 +97,10 @@ index 0fad9323d35be707afe398c98f721b9c53665653..019bf127dc351eb2d01f4d1885669561 mojom::blink::WantResultOption, mojom::blink::PromiseResultOption); diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc -index 3c2e7b3b2f30d62d9d65b28ebea15a34bb3e8d82..26d635918d732a8f085952fa13f8095d1fdabeba 100644 +index 452ac81650a3aef222c494821211d970cc044971..e26dc921d7d29a5582fe080918632320a4116dfd 100644 --- a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc +++ b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc -@@ -959,6 +959,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld( +@@ -968,6 +968,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld( std::move(callback).Run(value ? std::move(*value) : base::Value()); }, std::move(callback)), @@ -216,7 +216,7 @@ index db1cc198dfc40ce359bad4157a4aad396e1be1a0..424fa3415a9f7d44a8422ecf0eb3670b mojom::blink::WantResultOption::kWantResult, wait_for_promise); } diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc -index 0799f6b0f1789885b98698085a1bf592d7b090f7..36e344e290f24297c3e9905b4b9e32dab617d515 100644 +index e9b2bddc2bf046baa94273d9785087c9235bd7d1..56d5140360395c1bccb03136334fd95b3a5d6686 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc @@ -1095,14 +1095,15 @@ void WebLocalFrameImpl::RequestExecuteScript( diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index 6bcc84bf74..5a15ad5963 100644 --- a/patches/chromium/frame_host_manager.patch +++ b/patches/chromium/frame_host_manager.patch @@ -6,10 +6,10 @@ Subject: frame_host_manager.patch Allows embedder to intercept site instances created by chromium. diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc -index 6fe74ec01b3547e69035592c2820bf2b70374070..aa958aec47a477bbe1dbf840c6a44e63973000c2 100644 +index d8e55dd35c7bcfc341585b901ed8dc261d03870a..eaa3b5fe6320a746298c45c799ef4b29877d3542 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc -@@ -4470,6 +4470,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -4471,6 +4471,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request->ResetStateForSiteInstanceChange(); } @@ -20,7 +20,7 @@ index 6fe74ec01b3547e69035592c2820bf2b70374070..aa958aec47a477bbe1dbf840c6a44e63 } diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index 86154854493f5ad8b05b8f1649a126945d454f3d..52330606a560851972bfcd38fca29a0a30f51802 100644 +index 793c55425396998f7dfeba3c7dc0e59e90ef3874..31402aa6a863fb32f9ea0b50582570f080fedfaa 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -329,6 +329,11 @@ class CONTENT_EXPORT ContentBrowserClient { diff --git a/patches/chromium/gin_enable_disable_v8_platform.patch b/patches/chromium/gin_enable_disable_v8_platform.patch index 3d4db13c4d..8fc1cb9ea5 100644 --- a/patches/chromium/gin_enable_disable_v8_platform.patch +++ b/patches/chromium/gin_enable_disable_v8_platform.patch @@ -38,7 +38,7 @@ index c19eb72e8d37fe8145b813d07875addf793e12dc..a5db8841773618814ac90f740201d4d7 // Returns whether `Initialize` has already been invoked in the process. // Initialization is a one-way operation (i.e., this method cannot return diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc -index 9dd24650d22d63b3b5eeea4d654e20c20f62091c..ee092cf1223844f999de54937737fb3451e0f8fc 100644 +index 3330857c13004f8c3af01037d78570165b3b05f7..74f67a1c85c8430e1924eae3fb82dc708db4a0f8 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc @@ -483,7 +483,8 @@ void SetFlags(IsolateHolder::ScriptMode mode, diff --git a/patches/chromium/gritsettings_resource_ids.patch b/patches/chromium/gritsettings_resource_ids.patch index ffee570e96..9f36554c7a 100644 --- a/patches/chromium/gritsettings_resource_ids.patch +++ b/patches/chromium/gritsettings_resource_ids.patch @@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch Add electron resources file to the list of resource ids generation. diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec -index ed1887839c274b1cde8f2de7a92b6de0ea33cd85..eb378b4a4a1d6b0c9aa93e6e4225576949c76a2a 100644 +index cbf46ff2827c31192ab8da1df2d2ce396351102b..efa2b96edaa1a268017ba2946472140c2a6f9b27 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec -@@ -1342,6 +1342,11 @@ +@@ -1343,6 +1343,11 @@ "includes": [8460], }, diff --git a/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch b/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch index c0061d9d8d..9a94034cf4 100644 --- a/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch +++ b/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch @@ -11,7 +11,7 @@ If removing this patch causes no sync failures, it's safe to delete :+1: Ref https://chromium-review.googlesource.com/c/chromium/src/+/2953903 diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py -index b3e69e85690a09cf94bf04811ac8cfc303283e27..48be7eca74560da5a04772ff02278af9baba61e8 100755 +index f5cc6f2fe3ac6a5a8bd3c96bd0919ea3add74102..c895fd563870923d1d253e0248f60b4664667a8e 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py @@ -305,6 +305,8 @@ def GetDefaultHostOs(): diff --git a/patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch b/patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch index 347892ecf7..2ad6df99cd 100644 --- a/patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch +++ b/patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch @@ -9,7 +9,7 @@ be created for each child process, despite logs being redirected to a file. diff --git a/content/app/content_main.cc b/content/app/content_main.cc -index 4251459b695e6375618de489415c3105afb1449d..6cb3cb7fd49f57f19f9780cac32218b8331c3d38 100644 +index ecc03076fa344ddc805f034602648a25d429ee4e..68969db128377fce81d19f497e4ef2fe33d5bf00 100644 --- a/content/app/content_main.cc +++ b/content/app/content_main.cc @@ -306,16 +306,14 @@ RunContentProcess(ContentMainParams params, diff --git a/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch b/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch index 50a38783ee..a0824563f0 100644 --- a/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch +++ b/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch @@ -35,10 +35,10 @@ system font by checking if it's kCTFontPriorityAttribute is set to system priority. diff --git a/base/BUILD.gn b/base/BUILD.gn -index 2bfdc528e67aa6c869ef48c6b8e5f239c3d9559b..54c34b480c7a10d1fbf0137dcea05226911406cd 100644 +index dbaf22d68f67cb227a5fc2c774fd582af7715dcc..406bc05f8f4b368f18c6e8264fa5ad6e70d6fe1e 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -1048,6 +1048,7 @@ component("base") { +@@ -1050,6 +1050,7 @@ component("base") { "//build/config/compiler:prevent_unsafe_narrowing", "//build/config/compiler:wexit_time_destructors", "//build/config/compiler:wglobal_constructors", @@ -73,7 +73,7 @@ index 4bf9a3c27e05c6635b2beb8e880b5b43dbed61b5..57d4756c0d87b9313e8566b3083c0132 } // namespace base diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc -index d1b09cb1a75000cf41f31bddcdcb739f776920aa..825a6ecd65bc4e3412db83413d6de34ea997ddd0 100644 +index 2512b3f43b6ac84dd2a440ac3e68d282c7e429d9..2cb281abf2cc3bd800a2349e41a59454db6da953 100644 --- a/base/process/launch_mac.cc +++ b/base/process/launch_mac.cc @@ -21,13 +21,18 @@ @@ -171,7 +171,7 @@ index 4fe7a0bfaa5b3398372f55c6454e738f140efe6b..b1c70281c45aaca4ae483f1f28e9d219 if (is_win) { diff --git a/components/remote_cocoa/app_shim/BUILD.gn b/components/remote_cocoa/app_shim/BUILD.gn -index 459f14da45419a2a0340199d9cf311e3bba437e6..3b7908c559ddd3d6101801f8de256aa80a9411a2 100644 +index bc054fb378181210794a1b3453f7c14443da0dab..b9690bbdd2d126c09396c02a8cae5d91bab6bcd4 100644 --- a/components/remote_cocoa/app_shim/BUILD.gn +++ b/components/remote_cocoa/app_shim/BUILD.gn @@ -16,6 +16,7 @@ component("app_shim") { @@ -303,10 +303,10 @@ index 945b01f2132547fa0f6a97ee4895994c500d1410..c01b2fdecf9b54fa01e5be9f45eaa234 // The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that // can only be accomplished by overriding methods. diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -index 8206b065e36ea5264ab01f0abb0c60c7f059cee5..219e2e73a986ed90585adc2baf1a91334c093c1a 100644 +index 4f37e077120a311638c64e715059e5c08b1f1045..30027aafc16d48ac076dca3223f3a38dc6c8e85e 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -@@ -106,14 +106,18 @@ void OrderChildWindow(NSWindow* child_window, +@@ -111,14 +111,18 @@ void OrderChildWindow(NSWindow* child_window, } // namespace @@ -325,7 +325,7 @@ index 8206b065e36ea5264ab01f0abb0c60c7f059cee5..219e2e73a986ed90585adc2baf1a9133 - (BOOL)hasKeyAppearance; - (long long)_resizeDirectionForMouseLocation:(CGPoint)location; - (BOOL)_isConsideredOpenForPersistentState; -@@ -152,6 +156,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event { +@@ -157,6 +161,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event { } @end @@ -334,7 +334,7 @@ index 8206b065e36ea5264ab01f0abb0c60c7f059cee5..219e2e73a986ed90585adc2baf1a9133 @implementation NativeWidgetMacNSWindowTitledFrame - (void)mouseDown:(NSEvent*)event { if (self.window.isMovable) -@@ -214,6 +220,8 @@ - (BOOL)usesCustomDrawing { +@@ -219,6 +225,8 @@ - (BOOL)usesCustomDrawing { } @end @@ -343,7 +343,7 @@ index 8206b065e36ea5264ab01f0abb0c60c7f059cee5..219e2e73a986ed90585adc2baf1a9133 @implementation NativeWidgetMacNSWindow { @private CommandDispatcher* __strong _commandDispatcher; -@@ -402,6 +410,8 @@ - (NSAccessibilityRole)accessibilityRole { +@@ -409,6 +417,8 @@ - (NSAccessibilityRole)accessibilityRole { // NSWindow overrides. @@ -352,7 +352,7 @@ index 8206b065e36ea5264ab01f0abb0c60c7f059cee5..219e2e73a986ed90585adc2baf1a9133 + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { if (windowStyle & NSWindowStyleMaskTitled) { if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class]) -@@ -413,6 +423,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { +@@ -420,6 +430,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { return [super frameViewClassForStyleMask:windowStyle]; } @@ -468,7 +468,7 @@ index 00493dc6c3f0229438b440a6fb2438ca668aba6b..6ce251058868529551cd6f008f840e06 return kAttributes; } diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 3c60d828a0a4822f2807c89083f20dbf32aeea86..537c1cddc964748f8b978d1b4fa6f5a6c45ebf08 100644 +index e784717f1e6aac06a28f39e70115aa9e63a43859..68b325f7d504571b81a13877654d1b1852057417 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -70,6 +70,7 @@ source_set("browser") { @@ -480,7 +480,7 @@ index 3c60d828a0a4822f2807c89083f20dbf32aeea86..537c1cddc964748f8b978d1b4fa6f5a6 libs = [] frameworks = [] diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm -index 9485916338d16e11acbb56ea0b9b34e749db0281..45df87ec3bd98474513cef590b8312f8bd976947 100644 +index 66aeabc0852b61777dee72dc819cab7fd59b6563..fc09cd942b60a5eea7e35842f031e3259509095d 100644 --- a/content/browser/accessibility/browser_accessibility_manager_mac.mm +++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm @@ -20,7 +20,9 @@ @@ -493,7 +493,7 @@ index 9485916338d16e11acbb56ea0b9b34e749db0281..45df87ec3bd98474513cef590b8312f8 namespace { -@@ -224,6 +226,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -229,6 +231,7 @@ void PostAnnouncementNotification(NSString* announcement, return; } @@ -501,7 +501,7 @@ index 9485916338d16e11acbb56ea0b9b34e749db0281..45df87ec3bd98474513cef590b8312f8 BrowserAccessibilityManager* root_manager = GetManagerForRootFrame(); if (root_manager) { BrowserAccessibilityManagerMac* root_manager_mac = -@@ -246,6 +249,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -251,6 +254,7 @@ void PostAnnouncementNotification(NSString* announcement, return; } } @@ -509,7 +509,7 @@ index 9485916338d16e11acbb56ea0b9b34e749db0281..45df87ec3bd98474513cef590b8312f8 // Use native VoiceOver support for live regions. BrowserAccessibilityCocoa* retained_node = native_node; -@@ -646,6 +650,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -642,6 +646,7 @@ void PostAnnouncementNotification(NSString* announcement, return window == [NSApp accessibilityFocusedWindow]; } @@ -517,7 +517,7 @@ index 9485916338d16e11acbb56ea0b9b34e749db0281..45df87ec3bd98474513cef590b8312f8 // TODO(accessibility): We need a solution to the problem described below. // If the window is NSAccessibilityRemoteUIElement, there are some challenges: // 1. NSApp is the browser which spawned the PWA, and what it considers the -@@ -674,6 +679,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -670,6 +675,7 @@ void PostAnnouncementNotification(NSString* announcement, if ([window isKindOfClass:[NSAccessibilityRemoteUIElement class]]) { return true; } @@ -526,7 +526,7 @@ index 9485916338d16e11acbb56ea0b9b34e749db0281..45df87ec3bd98474513cef590b8312f8 return false; } diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h -index a9c8c574b83c78988016e38931ab7273e426c6fd..1f23d45ca2d9fd09b2f88f61f9daeecee9f9b445 100644 +index a4f19d10fdcb6cf09272bb7ef4e0290fa2d8239b..19dfbbfea9ace18e53b1de64066ffb161fa845cc 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h @@ -53,7 +53,9 @@ class CursorManager; @@ -539,7 +539,7 @@ index a9c8c574b83c78988016e38931ab7273e426c6fd..1f23d45ca2d9fd09b2f88f61f9daeece @class RenderWidgetHostViewCocoa; @class CursorAccessibilityScaleFactorObserver; -@@ -686,9 +688,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac +@@ -685,9 +687,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac // EnsureSurfaceSynchronizedForWebTest(). uint32_t latest_capture_sequence_number_ = 0u; @@ -552,7 +552,7 @@ index a9c8c574b83c78988016e38931ab7273e426c6fd..1f23d45ca2d9fd09b2f88f61f9daeece // Used to force the NSApplication's focused accessibility element to be the // content::BrowserAccessibilityCocoa accessibility tree when the NSView for diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index 4aa1a1479d7b8b9129c4e88bb0c416792515d3f6..362b8c764317815dd69f7339b6d1eb614bc4fa16 100644 +index 9f7b35dc9d0fd6190f689c3e7aa9e730a27e8e8c..fd3eeb9f52367e0c0fca33b82036290d02d4ca0d 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -272,8 +272,10 @@ @@ -566,7 +566,7 @@ index 4aa1a1479d7b8b9129c4e88bb0c416792515d3f6..362b8c764317815dd69f7339b6d1eb61 // Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling // pointers. `ns_view_` gets reinitialized later in this method. -@@ -1657,8 +1659,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1636,8 +1638,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, gfx::NativeViewAccessible RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() { @@ -577,7 +577,7 @@ index 4aa1a1479d7b8b9129c4e88bb0c416792515d3f6..362b8c764317815dd69f7339b6d1eb61 return [GetInProcessNSView() window]; } -@@ -1707,9 +1711,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1686,9 +1690,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, } void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) { @@ -589,7 +589,7 @@ index 4aa1a1479d7b8b9129c4e88bb0c416792515d3f6..362b8c764317815dd69f7339b6d1eb61 } bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame( -@@ -2233,20 +2239,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -2212,20 +2218,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, void RenderWidgetHostViewMac::GetRenderWidgetAccessibilityToken( GetRenderWidgetAccessibilityTokenCallback callback) { base::ProcessId pid = getpid(); @@ -629,10 +629,10 @@ index 0738636a7462fd973c12d0e26e298c3b767f0c53..977e90c5dc3d8ff48ba9674c1c7d5eb6 public_deps = [ ":mojo_bindings", diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn -index dd68249de75a27f91bb421cb37d9ca4153f41506..a518d0b2aae815047acd34558d6ee014072d601f 100644 +index aa858c2dd7594798e7b8d1a947fb85b0eb506710..8e9c678f9af71175c842343e3fd19b2c2cce1416 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn -@@ -230,6 +230,7 @@ target(link_target_type, "renderer") { +@@ -232,6 +232,7 @@ target(link_target_type, "renderer") { } configs += [ "//content:content_implementation" ] @@ -709,7 +709,7 @@ index a119b4439bfb9218c7aaf09dca8e78527da7f20d..faa813b003940280c6eeb87e70173019 } // namespace content diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn -index 52ffda780d5df5f8788bea200943672708437c3e..75868558b22eed8a86d557dbafdc6184f254c180 100644 +index cfcc4bc7fbcc6209c86f07ae1b6e920c5258173c..18395806b05c7deef7a0415031c376f7c2239bfd 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn @@ -502,6 +502,7 @@ static_library("test_support") { @@ -728,7 +728,7 @@ index 52ffda780d5df5f8788bea200943672708437c3e..75868558b22eed8a86d557dbafdc6184 } mojom("content_test_mojo_bindings") { -@@ -1718,6 +1720,7 @@ test("content_browsertests") { +@@ -1717,6 +1719,7 @@ test("content_browsertests") { defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] configs += [ "//build/config:precompiled_headers" ] @@ -736,7 +736,7 @@ index 52ffda780d5df5f8788bea200943672708437c3e..75868558b22eed8a86d557dbafdc6184 public_deps = [ ":test_interfaces", -@@ -2973,6 +2976,7 @@ test("content_unittests") { +@@ -2975,6 +2978,7 @@ test("content_unittests") { } configs += [ "//build/config:precompiled_headers" ] @@ -840,10 +840,10 @@ index 36322ddd3047f96569f35807541a37d3c6672b09..3162cb6e3dce2c44e5b1e5f33f9177da namespace ui { diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn -index 90e093cd2d499ba0f37f3246bab288c758b51e19..6027134a4de53e6fe39fdbfdb67885e0b5f56e40 100644 +index 6f3b368103b05f07ae67da4c0307efe039b8dfce..a1b11c298ee8b2c9b3cbe6307bc7744c242976b6 100644 --- a/media/audio/BUILD.gn +++ b/media/audio/BUILD.gn -@@ -199,6 +199,7 @@ source_set("audio") { +@@ -197,6 +197,7 @@ source_set("audio") { "CoreMedia.framework", ] weak_frameworks = [ "ScreenCaptureKit.framework" ] # macOS 13.0 @@ -852,10 +852,10 @@ index 90e093cd2d499ba0f37f3246bab288c758b51e19..6027134a4de53e6fe39fdbfdb67885e0 if (is_ios) { diff --git a/media/audio/apple/audio_low_latency_input.cc b/media/audio/apple/audio_low_latency_input.cc -index 808f4e1c7beb03cc5377465882940eea94ad61a7..d001436c3a5a8a0fc25995519772478f04ddb35f 100644 +index 9b78f60304a0e487904fdb22c9e6d85a237ca96e..fc5508c41aa08dd7bf1365a7c03b68723aae3a4b 100644 --- a/media/audio/apple/audio_low_latency_input.cc +++ b/media/audio/apple/audio_low_latency_input.cc -@@ -34,19 +34,23 @@ +@@ -39,19 +39,23 @@ namespace { extern "C" { @@ -879,19 +879,6 @@ index 808f4e1c7beb03cc5377465882940eea94ad61a7..d001436c3a5a8a0fc25995519772478f } } // namespace #endif -diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc -index a5070091785d80a47d1d9d9977803cd1de8b2054..b280a0d58fc03257aa1763cd15791db4ddede7c1 100644 ---- a/media/audio/mac/audio_manager_mac.cc -+++ b/media/audio/mac/audio_manager_mac.cc -@@ -971,7 +971,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters( - - void AudioManagerMac::InitializeOnAudioThread() { - DCHECK(GetTaskRunner()->BelongsToCurrentThread()); -- InitializeCoreAudioDispatchOverride(); -+ // InitializeCoreAudioDispatchOverride(); - power_observer_ = std::make_unique<AudioPowerObserver>(); - } - diff --git a/net/dns/BUILD.gn b/net/dns/BUILD.gn index 5f4ff9ff8172d4ad282cc9c781f85118b8ba7d1a..6a542c8f0d7afad876ab2739a1a2576a64cb6be9 100644 --- a/net/dns/BUILD.gn @@ -1394,22 +1381,22 @@ index dcf493d62990018040a3f84b6f875af737bd2214..6ffffe8b3946e0427aead8be19878c53 void DisplayCALayerTree::GotIOSurfaceFrame( diff --git a/ui/accessibility/platform/BUILD.gn b/ui/accessibility/platform/BUILD.gn -index b7f86265ef2c79ce7a0c3eda2443a01a0242af89..96b8b4976ada0fcb2fd322e2ea42429a3c0757db 100644 +index 9803795cb3567ee4ae94927f4d46a5d53cd63ed1..41fc650b36349eaebd571a814ed27776c1ee1c0c 100644 --- a/ui/accessibility/platform/BUILD.gn +++ b/ui/accessibility/platform/BUILD.gn -@@ -255,6 +255,7 @@ component("platform") { - weak_frameworks = [ - "Accessibility.framework", # macOS 11 +@@ -254,6 +254,7 @@ component("platform") { + "AppKit.framework", + "Foundation.framework", ] + configs += ["//electron/build/config:mas_build"] } if (is_ios) { diff --git a/ui/accessibility/platform/inspect/ax_transform_mac.mm b/ui/accessibility/platform/inspect/ax_transform_mac.mm -index 84e156b7ff28abc2071dde155e56a2a92a53b142..bd73dac7fe3ed256cab805a0815d31d4f5e7dffc 100644 +index c8171f0527fe5194f0ea73b57c4444d4c630fbc4..7fa66598f2a541600602af47b3e1ed7b5d4463ee 100644 --- a/ui/accessibility/platform/inspect/ax_transform_mac.mm +++ b/ui/accessibility/platform/inspect/ax_transform_mac.mm -@@ -108,6 +108,7 @@ +@@ -111,6 +111,7 @@ } } @@ -1417,7 +1404,7 @@ index 84e156b7ff28abc2071dde155e56a2a92a53b142..bd73dac7fe3ed256cab805a0815d31d4 // AXTextMarker if (IsAXTextMarker(value)) { return AXTextMarkerToBaseValue(value, indexer); -@@ -117,6 +118,7 @@ +@@ -120,6 +121,7 @@ if (IsAXTextMarkerRange(value)) { return AXTextMarkerRangeToBaseValue(value, indexer); } @@ -1541,10 +1528,10 @@ index 9fb3bee897513d262ac44dccfe6662cc145a8df7..5b7592d7f739b5e580429a69575e6df5 if (is_win) { diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm -index cd08cb3b7c95a8fd418524652bb345945291112a..13c6cc142262781450d1075fe85f86ada3f9f60f 100644 +index 592e9611f6315f6f96918ee0a6489c38d6fa49e8..e885e86126429e7ae42991b6bd7a78bd4c9f96a7 100644 --- a/ui/display/mac/screen_mac.mm +++ b/ui/display/mac/screen_mac.mm -@@ -171,7 +171,17 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) { +@@ -176,7 +176,17 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) { display.set_color_depth(Display::kDefaultBitsPerPixel); display.set_depth_per_component(Display::kDefaultBitsPerComponent); } diff --git a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch index 308ad0f551..020b632afd 100644 --- a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch +++ b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch @@ -7,10 +7,10 @@ This adds a callback from the network service that's used to implement session.setCertificateVerifyCallback. diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index da5c502c627bc017175ab06fb4266bce167588a6..fccf51257d286956bce543d761a13a3a05c87288 100644 +index 02ff46371083e4a5821e8877fbd31796fdb6a0a9..0d6d4d646bd6e7c187b5174edff2ddb0c51d7867 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -156,6 +156,11 @@ +@@ -157,6 +157,11 @@ #include "services/network/web_transport.h" #include "url/gurl.h" @@ -22,7 +22,7 @@ index da5c502c627bc017175ab06fb4266bce167588a6..fccf51257d286956bce543d761a13a3a #if BUILDFLAG(IS_CT_SUPPORTED) // gn check does not account for BUILDFLAG(). So, for iOS builds, it will // complain about a missing dependency on the target exposing this header. Add a -@@ -580,6 +585,99 @@ mojom::URLLoaderFactoryParamsPtr CreateURLLoaderFactoryParamsForPrefetch() { +@@ -581,6 +586,99 @@ mojom::URLLoaderFactoryParamsPtr CreateURLLoaderFactoryParamsForPrefetch() { } // namespace @@ -122,7 +122,7 @@ index da5c502c627bc017175ab06fb4266bce167588a6..fccf51257d286956bce543d761a13a3a constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess; NetworkContext::NetworkContextHttpAuthPreferences:: -@@ -961,6 +1059,13 @@ void NetworkContext::SetClient( +@@ -962,6 +1060,13 @@ void NetworkContext::SetClient( client_.Bind(std::move(client)); } @@ -136,7 +136,7 @@ index da5c502c627bc017175ab06fb4266bce167588a6..fccf51257d286956bce543d761a13a3a void NetworkContext::CreateURLLoaderFactory( mojo::PendingReceiver<mojom::URLLoaderFactory> receiver, mojom::URLLoaderFactoryParamsPtr params) { -@@ -2466,6 +2571,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2474,6 +2579,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( std::move(cert_verifier)); cert_verifier = std::move(cert_verifier_with_trust_anchors); #endif // BUILDFLAG(IS_CHROMEOS) @@ -147,7 +147,7 @@ index da5c502c627bc017175ab06fb4266bce167588a6..fccf51257d286956bce543d761a13a3a builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier( diff --git a/services/network/network_context.h b/services/network/network_context.h -index 016323982be348613b1625c62314a9e2f37231fb..6d0e259f0753d0f3962b8f9a35383ce0f5c7b2ea 100644 +index 4f1cd30aa54de9a64372c7dced2bdaa683cc0d8e..b0df50eca7d4bed289940ebdf968a36fd891297b 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h @@ -115,6 +115,7 @@ class URLMatcher; @@ -177,7 +177,7 @@ index 016323982be348613b1625c62314a9e2f37231fb..6d0e259f0753d0f3962b8f9a35383ce0 std::unique_ptr<HostResolver> internal_host_resolver_; std::set<std::unique_ptr<HostResolver>, base::UniquePtrComparator> diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 4c2831a91d499b2ee5abcd1f11c8f6b3009d20e2..e9a96598f11fd0160e6990356b8ea0b0a1555d90 100644 +index 1abef24d101b3426544f24484c32e7999535d3d0..1686353217d288c2faaef98f8cd445baf8ee0df5 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom @@ -298,6 +298,16 @@ struct SocketBrokerRemotes { diff --git a/patches/chromium/notification_provenance.patch b/patches/chromium/notification_provenance.patch index bcf49e5d1b..41d8414721 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -92,10 +92,10 @@ index fe56b0bde4480765e5dffe5afb6ddf73ca8d63c8..93de0ace3dabf526d737897d42df35a5 contents_.get()->GetPrimaryMainFrame()->GetWeakDocumentPtr(), RenderProcessHost::NotificationServiceCreatorType::kDocument, diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc -index 43b492ef0d3fa49f51acc77b4600698375f2a28c..3a3102d6dd945879f45638cfac8f32409fc5e96d 100644 +index 77c6f5d3e5845b23a13d413cbf014c71bfd3482a..03b8449a8b8572441a0dde11da74b042f791ea70 100644 --- a/content/browser/notifications/platform_notification_context_impl.cc +++ b/content/browser/notifications/platform_notification_context_impl.cc -@@ -268,6 +268,7 @@ void PlatformNotificationContextImpl::Shutdown() { +@@ -280,6 +280,7 @@ void PlatformNotificationContextImpl::Shutdown() { void PlatformNotificationContextImpl::CreateService( RenderProcessHost* render_process_host, @@ -103,7 +103,7 @@ index 43b492ef0d3fa49f51acc77b4600698375f2a28c..3a3102d6dd945879f45638cfac8f3240 const blink::StorageKey& storage_key, const GURL& document_url, const WeakDocumentPtr& weak_document_ptr, -@@ -276,7 +277,7 @@ void PlatformNotificationContextImpl::CreateService( +@@ -288,7 +289,7 @@ void PlatformNotificationContextImpl::CreateService( DCHECK_CURRENTLY_ON(BrowserThread::UI); services_.push_back(std::make_unique<BlinkNotificationServiceImpl>( this, browser_context_, service_worker_context_, render_process_host, @@ -113,7 +113,7 @@ index 43b492ef0d3fa49f51acc77b4600698375f2a28c..3a3102d6dd945879f45638cfac8f3240 } diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h -index 38c8cf36fdf9366121c7ada96c167a4c9664952e..03b37fb62655a355e104870a088e4222932bdc17 100644 +index 46b071609e56e8602b04d1cd9f5f4ebd7e4f4ae1..6092383e0f8f1c0d829a8ef8af53a78664457539 100644 --- a/content/browser/notifications/platform_notification_context_impl.h +++ b/content/browser/notifications/platform_notification_context_impl.h @@ -47,6 +47,7 @@ class PlatformNotificationServiceProxy; @@ -133,10 +133,10 @@ index 38c8cf36fdf9366121c7ada96c167a4c9664952e..03b37fb62655a355e104870a088e4222 const GURL& document_url, const WeakDocumentPtr& weak_document_ptr, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index e781d19af429cdb4969879016ef08690e6001f61..3711868d3e39ff1a4541cea72e7e627d50405417 100644 +index dd2c6144fbc99a572282bdb8e0b5f0d9a169f308..bd77d2cf5018c453a753b2f160a382821c84ab78 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -1978,7 +1978,7 @@ void RenderProcessHostImpl::CreateNotificationService( +@@ -1975,7 +1975,7 @@ void RenderProcessHostImpl::CreateNotificationService( case RenderProcessHost::NotificationServiceCreatorType::kSharedWorker: case RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker: { storage_partition_impl_->GetPlatformNotificationContext()->CreateService( @@ -145,7 +145,7 @@ index e781d19af429cdb4969879016ef08690e6001f61..3711868d3e39ff1a4541cea72e7e627d creator_type, std::move(receiver)); break; } -@@ -1986,7 +1986,7 @@ void RenderProcessHostImpl::CreateNotificationService( +@@ -1983,7 +1983,7 @@ void RenderProcessHostImpl::CreateNotificationService( CHECK(rfh); storage_partition_impl_->GetPlatformNotificationContext()->CreateService( diff --git a/patches/chromium/partially_revert_is_newly_created_to_allow_for_browser_initiated.patch b/patches/chromium/partially_revert_is_newly_created_to_allow_for_browser_initiated.patch index fbad221a73..c526d9d140 100644 --- a/patches/chromium/partially_revert_is_newly_created_to_allow_for_browser_initiated.patch +++ b/patches/chromium/partially_revert_is_newly_created_to_allow_for_browser_initiated.patch @@ -10,7 +10,7 @@ an about:blank check to this area. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5403876 diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index a11fc7e47362f7af502367c8363878830c055329..55622b45b7e7b9c00633c01e6c235b2e8e6640d6 100644 +index 3b88a74fe5ccbad4c691be18ad7b902b356f0a31..5d4b2d4c11c7caa9719602cc87de13b243583acb 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc @@ -785,8 +785,8 @@ void VerifyThatBrowserAndRendererCalculatedOriginsToCommitMatch( diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index be7d66747c..205b2c3ec3 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -873,10 +873,10 @@ index 14de029740ffbebe06d309651c1a2c007d9fb96b..e9bf9c5bef2a9235260e7d6c8d26d415 ScriptingThrottler scripting_throttler_; diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 537c1cddc964748f8b978d1b4fa6f5a6c45ebf08..5ae1b2a8bc5f242fd699a9857789b2923eeb2145 100644 +index 68b325f7d504571b81a13877654d1b1852057417..5120a7f0a9511ac2d8851f644ef02b59fb03a10e 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn -@@ -2986,8 +2986,9 @@ source_set("browser") { +@@ -2987,8 +2987,9 @@ source_set("browser") { "//ppapi/shared_impl", ] diff --git a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch index 228caaa263..118b9aeee6 100644 --- a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch +++ b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch @@ -30,7 +30,7 @@ index eaca11c1b16ee0befe8f5bfd3735a582a63cbd81..9f042cd993e46993826634772714c4f2 // RenderWidgetHost on the primary main frame, and false otherwise. virtual bool IsWidgetForPrimaryMainFrame(RenderWidgetHostImpl*); diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index 9910b595e250e5635310e33a66a00d654f41556a..2a1a4470abfc8ad8895a3506d8791c4db042e7bc 100644 +index 872270420493edb219d724a412242b6a0db114af..ad8d5236fe2b9f55462445b2fc332a27e588a8e0 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -1955,6 +1955,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) { @@ -44,10 +44,10 @@ index 9910b595e250e5635310e33a66a00d654f41556a..2a1a4470abfc8ad8895a3506d8791c4d void RenderWidgetHostImpl::ShowContextMenuAtPoint( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 7213f6d9b24bc505b1ab2044cdc50e5b36a3bad3..970d56419b675b461b9c1e2fffadc2302c3d94a0 100644 +index 68b5d176f3b98e639f0c1c563b81a55f66c3b6d3..bf42c63ea9282b814a35eb56fd64db4411516a9a 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -5418,6 +5418,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { +@@ -5419,6 +5419,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { return text_input_manager_.get(); } @@ -60,7 +60,7 @@ index 7213f6d9b24bc505b1ab2044cdc50e5b36a3bad3..970d56419b675b461b9c1e2fffadc230 RenderWidgetHostImpl* render_widget_host) { return render_widget_host == GetPrimaryMainFrame()->GetRenderWidgetHost(); diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h -index 7a8e34e210cb131049f8e41c8c73a6a3e8d95926..6de18b5c0b05797e691f6dd41e4f6a8c952642f0 100644 +index e6bbb6aedbbca2c1cd3af4d626d268d56e1d6431..85387788b6172d22e0aea80fe3385c24cb140273 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -1109,6 +1109,7 @@ class CONTENT_EXPORT WebContentsImpl diff --git a/patches/chromium/refactor_expose_file_system_access_blocklist.patch b/patches/chromium/refactor_expose_file_system_access_blocklist.patch index 4072eafd93..1054d15fe9 100644 --- a/patches/chromium/refactor_expose_file_system_access_blocklist.patch +++ b/patches/chromium/refactor_expose_file_system_access_blocklist.patch @@ -8,10 +8,10 @@ it in Electron and prevent drift from Chrome's blocklist. We should look for a w to upstream this change to Chrome. diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc -index 0b8499aa3b00d72e8598f0bbdfe14cc559055d9b..7cac8e43bda2de490aa5bfc17dcc5f575425c4cd 100644 +index e681cc05ca3b3198d70457288ca5ee877c63f94f..a451bcadad1b1279e16a38e770c3dd054c8e5a01 100644 --- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc +++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc -@@ -39,7 +39,6 @@ +@@ -40,7 +40,6 @@ #include "chrome/browser/safe_browsing/download_protection/download_protection_util.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/file_system_access_dialogs.h" @@ -19,7 +19,7 @@ index 0b8499aa3b00d72e8598f0bbdfe14cc559055d9b..7cac8e43bda2de490aa5bfc17dcc5f57 #include "chrome/grit/generated_resources.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" -@@ -225,118 +224,10 @@ bool MaybeIsLocalUNCPath(const base::FilePath& path) { +@@ -226,118 +225,10 @@ bool MaybeIsLocalUNCPath(const base::FilePath& path) { } #endif @@ -143,7 +143,7 @@ index 0b8499aa3b00d72e8598f0bbdfe14cc559055d9b..7cac8e43bda2de490aa5bfc17dcc5f57 // Describes a rule for blocking a directory, which can be constructed // dynamically (based on state) or statically (from kBlockedPaths). diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h -index d48fd46095400bf5eeaa874eaa5d8e6f05b4e7da..7789be00bbc503d8278e38fcb1e7feebac9ff325 100644 +index f6d36e2068fbe3681dba7b2c84bc7e81c7da6541..1ac631bacf574f0ce491aa75d40d74006da55321 100644 --- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h +++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h @@ -17,12 +17,13 @@ @@ -161,17 +161,16 @@ index d48fd46095400bf5eeaa874eaa5d8e6f05b4e7da..7789be00bbc503d8278e38fcb1e7feeb #if !BUILDFLAG(IS_ANDROID) #include "chrome/browser/permissions/one_time_permissions_tracker.h" #include "chrome/browser/permissions/one_time_permissions_tracker_observer.h" -@@ -30,7 +31,8 @@ +@@ -30,7 +31,7 @@ #include "chrome/browser/web_applications/web_app_install_manager_observer.h" #endif -#if BUILDFLAG(ENTERPRISE_CLOUD_CONTENT_ANALYSIS) +#if 0 -+#include "components/enterprise/buildflags/buildflags.h" - #include "chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.h" #include "components/enterprise/common/files_scan_data.h" #endif -@@ -337,6 +339,119 @@ class ChromeFileSystemAccessPermissionContext + +@@ -336,6 +337,119 @@ class ChromeFileSystemAccessPermissionContext // KeyedService: void Shutdown() override; @@ -291,7 +290,7 @@ index d48fd46095400bf5eeaa874eaa5d8e6f05b4e7da..7789be00bbc503d8278e38fcb1e7feeb protected: SEQUENCE_CHECKER(sequence_checker_); -@@ -356,7 +471,7 @@ class ChromeFileSystemAccessPermissionContext +@@ -355,7 +469,7 @@ class ChromeFileSystemAccessPermissionContext void PermissionGrantDestroyed(PermissionGrantImpl* grant); diff --git a/patches/chromium/scroll_bounce_flag.patch b/patches/chromium/scroll_bounce_flag.patch index a3c9e0c574..0409bc8fab 100644 --- a/patches/chromium/scroll_bounce_flag.patch +++ b/patches/chromium/scroll_bounce_flag.patch @@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch Patch to make scrollBounce option work. diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc -index f2b7b6d436431bc5b6c847621e86ef6223380d29..45e029e33291c70fdf46939326bb212cfcdc0927 100644 +index 1031ce449419808b0285c4f01b69874cb450e5d9..93391b7821c4c37a185658bd095e39ca5f91bf95 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -1276,7 +1276,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { +@@ -1280,7 +1280,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { } bool RenderThreadImpl::IsElasticOverscrollEnabled() { diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index 0c08a90085..fcb086678d 100644 --- a/patches/chromium/support_mixed_sandbox_with_zygote.patch +++ b/patches/chromium/support_mixed_sandbox_with_zygote.patch @@ -22,7 +22,7 @@ However, the patch would need to be reviewed by the security team, as it does touch a security-sensitive class. diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 3711868d3e39ff1a4541cea72e7e627d50405417..ff475a6538baa1a997eca6617d24213300522ffd 100644 +index bd77d2cf5018c453a753b2f160a382821c84ab78..c916c631535cb428c31436bc54bfa2dff7cd8c71 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1612,9 +1612,15 @@ bool RenderProcessHostImpl::Init() { diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index cf9008e364..19bed6efb6 100644 --- a/patches/chromium/web_contents.patch +++ b/patches/chromium/web_contents.patch @@ -9,10 +9,10 @@ is needed for OSR. Originally landed in https://github.com/electron/libchromiumcontent/pull/226. diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index a473ff79dd958560365087a2bc3156191cf450ef..087958042f1bd1bf42f1b3240a02a48d1c7454ae 100644 +index 05f2d3dbeb8aae82cacec6c223f2defb1174151d..c0199d91e9abe6a7f2b747904a853422459caab4 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3618,6 +3618,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3619,6 +3619,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, params.main_frame_name, GetOpener(), primary_main_frame_policy, base::UnguessableToken::Create()); @@ -26,7 +26,7 @@ index a473ff79dd958560365087a2bc3156191cf450ef..087958042f1bd1bf42f1b3240a02a48d std::unique_ptr<WebContentsViewDelegate> delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -3628,6 +3635,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3629,6 +3636,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index 650874d726..e06891ca87 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -15,10 +15,10 @@ Note that we also need to manually update embedder's `api::WebContents::IsFullscreenForTabOrPending` value. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index 952d0e3c3da884fef62494d81a1632c0806e40c8..a11fc7e47362f7af502367c8363878830c055329 100644 +index c3d4f2dbf0131a80ce2e18c3f1f35f3b4aa5b6f7..3b88a74fe5ccbad4c691be18ad7b902b356f0a31 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -7980,6 +7980,17 @@ void RenderFrameHostImpl::EnterFullscreen( +@@ -7999,6 +7999,17 @@ void RenderFrameHostImpl::EnterFullscreen( } } @@ -37,10 +37,10 @@ index 952d0e3c3da884fef62494d81a1632c0806e40c8..a11fc7e47362f7af502367c836387883 if (had_fullscreen_token && !GetView()->HasFocus()) GetView()->Focus(); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 087958042f1bd1bf42f1b3240a02a48d1c7454ae..8696a4043d27daab5f62ba9fbc3fba461cc52a00 100644 +index c0199d91e9abe6a7f2b747904a853422459caab4..639f34cac9f58c3e757ed9b10050e2c185fe6a0c 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3873,21 +3873,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent( +@@ -3874,21 +3874,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent( const input::NativeWebKeyboardEvent& event) { OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"), "WebContentsImpl::PreHandleKeyboardEvent"); @@ -78,7 +78,7 @@ index 087958042f1bd1bf42f1b3240a02a48d1c7454ae..8696a4043d27daab5f62ba9fbc3fba46 } bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) { -@@ -4045,7 +4049,7 @@ void WebContentsImpl::EnterFullscreenMode( +@@ -4046,7 +4050,7 @@ void WebContentsImpl::EnterFullscreenMode( OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode"); DCHECK(CanEnterFullscreenMode(requesting_frame)); DCHECK(requesting_frame->IsActive()); diff --git a/patches/chromium/worker_context_will_destroy.patch b/patches/chromium/worker_context_will_destroy.patch index b079e06dcf..f0dd0801b6 100644 --- a/patches/chromium/worker_context_will_destroy.patch +++ b/patches/chromium/worker_context_will_destroy.patch @@ -26,10 +26,10 @@ index dd8f6b9a87a0cc5d2b1ba4867a4cc35ab961a3a2..ef247e62733ebe5058803a4c2a8866af // An empty URL is returned if the URL is not overriden. virtual GURL OverrideFlashEmbedWithHTML(const GURL& url); diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc -index 06000a2c90989be3d58fcdd92237201ae199e6c9..4907d047aecb64ca36304881ded73c018fb89a00 100644 +index daa231edf4ce1890c0a229142504d860d4da443f..929fc1f3de07bdadb8231818e222f914c08a6d3c 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -875,6 +875,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { +@@ -896,6 +896,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread(); } @@ -43,10 +43,10 @@ index 06000a2c90989be3d58fcdd92237201ae199e6c9..4907d047aecb64ca36304881ded73c01 const v8::Local<v8::Context>& worker) { GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h -index 75504bfc89cbe83828db7730e6e6ce2ad8c2b2a7..45af12ddbf7dd3ab5c82d810e330fd008b567448 100644 +index c1db7661ae79709afcb7a686a792ba0bbafdc59b..1a2ef563c5393ba5e1e2f0ae49b152555587d324 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h -@@ -193,6 +193,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -195,6 +195,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { void DidStartWorkerThread() override; void WillStopWorkerThread() override; void WorkerContextCreated(const v8::Local<v8::Context>& worker) override; @@ -55,10 +55,10 @@ index 75504bfc89cbe83828db7730e6e6ce2ad8c2b2a7..45af12ddbf7dd3ab5c82d810e330fd00 const blink::WebSecurityOrigin& script_origin) override; blink::ProtocolHandlerSecurityLevel GetProtocolHandlerSecurityLevel( diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h -index 848edcdaf3a0169be0904e2fe081adb42d4b4242..73d35d10eeec0ba1851d186bcb13b65a97af2630 100644 +index 1131374e07a14bfb4297b2034b669c6b5afe27d1..0f6cf25c6203c4c2bf28b9f4536a153427841502 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -656,6 +656,7 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -664,6 +664,7 @@ class BLINK_PLATFORM_EXPORT Platform { virtual void DidStartWorkerThread() {} virtual void WillStopWorkerThread() {} virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {} diff --git a/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch b/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch index 8e9dab9c37..ec6fc5650a 100644 --- a/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch +++ b/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch @@ -35,10 +35,10 @@ index ef247e62733ebe5058803a4c2a8866af300ba16c..f020fb016cce18b480c86b53e4cbedf4 // from the worker thread. virtual void WillDestroyWorkerContextOnWorkerThread( diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc -index 4907d047aecb64ca36304881ded73c018fb89a00..babd21dc19ee329694d93c99c025822bca30ee6b 100644 +index 929fc1f3de07bdadb8231818e222f914c08a6d3c..6cbbaaa3bd340a3d62d598a5bea50d3d2ad3ef7c 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -887,6 +887,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated( +@@ -908,6 +908,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated( worker); } @@ -52,10 +52,10 @@ index 4907d047aecb64ca36304881ded73c018fb89a00..babd21dc19ee329694d93c99c025822b const blink::WebSecurityOrigin& script_origin) { return GetContentClient()->renderer()->AllowScriptExtensionForServiceWorker( diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h -index 45af12ddbf7dd3ab5c82d810e330fd008b567448..1e4d14dac6398f3b81149d58ba13c021e7d0faff 100644 +index 1a2ef563c5393ba5e1e2f0ae49b152555587d324..10fba4b6d1bc7bd052b75188239eeaddb2b17ae7 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h -@@ -193,6 +193,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -195,6 +195,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { void DidStartWorkerThread() override; void WillStopWorkerThread() override; void WorkerContextCreated(const v8::Local<v8::Context>& worker) override; @@ -65,10 +65,10 @@ index 45af12ddbf7dd3ab5c82d810e330fd008b567448..1e4d14dac6398f3b81149d58ba13c021 bool AllowScriptExtensionForServiceWorker( const blink::WebSecurityOrigin& script_origin) override; diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h -index 73d35d10eeec0ba1851d186bcb13b65a97af2630..bc503c4f89afd0036b5b7986d28502742893e44c 100644 +index 0f6cf25c6203c4c2bf28b9f4536a153427841502..b06be1240de2a2ece0562484a13479639dc395b3 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h -@@ -656,6 +656,8 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -664,6 +664,8 @@ class BLINK_PLATFORM_EXPORT Platform { virtual void DidStartWorkerThread() {} virtual void WillStopWorkerThread() {} virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {} diff --git a/patches/devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch b/patches/devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch index a39c8d23d0..f796159510 100644 --- a/patches/devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch +++ b/patches/devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch @@ -10,10 +10,10 @@ to handle this without patching, but this is fairly clean for now and no longer patching legacy devtools code. diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts -index b999c155769da744b8971526cd66c9b052ce80ce..993b79e31e69807ed4311e75c0c04dc8ec438496 100644 +index fbded4d8e5cbe4b7134a1438799ee46800198113..bf713c9f4f168175e9de9e9c2a68b7df9c3eba06 100644 --- a/front_end/entrypoints/main/MainImpl.ts +++ b/front_end/entrypoints/main/MainImpl.ts -@@ -740,6 +740,8 @@ export class MainImpl { +@@ -741,6 +741,8 @@ export class MainImpl { globalThis.Main = globalThis.Main || {}; // @ts-ignore Exported for Tests.js globalThis.Main.Main = MainImpl; diff --git a/patches/node/.patches b/patches/node/.patches index 66d8cd0ff7..57f1d3e3d4 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -54,3 +54,4 @@ fix_add_property_query_interceptors.patch src_account_for_openssl_unexpected_version.patch windows_32bit_config_change_callback_needs_to_be_stdcall.patch fix_building_with_unicode.patch +src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch diff --git a/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch b/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch new file mode 100644 index 0000000000..b1b39f056f --- /dev/null +++ b/patches/node/src_stop_using_deprecated_fields_of_fastapicallbackoptions.patch @@ -0,0 +1,58 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Andreas Haas <[email protected]> +Date: Sun, 28 Jul 2024 09:20:12 +0200 +Subject: src: stop using deprecated fields of `v8::FastApiCallbackOptions` + +Two fields on the `v8::FastApiCallbackOptions` struct were deprecated +recently: `fallback` and `wasm_memory`. This PR removes uses of these +two fields in node.js. + +(This is a subset of upstream commit d0000b118 from the `canary-base` +branch of Node.js. This patch can be removed when Electron upgrades to +a stable Node release that contains the change. -- Charles) + +diff --git a/src/histogram.cc b/src/histogram.cc +index 4f58359fe58529329fca8b13d4d4655d87a097f2..18983209db834d10faad6c2a56658ab060bcd097 100644 +--- a/src/histogram.cc ++++ b/src/histogram.cc +@@ -193,7 +193,8 @@ void HistogramBase::FastRecord(Local<Value> receiver, + const int64_t value, + FastApiCallbackOptions& options) { + if (value < 1) { +- options.fallback = true; ++ Environment* env = Environment::GetCurrent(options.isolate); ++ THROW_ERR_OUT_OF_RANGE(env, "value is out of range"); + return; + } + HistogramBase* histogram; +diff --git a/src/node_wasi.cc b/src/node_wasi.cc +index ad1da44a01f437c97e06a3857eebd2edcebc83da..7123278e1a0942b61a76e9b1e7464eb8b5064079 100644 +--- a/src/node_wasi.cc ++++ b/src/node_wasi.cc +@@ -248,17 +248,18 @@ R WASI::WasiFunction<FT, F, R, Args...>::FastCallback( + WASI* wasi = reinterpret_cast<WASI*>(BaseObject::FromJSObject(receiver)); + if (UNLIKELY(wasi == nullptr)) return EinvalError<R>(); + +- if (UNLIKELY(options.wasm_memory == nullptr || wasi->memory_.IsEmpty())) { +- // fallback to slow path which to throw an error about missing memory. +- options.fallback = true; ++ v8::Isolate* isolate = receiver->GetIsolate(); ++ v8::HandleScope handle_scope(isolate); ++ if (wasi->memory_.IsEmpty()) { ++ THROW_ERR_WASI_NOT_STARTED(isolate); + return EinvalError<R>(); + } +- uint8_t* memory = nullptr; +- CHECK(LIKELY(options.wasm_memory->getStorageIfAligned(&memory))); ++ Local<ArrayBuffer> ab = wasi->memory_.Get(isolate)->Buffer(); ++ size_t mem_size = ab->ByteLength(); ++ char* mem_data = static_cast<char*>(ab->Data()); ++ CHECK_NOT_NULL(mem_data); + +- return F(*wasi, +- {reinterpret_cast<char*>(memory), options.wasm_memory->length()}, +- args...); ++ return F(*wasi, {mem_data, mem_size}, args...); + } + + namespace { diff --git a/patches/squirrel.mac/.patches b/patches/squirrel.mac/.patches index b6b24976e8..a86478c889 100644 --- a/patches/squirrel.mac/.patches +++ b/patches/squirrel.mac/.patches @@ -6,3 +6,4 @@ refactor_use_posix_spawn_instead_of_nstask_so_we_can_disclaim_the.patch fix_abort_installation_attempt_at_the_final_mile_if_the_app_is.patch feat_add_ability_to_prevent_version_downgrades.patch refactor_use_non-deprecated_nskeyedarchiver_apis.patch +chore_turn_off_launchapplicationaturl_deprecation_errors_in_squirrel.patch diff --git a/patches/squirrel.mac/chore_turn_off_launchapplicationaturl_deprecation_errors_in_squirrel.patch b/patches/squirrel.mac/chore_turn_off_launchapplicationaturl_deprecation_errors_in_squirrel.patch new file mode 100644 index 0000000000..65dd0c8a88 --- /dev/null +++ b/patches/squirrel.mac/chore_turn_off_launchapplicationaturl_deprecation_errors_in_squirrel.patch @@ -0,0 +1,45 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Charles Kerr <[email protected]> +Date: Thu, 1 Aug 2024 10:02:46 -0500 +Subject: chore: turn off launchApplicationAtURL deprecation errors in Squirrel + +Add pragmas to disable deprecation warnings. This patch should be +updated to use non-deprecated API in upgrade-follow-up ticket +https://github.com/electron/electron/issues/43168 + +diff --git a/Squirrel/ShipIt-main.m b/Squirrel/ShipIt-main.m +index 671f8fa2104df85046ff813d4b824a65caae502f..acf545199dbf1831fe8a73155c6e4d0db4047934 100644 +--- a/Squirrel/ShipIt-main.m ++++ b/Squirrel/ShipIt-main.m +@@ -186,10 +186,14 @@ static void installRequest(RACSignal *readRequestSignal, NSString *applicationId + NSLog(@"New ShipIt exited"); + } else { + NSLog(@"Attempting to launch app on lower than 11.0"); ++// TODO: https://github.com/electron/electron/issues/43168 ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wdeprecated-declarations" + if (![NSWorkspace.sharedWorkspace launchApplicationAtURL:bundleURL options:NSWorkspaceLaunchDefault configuration:@{} error:&error]) { + NSLog(@"Could not launch application at %@: %@", bundleURL, error); + return; + } ++#pragma clang diagnostic pop + + NSLog(@"Application launched at %@", bundleURL); + } +@@ -235,12 +239,16 @@ int main(int argc, const char * argv[]) { + + if (strcmp(jobLabel, [launchSignal UTF8String]) == 0) { + NSLog(@"Detected this as a launch request"); ++// TODO: https://github.com/electron/electron/issues/43168 ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wdeprecated-declarations" + NSError *error; + if (![NSWorkspace.sharedWorkspace launchApplicationAtURL:shipItStateURL options:NSWorkspaceLaunchDefault configuration:@{} error:&error]) { + NSLog(@"Could not launch application at %@: %@", shipItStateURL, error); + } else { + NSLog(@"Successfully launched application at %@", shipItStateURL); + } ++#pragma clang diagnostic pop + exit(EXIT_SUCCESS); + } else { + NSLog(@"Detected this as an install request"); diff --git a/patches/v8/deps_add_v8_object_setinternalfieldfornodecore.patch b/patches/v8/deps_add_v8_object_setinternalfieldfornodecore.patch index ca93b3b962..7d51884c7d 100644 --- a/patches/v8/deps_add_v8_object_setinternalfieldfornodecore.patch +++ b/patches/v8/deps_add_v8_object_setinternalfieldfornodecore.patch @@ -11,7 +11,7 @@ This is a non-ABI breaking solution added by Node.js in v20.x for: which are necessary for backporting the vm-related memory fixes in https://github.com/nodejs/node/pull/48510. diff --git a/include/v8-object.h b/include/v8-object.h -index d03b33acd7c83ef1e683e2ddc4eb6c1ecafd83b3..626425af0b121e3489e7ac8171af64b1c7a25f55 100644 +index 71a6c2c9c149116caa410d25aef4087774b81b44..ad8416ea2500f10aad31f25da96b235f4e9c118f 100644 --- a/include/v8-object.h +++ b/include/v8-object.h @@ -22,6 +22,8 @@ class Function; @@ -46,11 +46,11 @@ index d03b33acd7c83ef1e683e2ddc4eb6c1ecafd83b3..626425af0b121e3489e7ac8171af64b1 V8_INLINE static void* GetAlignedPointerFromInternalField( const BasicTracedReference<Object>& object, int index) { diff --git a/src/api/api.cc b/src/api/api.cc -index f8d3c5aa1231f4b62a614bc0c705366d922b4c75..88118ae452275ff2a515c5efbad4f6ecb3629abd 100644 +index 62da9c0dd63592710f9e56cf8e44b46e9cfeee2b..2e55d5dd8d9178b409c520f021feebe9c1720537 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -6372,14 +6372,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) { - isolate); +@@ -6379,14 +6379,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) { + i::Cast<i::JSObject>(*obj)->GetEmbedderField(index), isolate)); } -void v8::Object::SetInternalField(int index, v8::Local<Data> value) { diff --git a/patches/v8/fix_disable_scope_reuse_associated_dchecks.patch b/patches/v8/fix_disable_scope_reuse_associated_dchecks.patch index 75932928c5..bc107d1680 100644 --- a/patches/v8/fix_disable_scope_reuse_associated_dchecks.patch +++ b/patches/v8/fix_disable_scope_reuse_associated_dchecks.patch @@ -23,27 +23,29 @@ public tracking bug for this feature nor the crashes its been causing, so we'll have to keep an eye on this for the time being. diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc -index 6c85e6734d40bbbe24d883b083f6712c474cc283..dc39bceb9b7c939eba8f4d2dd0c53395bde8fec4 100644 +index 63595b84b71957a81c50d054b8db573be9d9d981..f23453f86cb0786d59328177be1a9bc6b4801c1a 100644 --- a/src/ast/scopes.cc +++ b/src/ast/scopes.cc -@@ -2722,9 +2722,9 @@ void Scope::AllocateScopeInfosRecursively( - - // Allocate ScopeInfos for inner scopes. +@@ -2724,10 +2724,10 @@ void Scope::AllocateScopeInfosRecursively( for (Scope* scope = inner_scope_; scope != nullptr; scope = scope->sibling_) { -- DCHECK_GT(scope->UniqueIdInScript(), UniqueIdInScript()); -- DCHECK_IMPLIES(scope->sibling_, scope->sibling_->UniqueIdInScript() != -- scope->UniqueIdInScript()); -+ // DCHECK_GT(scope->UniqueIdInScript(), UniqueIdInScript()); -+ // DCHECK_IMPLIES(scope->sibling_, scope->sibling_->UniqueIdInScript() != -+ // scope->UniqueIdInScript()); + #ifdef DEBUG + if (!scope->is_hidden_catch_scope()) { +- DCHECK_GT(scope->UniqueIdInScript(), UniqueIdInScript()); +- DCHECK_IMPLIES( +- scope->sibling_ && !scope->sibling_->is_hidden_catch_scope(), +- scope->sibling_->UniqueIdInScript() != scope->UniqueIdInScript()); ++ // DCHECK_GT(scope->UniqueIdInScript(), UniqueIdInScript()); ++ // DCHECK_IMPLIES( ++ // scope->sibling_ && !scope->sibling_->is_hidden_catch_scope(), ++ // scope->sibling_->UniqueIdInScript() != scope->UniqueIdInScript()); + } + #endif if (!scope->is_function_scope() || - scope->AsDeclarationScope()->ShouldEagerCompile()) { - scope->AllocateScopeInfosRecursively(isolate, next_outer_scope, diff --git a/src/flags/flag-definitions.h b/src/flags/flag-definitions.h -index 2ac4e74daa5e8837f459755d85b4f451a7f5bb31..326b42c92dc1f20b0abff4b9f49657df6489f78d 100644 +index df04f66444cb4aee60244a19e38775033efe7fe8..b9414b7e830b4b1a102ed2b277a4aa8ab3cbc351 100644 --- a/src/flags/flag-definitions.h +++ b/src/flags/flag-definitions.h -@@ -996,7 +996,12 @@ DEFINE_BOOL(trace_track_allocation_sites, false, +@@ -979,7 +979,12 @@ DEFINE_BOOL(trace_track_allocation_sites, false, DEFINE_BOOL(trace_migration, false, "trace object migration") DEFINE_BOOL(trace_generalization, false, "trace map generalization") diff --git a/script/zip_manifests/dist_zip.linux.arm.manifest b/script/zip_manifests/dist_zip.linux.arm.manifest index 224d2f036d..24185ba48b 100644 --- a/script/zip_manifests/dist_zip.linux.arm.manifest +++ b/script/zip_manifests/dist_zip.linux.arm.manifest @@ -4,6 +4,7 @@ chrome-sandbox chrome_100_percent.pak chrome_200_percent.pak chrome_crashpad_handler +clang_x86_v8_arm/snapshot_blob.bin electron icudtl.dat libEGL.so diff --git a/script/zip_manifests/dist_zip.linux.arm64.manifest b/script/zip_manifests/dist_zip.linux.arm64.manifest index 224d2f036d..c47241b457 100644 --- a/script/zip_manifests/dist_zip.linux.arm64.manifest +++ b/script/zip_manifests/dist_zip.linux.arm64.manifest @@ -4,6 +4,7 @@ chrome-sandbox chrome_100_percent.pak chrome_200_percent.pak chrome_crashpad_handler +clang_x64_v8_arm64/snapshot_blob.bin electron icudtl.dat libEGL.so diff --git a/script/zip_manifests/dist_zip.win.arm64.manifest b/script/zip_manifests/dist_zip.win.arm64.manifest index 5d8deb41a5..0eeaa393ac 100755 --- a/script/zip_manifests/dist_zip.win.arm64.manifest +++ b/script/zip_manifests/dist_zip.win.arm64.manifest @@ -71,3 +71,4 @@ vk_swiftshader.dll vulkan-1.dll v8_context_snapshot.bin version +win_clang_x64/snapshot_blob.bin diff --git a/shell/app/electron_login_helper.mm b/shell/app/electron_login_helper.mm index 86895c8c75..dbcb0c9958 100644 --- a/shell/app/electron_login_helper.mm +++ b/shell/app/electron_login_helper.mm @@ -4,6 +4,12 @@ #import <Cocoa/Cocoa.h> +// launchApplication is deprecated; should be migrated to +// [NSWorkspace openApplicationAtURL:configuration:completionHandler:] +// UserNotifications.frameworks API +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + int main(int argc, char* argv[]) { @autoreleasepool { NSArray* pathComponents = @@ -11,7 +17,11 @@ int main(int argc, char* argv[]) { pathComponents = [pathComponents subarrayWithRange:NSMakeRange(0, [pathComponents count] - 4)]; NSString* path = [NSString pathWithComponents:pathComponents]; + [[NSWorkspace sharedWorkspace] launchApplication:path]; return 0; } } + +// -Wdeprecated-declarations +#pragma clang diagnostic pop diff --git a/shell/browser/mac/electron_application_delegate.mm b/shell/browser/mac/electron_application_delegate.mm index 655174d4b4..01ba9d50df 100644 --- a/shell/browser/mac/electron_application_delegate.mm +++ b/shell/browser/mac/electron_application_delegate.mm @@ -68,6 +68,11 @@ static NSDictionary* UNNotificationResponseToNSDictionary( electron::Browser::Get()->WillFinishLaunching(); } +// NSUserNotification is deprecated; all calls should be replaced with +// UserNotifications.frameworks API +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + - (void)applicationDidFinishLaunching:(NSNotification*)notify { NSObject* user_notification = [notify userInfo][NSApplicationLaunchUserNotificationKey]; @@ -95,6 +100,9 @@ static NSDictionary* UNNotificationResponseToNSDictionary( electron::NSDictionaryToValue(notification_info)); } +// -Wdeprecated-declarations +#pragma clang diagnostic pop + - (void)applicationDidBecomeActive:(NSNotification*)notification { electron::Browser::Get()->DidBecomeActive(); } diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 3766e10d31..b5dbcef130 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -219,6 +219,11 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, if (!rounded_corner && !has_frame()) styleMask = NSWindowStyleMaskBorderless; +// TODO: remove NSWindowStyleMaskTexturedBackground. +// https://github.com/electron/electron/issues/43125 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + if (minimizable) styleMask |= NSWindowStyleMaskMiniaturizable; if (closable) @@ -228,6 +233,9 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, if (!useStandardWindow || transparent() || !has_frame()) styleMask |= NSWindowStyleMaskTexturedBackground; +// -Wdeprecated-declarations +#pragma clang diagnostic pop + // Create views::Widget and assign window_ with it. // TODO(zcbenz): Get rid of the window_ in future. views::Widget::InitParams params( diff --git a/shell/browser/notifications/mac/cocoa_notification.h b/shell/browser/notifications/mac/cocoa_notification.h index c0a2664b0b..075c5ad17c 100644 --- a/shell/browser/notifications/mac/cocoa_notification.h +++ b/shell/browser/notifications/mac/cocoa_notification.h @@ -14,6 +14,11 @@ namespace electron { +// NSUserNotification is deprecated; all calls should be replaced with +// UserNotifications.frameworks API +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + class CocoaNotification : public Notification { public: CocoaNotification(NotificationDelegate* delegate, @@ -40,6 +45,9 @@ class CocoaNotification : public Notification { unsigned action_index_; }; +// -Wdeprecated-declarations +#pragma clang diagnostic pop + } // namespace electron #endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_MAC_COCOA_NOTIFICATION_H_ diff --git a/shell/browser/notifications/mac/cocoa_notification.mm b/shell/browser/notifications/mac/cocoa_notification.mm index 8d5f3ad70b..9138515dc5 100644 --- a/shell/browser/notifications/mac/cocoa_notification.mm +++ b/shell/browser/notifications/mac/cocoa_notification.mm @@ -14,6 +14,11 @@ #include "shell/browser/notifications/notification_presenter.h" #include "skia/ext/skia_utils_mac.h" +// NSUserNotification is deprecated; we need to use the +// UserNotifications.frameworks API instead +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + namespace electron { CocoaNotification::CocoaNotification(NotificationDelegate* delegate, diff --git a/shell/browser/notifications/mac/notification_center_delegate.mm b/shell/browser/notifications/mac/notification_center_delegate.mm index d9603bcd94..3417395753 100644 --- a/shell/browser/notifications/mac/notification_center_delegate.mm +++ b/shell/browser/notifications/mac/notification_center_delegate.mm @@ -10,6 +10,11 @@ #include "shell/browser/notifications/mac/cocoa_notification.h" #include "shell/browser/notifications/mac/notification_presenter_mac.h" +// NSUserNotification is deprecated; we need to use the +// UserNotifications.frameworks API instead +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + @implementation NotificationCenterDelegate - (instancetype)initWithPresenter: diff --git a/shell/browser/notifications/mac/notification_presenter_mac.h b/shell/browser/notifications/mac/notification_presenter_mac.h index b45453900a..93b996e124 100644 --- a/shell/browser/notifications/mac/notification_presenter_mac.h +++ b/shell/browser/notifications/mac/notification_presenter_mac.h @@ -13,6 +13,11 @@ namespace electron { class CocoaNotification; +// NSUserNotification is deprecated; all calls should be replaced with +// UserNotifications.frameworks API +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + class NotificationPresenterMac : public NotificationPresenter { public: CocoaNotification* GetNotification(NSUserNotification* ns_notification); @@ -28,6 +33,9 @@ class NotificationPresenterMac : public NotificationPresenter { NotificationCenterDelegate* __strong notification_center_delegate_; }; +// -Wdeprecated-declarations +#pragma clang diagnostic pop + } // namespace electron #endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_MAC_NOTIFICATION_PRESENTER_MAC_H_ diff --git a/shell/browser/notifications/mac/notification_presenter_mac.mm b/shell/browser/notifications/mac/notification_presenter_mac.mm index 3d73591670..dd107e6e22 100644 --- a/shell/browser/notifications/mac/notification_presenter_mac.mm +++ b/shell/browser/notifications/mac/notification_presenter_mac.mm @@ -9,6 +9,11 @@ #include "shell/browser/notifications/mac/cocoa_notification.h" #include "shell/browser/notifications/mac/notification_center_delegate.h" +// NSUserNotification is deprecated; we need to use the +// UserNotifications.frameworks API instead +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + namespace electron { // static diff --git a/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm b/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm index 9ac5e737b5..aec0537f28 100644 --- a/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm +++ b/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm @@ -154,6 +154,11 @@ } } +// TODO: remove NSWindowStyleMaskTexturedBackground. +// https://github.com/electron/electron/issues/43125 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + - (void)setIsDocked:(BOOL)docked activate:(BOOL)activate { // Revert to no-devtools state. [self setDevToolsVisible:NO activate:NO]; @@ -196,6 +201,9 @@ [self setDevToolsVisible:YES activate:activate]; } +// -Wdeprecated-declarations +#pragma clang diagnostic pop + - (void)setContentsResizingStrategy: (const DevToolsContentsResizingStrategy&)strategy { strategy_.CopyFrom(strategy); diff --git a/shell/common/platform_util_mac.mm b/shell/common/platform_util_mac.mm index 49752dd4a2..55783132f2 100644 --- a/shell/common/platform_util_mac.mm +++ b/shell/common/platform_util_mac.mm @@ -25,6 +25,11 @@ #include "ui/views/widget/widget.h" #include "url/gurl.h" +// platform_util_mac.mm uses a lot of deprecated API. +// https://github.com/electron/electron/issues/43126 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + namespace { // This may be called from a global dispatch queue, the methods used here are @@ -78,6 +83,9 @@ std::string OpenPathOnThread(const base::FilePath& full_path) { return success ? "" : "Failed to open path"; } +// -Wdeprecated-declarations +#pragma clang diagnostic pop + // https://developer.apple.com/documentation/servicemanagement/1561515-service_management_errors?language=objc std::string GetLaunchStringForError(NSError* error) { if (@available(macOS 13, *)) { diff --git a/shell/utility/electron_content_utility_client.cc b/shell/utility/electron_content_utility_client.cc index 98cd602bee..27bd1d86ed 100644 --- a/shell/utility/electron_content_utility_client.cc +++ b/shell/utility/electron_content_utility_client.cc @@ -95,7 +95,7 @@ ElectronContentUtilityClient::~ElectronContentUtilityClient() = default; void ElectronContentUtilityClient::ExposeInterfacesToBrowser( mojo::BinderMap* binders) { #if BUILDFLAG(IS_WIN) - auto& cmd_line = *base::CommandLine::ForCurrentProcess(); + const auto& cmd_line = *base::CommandLine::ForCurrentProcess(); auto sandbox_type = sandbox::policy::SandboxTypeFromCommandLine(cmd_line); utility_process_running_elevated_ = sandbox_type == sandbox::mojom::Sandbox::kNoSandboxAndElevatedPrivileges;
chore
698cce67079ce8333d76ed3e865238bb31c82e7f
David Sanders
2025-02-24 00:54:08
fix: drag and drop icons on Windows (#45767)
diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 0abbd28619..8c08876b79 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -140,3 +140,4 @@ ignore_parse_errors_for_pkey_appusermodel_toastactivatorclsid.patch feat_add_signals_when_embedder_cleanup_callbacks_run_for.patch feat_separate_content_settings_callback_for_sync_and_async_clipboard.patch fix_win32_synchronous_spellcheck.patch +fix_drag_and_drop_icons_on_windows.patch diff --git a/patches/chromium/fix_drag_and_drop_icons_on_windows.patch b/patches/chromium/fix_drag_and_drop_icons_on_windows.patch new file mode 100644 index 0000000000..dd5b9697e7 --- /dev/null +++ b/patches/chromium/fix_drag_and_drop_icons_on_windows.patch @@ -0,0 +1,162 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Sanders <[email protected]> +Date: Fri, 21 Feb 2025 00:46:48 -0800 +Subject: fix: drag and drop icons on Windows + +This is a backport from Chromium of +https://chromium-review.googlesource.com/c/chromium/src/+/6279834 + +Change-Id: Ic642228f3a0a073b9b45fbec68de37be6cfd3934 + +diff --git a/chrome/browser/ui/views/tabs/tab_close_button.cc b/chrome/browser/ui/views/tabs/tab_close_button.cc +index 281d6c6fcccbf3bfc3396056e495ee8d19424f5a..ac335a68f3fd0e3931cb37c915de51e410734850 100644 +--- a/chrome/browser/ui/views/tabs/tab_close_button.cc ++++ b/chrome/browser/ui/views/tabs/tab_close_button.cc +@@ -18,7 +18,6 @@ + #include "ui/base/l10n/l10n_util.h" + #include "ui/base/metadata/metadata_impl_macros.h" + #include "ui/base/pointer/touch_ui_controller.h" +-#include "ui/compositor/layer.h" + #include "ui/gfx/canvas.h" + #include "ui/gfx/color_utils.h" + #include "ui/gfx/geometry/insets.h" +@@ -63,8 +62,6 @@ TabCloseButton::TabCloseButton(PressedCallback pressed_callback, + views::InkDrop::Get(this)->GetInkDrop()->SetHoverHighlightFadeDuration( + base::TimeDelta()); + +- image_container_view()->DestroyLayer(); +- + // The ink drop highlight path is the same as the focus ring highlight path, + // but needs to be explicitly mirrored for RTL. + // TODO(http://crbug.com/1056490): Make ink drops in RTL work the same way as +@@ -145,20 +142,6 @@ void TabCloseButton::OnGestureEvent(ui::GestureEvent* event) { + event->SetHandled(); + } + +-void TabCloseButton::AddLayerToRegion(ui::Layer* new_layer, +- views::LayerRegion region) { +- image_container_view()->SetPaintToLayer(); +- image_container_view()->layer()->SetFillsBoundsOpaquely(false); +- ink_drop_container()->SetVisible(true); +- ink_drop_container()->AddLayerToRegion(new_layer, region); +-} +- +-void TabCloseButton::RemoveLayerFromRegions(ui::Layer* old_layer) { +- ink_drop_container()->RemoveLayerFromRegions(old_layer); +- ink_drop_container()->SetVisible(false); +- image_container_view()->DestroyLayer(); +-} +- + gfx::Size TabCloseButton::CalculatePreferredSize( + const views::SizeBounds& available_size) const { + return kButtonSize; +diff --git a/chrome/browser/ui/views/tabs/tab_close_button.h b/chrome/browser/ui/views/tabs/tab_close_button.h +index f23bf862d987d8d6ba59aef781c51034e9a3debe..f688214ef883994d09b7a428b8af9b7f14c93af9 100644 +--- a/chrome/browser/ui/views/tabs/tab_close_button.h ++++ b/chrome/browser/ui/views/tabs/tab_close_button.h +@@ -46,9 +46,6 @@ class TabCloseButton : public views::LabelButton, + void OnMouseReleased(const ui::MouseEvent& event) override; + void OnMouseMoved(const ui::MouseEvent& event) override; + void OnGestureEvent(ui::GestureEvent* event) override; +- void AddLayerToRegion(ui::Layer* new_layer, +- views::LayerRegion region) override; +- void RemoveLayerFromRegions(ui::Layer* old_layer) override; + + protected: + // Set/reset the image models for the icon with new colors. +diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc +index 9dc31a69ab252c2f71061b01aad878930bb6e4d5..116ba2220f0148c9799948e170fe51e5c235008d 100644 +--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc ++++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc +@@ -124,6 +124,13 @@ ToolbarButton::ToolbarButton(PressedCallback callback, + + SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); + views::FocusRing::Get(this)->SetOutsetFocusRingDisabled(true); ++ ++#if BUILDFLAG(IS_WIN) ++ // Paint image(s) to a layer so that the canvas is snapped to pixel ++ // boundaries. ++ image_container_view()->SetPaintToLayer(); ++ image_container_view()->layer()->SetFillsBoundsOpaquely(false); ++#endif + } + + ToolbarButton::~ToolbarButton() = default; +@@ -753,6 +760,24 @@ ToolbarButton::GetActionViewInterface() { + return std::make_unique<ToolbarButtonActionViewInterface>(this); + } + ++void ToolbarButton::AddLayerToRegion(ui::Layer* new_layer, ++ views::LayerRegion region) { ++#if !BUILDFLAG(IS_WIN) ++ image_container_view()->SetPaintToLayer(); ++ image_container_view()->layer()->SetFillsBoundsOpaquely(false); ++#endif ++ ink_drop_container()->SetVisible(true); ++ ink_drop_container()->AddLayerToRegion(new_layer, region); ++} ++ ++void ToolbarButton::RemoveLayerFromRegions(ui::Layer* old_layer) { ++ ink_drop_container()->RemoveLayerFromRegions(old_layer); ++ ink_drop_container()->SetVisible(false); ++#if !BUILDFLAG(IS_WIN) ++ image_container_view()->DestroyLayer(); ++#endif ++} ++ + ToolbarButtonActionViewInterface::ToolbarButtonActionViewInterface( + ToolbarButton* action_view) + : views::LabelButtonActionViewInterface(action_view), +diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.h b/chrome/browser/ui/views/toolbar/toolbar_button.h +index a6957be675eadd39707c0586ce79f7909cfbd675..4d9d985fe0a989555105b487a43669bbf025eb19 100644 +--- a/chrome/browser/ui/views/toolbar/toolbar_button.h ++++ b/chrome/browser/ui/views/toolbar/toolbar_button.h +@@ -131,6 +131,9 @@ class ToolbarButton : public views::LabelButton, + void OnMouseExited(const ui::MouseEvent& event) override; + void OnGestureEvent(ui::GestureEvent* event) override; + std::unique_ptr<views::ActionViewInterface> GetActionViewInterface() override; ++ void AddLayerToRegion(ui::Layer* new_layer, ++ views::LayerRegion region) override; ++ void RemoveLayerFromRegions(ui::Layer* old_layer) override; + + // When IPH is showing we suppress the tooltip text. This means that we must + // provide an alternative accessible name, when this is the case. This is +diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc +index 10256f53f4f158150daa2fda406dceea9d171f07..74e63d3d0d35d3b72228f262b3557ed9b7ce5b95 100644 +--- a/ui/views/controls/button/label_button.cc ++++ b/ui/views/controls/button/label_button.cc +@@ -79,13 +79,6 @@ LabelButton::LabelButton( + SetTextInternal(text); + SetLayoutManager(std::make_unique<DelegatingLayoutManager>(this)); + GetViewAccessibility().SetIsDefault(is_default_); +- +-#if BUILDFLAG(IS_WIN) +- // Paint image(s) to a layer so that the canvas is snapped to pixel +- // boundaries. +- image_container_view()->SetPaintToLayer(); +- image_container_view()->layer()->SetFillsBoundsOpaquely(false); +-#endif + } + + LabelButton::~LabelButton() { +@@ -540,10 +533,8 @@ void LabelButton::UpdateImage() { + + void LabelButton::AddLayerToRegion(ui::Layer* new_layer, + views::LayerRegion region) { +-#if !BUILDFLAG(IS_WIN) + image_container_view()->SetPaintToLayer(); + image_container_view()->layer()->SetFillsBoundsOpaquely(false); +-#endif + ink_drop_container()->SetVisible(true); + ink_drop_container()->AddLayerToRegion(new_layer, region); + } +@@ -551,9 +542,7 @@ void LabelButton::AddLayerToRegion(ui::Layer* new_layer, + void LabelButton::RemoveLayerFromRegions(ui::Layer* old_layer) { + ink_drop_container()->RemoveLayerFromRegions(old_layer); + ink_drop_container()->SetVisible(false); +-#if !BUILDFLAG(IS_WIN) + image_container_view()->DestroyLayer(); +-#endif + } + + std::unique_ptr<ActionViewInterface> LabelButton::GetActionViewInterface() {
fix
512e56baf75bce86aef11184af881cff67d8e6a2
Shelley Vohr
2023-03-06 17:00:24
feat: expose `audio-state-changed` on `webContents` (#37366) feat: expose audio-state-changed on webContents
diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 6fba7b988e..fc6edfedd4 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -635,6 +635,15 @@ Emitted when media starts playing. Emitted when media is paused or done playing. +#### Event: 'audio-state-changed' + +Returns: + +* `event` Event<> + * `audible` boolean - True if one or more frames or child `webContents` are emitting audio. + +Emitted when media becomes audible or inaudible. + #### Event: 'did-change-theme-color' Returns: diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index cf5067feb5..111879fd7c 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -1507,7 +1507,14 @@ content::JavaScriptDialogManager* WebContents::GetJavaScriptDialogManager( } void WebContents::OnAudioStateChanged(bool audible) { - Emit("-audio-state-changed", audible); + v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); + v8::HandleScope handle_scope(isolate); + gin::Handle<gin_helper::internal::Event> event = + gin_helper::internal::Event::New(isolate); + v8::Local<v8::Object> event_object = event.ToV8().As<v8::Object>(); + gin::Dictionary dict(isolate, event_object); + dict.Set("audible", audible); + EmitWithoutEvent("audio-state-changed", event); } void WebContents::BeforeUnloadFired(bool proceed, diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index 650c8c1e45..cabb706c9f 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -565,11 +565,11 @@ describe('webContents module', () => { oscillator.connect(context.destination) oscillator.start() `); - let p = once(w.webContents, '-audio-state-changed'); + let p = once(w.webContents, 'audio-state-changed'); w.webContents.executeJavaScript('context.resume()'); await p; expect(w.webContents.isCurrentlyAudible()).to.be.true(); - p = once(w.webContents, '-audio-state-changed'); + p = once(w.webContents, 'audio-state-changed'); w.webContents.executeJavaScript('oscillator.stop()'); await p; expect(w.webContents.isCurrentlyAudible()).to.be.false();
feat
5b7ed6097e6ed3f20ffeed875674fd5c98c451ce
Charles Kerr
2024-07-19 11:49:58
chore: remove unused typedef CreateDownloadPathCallback (#42949) chore: remove unused typedef ElectronDownloadManagerDelegate::CreateDownloadPathCallback use was removed in e3c580e9
diff --git a/shell/browser/electron_download_manager_delegate.h b/shell/browser/electron_download_manager_delegate.h index ea155fb90f..f3d7008769 100644 --- a/shell/browser/electron_download_manager_delegate.h +++ b/shell/browser/electron_download_manager_delegate.h @@ -20,9 +20,6 @@ namespace electron { class ElectronDownloadManagerDelegate : public content::DownloadManagerDelegate { public: - using CreateDownloadPathCallback = - base::RepeatingCallback<void(const base::FilePath&)>; - explicit ElectronDownloadManagerDelegate(content::DownloadManager* manager); ~ElectronDownloadManagerDelegate() override;
chore
fa3379a5d5cd6494c126be4d4d21a36c75f46554
Shelley Vohr
2023-04-13 15:54:41
chore: fix lint (#37971)
diff --git a/shell/browser/web_contents_preferences.cc b/shell/browser/web_contents_preferences.cc index b0e290bb79..0d1e69bd69 100644 --- a/shell/browser/web_contents_preferences.cc +++ b/shell/browser/web_contents_preferences.cc @@ -432,14 +432,16 @@ void WebContentsPreferences::OverrideWebkitPrefs( iter->second; if (auto iter = default_font_family_.find("serif"); iter != default_font_family_.end()) - prefs->serif_font_family_map[blink::web_pref::kCommonScript] = iter->second; + prefs->serif_font_family_map[blink::web_pref::kCommonScript] = + iter->second; if (auto iter = default_font_family_.find("sansSerif"); iter != default_font_family_.end()) prefs->sans_serif_font_family_map[blink::web_pref::kCommonScript] = iter->second; if (auto iter = default_font_family_.find("monospace"); iter != default_font_family_.end()) - prefs->fixed_font_family_map[blink::web_pref::kCommonScript] = iter->second; + prefs->fixed_font_family_map[blink::web_pref::kCommonScript] = + iter->second; if (auto iter = default_font_family_.find("cursive"); iter != default_font_family_.end()) prefs->cursive_font_family_map[blink::web_pref::kCommonScript] =
chore
c1c8fbfd9ab6e8fadeb250e866d675b46a66b5b8
Samuel Attard
2024-09-17 01:38:56
build: make is_mas_build a generated header instead of config (#43737)
diff --git a/BUILD.gn b/BUILD.gn index 30eb55b087..83d1cee62f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -532,7 +532,7 @@ source_set("electron_lib") { ] } - configs += [ "//electron/build/config:mas_build" ] + deps += [ "//electron/build/config:generate_mas_config" ] sources = filenames.lib_sources if (is_win) { @@ -906,12 +906,14 @@ if (is_mac) { assert(defined(invoker.helper_name_suffix)) output_name = electron_helper_name + invoker.helper_name_suffix - deps = [ ":electron_framework+link" ] + deps = [ + ":electron_framework+link", + "//electron/build/config:generate_mas_config", + ] if (!is_mas_build) { deps += [ "//sandbox/mac:seatbelt" ] } defines = [ "HELPER_EXECUTABLE" ] - configs += [ "//electron/build/config:mas_build" ] sources = [ "shell/app/electron_main_mac.cc", "shell/app/uv_stdio_fix.cc", @@ -1067,6 +1069,7 @@ if (is_mac) { ":electron_app_plist", ":electron_app_resources", ":electron_fuses", + "//electron/build/config:generate_mas_config", "//electron/buildflags", ] if (is_mas_build) { @@ -1081,7 +1084,6 @@ if (is_mac) { "-rpath", "@executable_path/../Frameworks", ] - configs += [ "//electron/build/config:mas_build" ] } if (enable_dsyms) { diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index ca48bd859b..a82a0d7e31 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -1,8 +1,11 @@ -# For MAS build, we force defining "MAS_BUILD". -config("mas_build") { +action("generate_mas_config") { + outputs = [ "$target_gen_dir/../../mas.h" ] + script = "../../script/generate-mas-config.py" if (is_mas_build) { - defines = [ "IS_MAS_BUILD()=1" ] + args = [ "true" ] } else { - defines = [ "IS_MAS_BUILD()=0" ] + args = [ "false" ] } + + args += rebase_path(outputs) } diff --git a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch index 0555dfab1d..e85c786145 100644 --- a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch +++ b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch @@ -33,10 +33,10 @@ index 78923a81c64fb7738f4e457e3166a88f3c150564..ee348433544550f99622b52252fd1064 "//base", "//build:branding_buildflags", diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 7a23e63b800f87b6189ca04ce33c2c9b971e1152..50c51fad27925adf4a1e5fc9e03f7bca2153daa5 100644 +index 42f5441b7e78d0359727b3ca7702c80b9f6eeff8..2f154bbfde483f0cdeb336b631d238b8677b8486 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -4482,7 +4482,7 @@ static_library("browser") { +@@ -4480,7 +4480,7 @@ static_library("browser") { ] } @@ -46,10 +46,10 @@ index 7a23e63b800f87b6189ca04ce33c2c9b971e1152..50c51fad27925adf4a1e5fc9e03f7bca # than here in :chrome_dll. deps += [ "//chrome:packed_resources_integrity_header" ] diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index 633854df22c94cb2b7e02c1eda2663ca8091e11e..79ed45cf2b14ac3f504317305f4ae10e5413ff63 100644 +index de4a98c1bdb0c0e8a4a4051496fe4bb8c246e106..7a4594882a30f4d83b791d97a0f72842888197dc 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -7050,9 +7050,12 @@ test("unit_tests") { +@@ -7054,9 +7054,12 @@ test("unit_tests") { "//chrome/notification_helper", ] @@ -63,7 +63,7 @@ index 633854df22c94cb2b7e02c1eda2663ca8091e11e..79ed45cf2b14ac3f504317305f4ae10e "//chrome//services/util_win:unit_tests", "//chrome/app:chrome_dll_resources", "//chrome/app:win_unit_tests", -@@ -8079,6 +8082,10 @@ test("unit_tests") { +@@ -8083,6 +8086,10 @@ test("unit_tests") { "../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc", ] @@ -74,7 +74,7 @@ index 633854df22c94cb2b7e02c1eda2663ca8091e11e..79ed45cf2b14ac3f504317305f4ae10e sources += [ # The importer code is not used on Android. "../common/importer/firefox_importer_utils_unittest.cc", -@@ -8146,7 +8153,6 @@ test("unit_tests") { +@@ -8150,7 +8157,6 @@ test("unit_tests") { # Non-android deps for "unit_tests" target. deps += [ "../browser/screen_ai:screen_ai_install_state", diff --git a/patches/chromium/disable_compositor_recycling.patch b/patches/chromium/disable_compositor_recycling.patch index de1de4a4b3..c753ad0e90 100644 --- a/patches/chromium/disable_compositor_recycling.patch +++ b/patches/chromium/disable_compositor_recycling.patch @@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron. diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index 6a595dfebeeb53706b60429bc904095a2ab4cba9..dfed708b59a3b5f8e898e428b98adbc76f55fdf8 100644 +index 962dd6c34974a9377ca5a87425b1b801ba0a3f4d..550d59edbad2c0bb2b8f9c783433f138ffbe8c15 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -558,7 +558,11 @@ +@@ -559,7 +559,11 @@ return; host()->WasHidden(); diff --git a/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch b/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch index 4a6d30939c..3e4aa99a4d 100644 --- a/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch +++ b/patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch @@ -199,7 +199,7 @@ index 58985ce62dc569256bad5e94de9c0d125fc470d0..33436784b691c860d58f8b4dfcc6718e &SelectFileDialogLinuxKde::OnSelectSingleFolderDialogResponse, this, parent)); diff --git a/ui/shell_dialogs/select_file_dialog_linux_portal.cc b/ui/shell_dialogs/select_file_dialog_linux_portal.cc -index 61ddcbf7bf57e423099c7d392a19b3ec79b5d03f..b2d2e11f72dcca5b3791a6dd3e9e5ae930a1f701 100644 +index 61ddcbf7bf57e423099c7d392a19b3ec79b5d03f..920d0610943091f850e44e3e0481abd7fe08f881 100644 --- a/ui/shell_dialogs/select_file_dialog_linux_portal.cc +++ b/ui/shell_dialogs/select_file_dialog_linux_portal.cc @@ -44,7 +44,9 @@ constexpr char kMethodStartServiceByName[] = "StartServiceByName"; diff --git a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch index 2a2a891861..67e57fff40 100644 --- a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch +++ b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch @@ -90,7 +90,7 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217 private: const HWND hwnd_; diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn -index f907a3eea3843ccad7b15ca34137f42dbe57baa1..f3f0812be22067a06fc0afc3e52ffc252cd33f86 100644 +index 239fdc5a9ffef56f3b2c6667b1324c9f0a75c58e..dc3bf4440470da55193897aee6b431a475cffc84 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn @@ -172,6 +172,8 @@ viz_component("service") { diff --git a/patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch b/patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch index 00e3fb94f1..80e6ecad0e 100644 --- a/patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch +++ b/patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch @@ -12,10 +12,10 @@ We attempt to migrate the safe storage key from the old account, if that migrati Existing apps that aren't built for the app store should be unimpacted, there is one edge case where a user uses BOTH an AppStore and a darwin build of the same app only one will keep it's access to the safestorage key as during the migration we delete the old account. This is an acceptable edge case as no one should be actively using two versions of the same app. diff --git a/components/os_crypt/sync/keychain_password_mac.mm b/components/os_crypt/sync/keychain_password_mac.mm -index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be0985d7f334 100644 +index bb1fc0c99164ae4bdaaaa78e87c30e88932a928c..82d235709b79b1b3689b28ec8bfa02663ba219d6 100644 --- a/components/os_crypt/sync/keychain_password_mac.mm +++ b/components/os_crypt/sync/keychain_password_mac.mm -@@ -22,6 +22,12 @@ +@@ -23,6 +23,12 @@ using KeychainNameContainerType = const base::NoDestructor<std::string>; #endif @@ -28,7 +28,7 @@ index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be09 namespace { // These two strings ARE indeed user facing. But they are used to access -@@ -81,11 +87,18 @@ +@@ -82,11 +88,18 @@ std::string KeychainPassword::GetPassword() const { UInt32 password_length = 0; void* password_data = nullptr; @@ -49,7 +49,7 @@ index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be09 if (error == noErr) { std::string password = std::string(static_cast<char*>(password_data), password_length); -@@ -93,6 +106,49 @@ +@@ -94,6 +107,49 @@ return password; } diff --git a/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch b/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch index f4165d8355..01f86ddefb 100644 --- a/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch +++ b/patches/chromium/mas_avoid_private_macos_api_usage.patch.patch @@ -35,22 +35,30 @@ system font by checking if it's kCTFontPriorityAttribute is set to system priority. diff --git a/base/BUILD.gn b/base/BUILD.gn -index d3ba541d8d31bdb7bb2d3453ed5c85a7aab0e433..fbddb16dc4228e5baee3c94f88743c64113e14cb 100644 +index d3ba541d8d31bdb7bb2d3453ed5c85a7aab0e433..e87914504f1cc00e160b6bd7f3801ea159250263 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -1046,6 +1046,7 @@ component("base") { - "//build/config/compiler:prevent_unsafe_narrowing", - "//build/config/compiler:wexit_time_destructors", - "//build/config/compiler:wglobal_constructors", -+ "//electron/build/config:mas_build", +@@ -1058,6 +1058,7 @@ component("base") { + "//build:ios_buildflags", + "//build/config/compiler:compiler_buildflags", + "//third_party/modp_b64", ++ "//electron/build/config:generate_mas_config", ] - - deps = [ + if (!is_nacl) { + # Used by metrics/crc32, except on NaCl builds. diff --git a/base/enterprise_util_mac.mm b/base/enterprise_util_mac.mm -index 4bf9a3c27e05c6635b2beb8e880b5b43dbed61b5..57d4756c0d87b9313e8566b3083c0132966fcd78 100644 +index 4bf9a3c27e05c6635b2beb8e880b5b43dbed61b5..f328fbb49c45991f44a9c75325491d0873746b61 100644 --- a/base/enterprise_util_mac.mm +++ b/base/enterprise_util_mac.mm -@@ -116,6 +116,14 @@ DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain() { +@@ -16,6 +16,7 @@ + #include "base/strings/string_split.h" + #include "base/strings/string_util.h" + #include "base/strings/sys_string_conversions.h" ++#include "electron/mas.h" + + namespace base { + +@@ -116,6 +117,14 @@ DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain() { DeviceUserDomainJoinState state{.device_joined = false, .user_joined = false}; @@ -65,7 +73,7 @@ index 4bf9a3c27e05c6635b2beb8e880b5b43dbed61b5..57d4756c0d87b9313e8566b3083c0132 @autoreleasepool { ODSession* session = [ODSession defaultSession]; if (session == nil) { -@@ -219,5 +227,6 @@ DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain() { +@@ -219,5 +228,6 @@ DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain() { return state; } @@ -73,13 +81,14 @@ index 4bf9a3c27e05c6635b2beb8e880b5b43dbed61b5..57d4756c0d87b9313e8566b3083c0132 } // namespace base diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc -index 87e06c32c70f7c9515c93196260bbd6c6268a59a..6d86d0ce1b3a072889797294b461051e8887f412 100644 +index 87e06c32c70f7c9515c93196260bbd6c6268a59a..8134f5e2de9b09bca200614e05cfb9661e917868 100644 --- a/base/process/launch_mac.cc +++ b/base/process/launch_mac.cc -@@ -21,13 +21,18 @@ +@@ -21,13 +21,19 @@ #include "base/threading/scoped_blocking_call.h" #include "base/threading/thread_restrictions.h" #include "base/trace_event/base_tracing.h" ++#include "electron/mas.h" +#if IS_MAS_BUILD() +#include <sys/syscall.h> +#endif @@ -95,7 +104,7 @@ index 87e06c32c70f7c9515c93196260bbd6c6268a59a..6d86d0ce1b3a072889797294b461051e int responsibility_spawnattrs_setdisclaim(posix_spawnattr_t attrs, int disclaim); -@@ -99,13 +104,27 @@ class PosixSpawnFileActions { +@@ -99,13 +105,27 @@ class PosixSpawnFileActions { #if !BUILDFLAG(IS_MAC) int ChangeCurrentThreadDirectory(const char* path) { @@ -123,7 +132,7 @@ index 87e06c32c70f7c9515c93196260bbd6c6268a59a..6d86d0ce1b3a072889797294b461051e } #endif -@@ -229,7 +248,7 @@ Process LaunchProcess(const std::vector<std::string>& argv, +@@ -229,7 +249,7 @@ Process LaunchProcess(const std::vector<std::string>& argv, file_actions.Inherit(STDERR_FILENO); } @@ -133,10 +142,16 @@ index 87e06c32c70f7c9515c93196260bbd6c6268a59a..6d86d0ce1b3a072889797294b461051e DPSXCHECK(responsibility_spawnattrs_setdisclaim(attr.get(), 1)); } diff --git a/base/process/process_info_mac.cc b/base/process/process_info_mac.cc -index 94a028be3c315edc0056408ab9ab41b6b001a1c1..0d830234edb5621f57e39f4a951d357a23f677c1 100644 +index 94a028be3c315edc0056408ab9ab41b6b001a1c1..abf9003bc71506d389ff77dc708c897113bba412 100644 --- a/base/process/process_info_mac.cc +++ b/base/process/process_info_mac.cc -@@ -8,15 +8,21 @@ +@@ -4,19 +4,27 @@ + + #include "base/process/process_info.h" + ++#include "electron/mas.h" ++ + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -159,34 +174,54 @@ index 94a028be3c315edc0056408ab9ab41b6b001a1c1..0d830234edb5621f57e39f4a951d357a } // namespace base diff --git a/components/os_crypt/sync/BUILD.gn b/components/os_crypt/sync/BUILD.gn -index 3b81e00e1535ec729a521b83fe2471985d177e5c..b3706a4a0f77f8e5fbae3df97153b9cbed7d01f0 100644 +index 3b81e00e1535ec729a521b83fe2471985d177e5c..094f52fd80bd91be4e705a457d12ea89271dc037 100644 --- a/components/os_crypt/sync/BUILD.gn +++ b/components/os_crypt/sync/BUILD.gn @@ -46,6 +46,7 @@ component("os_crypt") { "os_crypt_mac.mm", ] deps += [ "//crypto:mock_apple_keychain" ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } if (is_win) { +diff --git a/components/os_crypt/sync/keychain_password_mac.mm b/components/os_crypt/sync/keychain_password_mac.mm +index e7a65e97b51d93bff864889813317fb7c6ffc846..bb1fc0c99164ae4bdaaaa78e87c30e88932a928c 100644 +--- a/components/os_crypt/sync/keychain_password_mac.mm ++++ b/components/os_crypt/sync/keychain_password_mac.mm +@@ -13,6 +13,7 @@ + #include "base/rand_util.h" + #include "build/branding_buildflags.h" + #include "crypto/apple_keychain.h" ++#include "electron/mas.h" + + using crypto::AppleKeychain; + diff --git a/components/remote_cocoa/app_shim/BUILD.gn b/components/remote_cocoa/app_shim/BUILD.gn -index b7a2dede5c5e9a797d10627b7d804064bf13b3f4..d915dccc7dd53ef3eaaae3c50e04342be7c12b38 100644 +index b7a2dede5c5e9a797d10627b7d804064bf13b3f4..df0a36405396372aad2affe602e41b5923b80322 100644 --- a/components/remote_cocoa/app_shim/BUILD.gn +++ b/components/remote_cocoa/app_shim/BUILD.gn -@@ -16,6 +16,7 @@ component("app_shim") { - assert(is_mac) - - configs += [ ":app_shim_warnings" ] -+ configs += ["//electron/build/config:mas_build"] - sources = [ - "NSToolbar+Private.h", - "NSToolbar+Private.mm", +@@ -87,6 +87,7 @@ component("app_shim") { + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/strings:ui_strings_grit", ++ "//electron/build/config:generate_mas_config", + ] + frameworks = [ + "Cocoa.framework", diff --git a/components/remote_cocoa/app_shim/application_bridge.mm b/components/remote_cocoa/app_shim/application_bridge.mm -index e9f4e5131238b9fb5f1b4b3e90a0cb84a7fc15b4..2202d42e472da0d9bd672e1c12c5d50fc4763c66 100644 +index e9f4e5131238b9fb5f1b4b3e90a0cb84a7fc15b4..8b5f4cae3123ac5480ad73f0c873fca0d62f7c9f 100644 --- a/components/remote_cocoa/app_shim/application_bridge.mm +++ b/components/remote_cocoa/app_shim/application_bridge.mm -@@ -51,6 +51,7 @@ +@@ -12,6 +12,7 @@ + #include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h" + #include "components/remote_cocoa/app_shim/native_widget_ns_window_host_helper.h" + #include "components/system_media_controls/mac/remote_cocoa/system_media_controls_bridge.h" ++#include "electron/mas.h" + #include "mojo/public/cpp/bindings/associated_remote.h" + #include "mojo/public/cpp/bindings/self_owned_receiver.h" + #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" +@@ -51,6 +52,7 @@ // NativeWidgetNSWindowHostHelper: id GetNativeViewAccessible() override { @@ -194,7 +229,7 @@ index e9f4e5131238b9fb5f1b4b3e90a0cb84a7fc15b4..2202d42e472da0d9bd672e1c12c5d50f if (!remote_accessibility_element_) { base::ProcessId browser_pid = base::kNullProcessId; std::vector<uint8_t> element_token; -@@ -61,6 +62,9 @@ id GetNativeViewAccessible() override { +@@ -61,6 +63,9 @@ id GetNativeViewAccessible() override { ui::RemoteAccessibility::GetRemoteElementFromToken(element_token); } return remote_accessibility_element_; @@ -204,7 +239,7 @@ index e9f4e5131238b9fb5f1b4b3e90a0cb84a7fc15b4..2202d42e472da0d9bd672e1c12c5d50f } void DispatchKeyEvent(ui::KeyEvent* event) override { bool event_handled = false; -@@ -99,7 +103,9 @@ void GetWordAt(const gfx::Point& location_in_content, +@@ -99,7 +104,9 @@ void GetWordAt(const gfx::Point& location_in_content, mojo::AssociatedRemote<mojom::TextInputHost> text_input_host_remote_; std::unique_ptr<NativeWidgetNSWindowBridge> bridge_; @@ -215,18 +250,20 @@ index e9f4e5131238b9fb5f1b4b3e90a0cb84a7fc15b4..2202d42e472da0d9bd672e1c12c5d50f } // namespace diff --git a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm -index 53553a707a646012c50b0bd2d0ffd8d4dbd67e11..e9df78b2cf8ca8cb4cb8321769e9a56b96d368b6 100644 +index 53553a707a646012c50b0bd2d0ffd8d4dbd67e11..e306511e15fd2a522748c3f90c78aab8dde4238e 100644 --- a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm +++ b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm -@@ -9,6 +9,7 @@ +@@ -8,7 +8,9 @@ + #include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h" #include "components/remote_cocoa/common/native_widget_ns_window_host.mojom.h" ++#include "electron/mas.h" +#if !IS_MAS_BUILD() @interface NSWindow (PrivateBrowserNativeWidgetAPI) + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle; @end -@@ -65,10 +66,13 @@ - (BOOL)_shouldCenterTrafficLights { +@@ -65,10 +67,13 @@ - (BOOL)_shouldCenterTrafficLights { @end @@ -240,7 +277,7 @@ index 53553a707a646012c50b0bd2d0ffd8d4dbd67e11..e9df78b2cf8ca8cb4cb8321769e9a56b + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle { // - NSThemeFrame and its subclasses will be nil if it's missing at runtime. if ([BrowserWindowFrame class]) -@@ -115,6 +119,8 @@ - (BOOL)_usesCustomDrawing { +@@ -115,6 +120,8 @@ - (BOOL)_usesCustomDrawing { return NO; } @@ -250,19 +287,21 @@ index 53553a707a646012c50b0bd2d0ffd8d4dbd67e11..e9df78b2cf8ca8cb4cb8321769e9a56b // Keyboard -> Shortcuts -> Keyboard. Usually Ctrl+F5. The argument (|unknown|) // tends to just be nil. diff --git a/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm -index 3a815ebf505bd95fa7f6b61ba433d98fbfe20225..dbbebbdc1735bc14224dfcde0b7fe3a6fd9f9e40 100644 +index 3a815ebf505bd95fa7f6b61ba433d98fbfe20225..149de0175c2ec0e41e3ba40caad7019ca87386d6 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm +++ b/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm -@@ -4,6 +4,8 @@ +@@ -4,6 +4,10 @@ #import "components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.h" ++#include "electron/mas.h" ++ +#if !IS_MAS_BUILD() + @interface NSWindow (PrivateAPI) + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle; @end -@@ -18,8 +20,12 @@ - (CGFloat)_titlebarHeight { +@@ -18,8 +22,12 @@ - (CGFloat)_titlebarHeight { } @end @@ -275,7 +314,7 @@ index 3a815ebf505bd95fa7f6b61ba433d98fbfe20225..dbbebbdc1735bc14224dfcde0b7fe3a6 + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle { if ([NativeWidgetMacFramelessNSWindowFrame class]) { return [NativeWidgetMacFramelessNSWindowFrame class]; -@@ -27,4 +33,6 @@ + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle { +@@ -27,4 +35,6 @@ + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle { return [super frameViewClassForStyleMask:windowStyle]; } @@ -283,10 +322,18 @@ index 3a815ebf505bd95fa7f6b61ba433d98fbfe20225..dbbebbdc1735bc14224dfcde0b7fe3a6 + @end diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h -index 945b01f2132547fa0f6a97ee4895994c500d1410..c01b2fdecf9b54fa01e5be9f45eaa234fc42d06b 100644 +index 945b01f2132547fa0f6a97ee4895994c500d1410..864f93f7c4159abc63e1535195fbf9d112558b91 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h -@@ -17,6 +17,7 @@ class NativeWidgetNSWindowBridge; +@@ -9,6 +9,7 @@ + + #include "base/apple/foundation_util.h" + #include "components/remote_cocoa/app_shim/remote_cocoa_app_shim_export.h" ++#include "electron/mas.h" + #import "ui/base/cocoa/command_dispatcher.h" + + namespace remote_cocoa { +@@ -17,6 +18,7 @@ class NativeWidgetNSWindowBridge; @protocol WindowTouchBarDelegate; @@ -294,7 +341,7 @@ index 945b01f2132547fa0f6a97ee4895994c500d1410..c01b2fdecf9b54fa01e5be9f45eaa234 // Weak lets Chrome launch even if a future macOS doesn't have the below classes WEAK_IMPORT_ATTRIBUTE @interface NSNextStepFrame : NSView -@@ -33,6 +34,7 @@ REMOTE_COCOA_APP_SHIM_EXPORT +@@ -33,6 +35,7 @@ REMOTE_COCOA_APP_SHIM_EXPORT REMOTE_COCOA_APP_SHIM_EXPORT @interface NativeWidgetMacNSWindowTitledFrame : NSThemeFrame @end @@ -303,10 +350,18 @@ index 945b01f2132547fa0f6a97ee4895994c500d1410..c01b2fdecf9b54fa01e5be9f45eaa234 // The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that // can only be accomplished by overriding methods. diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -index 2aa2bd8d68c08359461254875f02fc37f8693058..6ba759f96ffff4d31509248bb7add0477eb833ed 100644 +index 2aa2bd8d68c08359461254875f02fc37f8693058..5d5584d22ead9730876fae2fc3971982ae7f61bb 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -@@ -111,14 +111,18 @@ void OrderChildWindow(NSWindow* child_window, +@@ -26,6 +26,7 @@ + #import "components/remote_cocoa/app_shim/views_nswindow_delegate.h" + #import "components/remote_cocoa/app_shim/window_touch_bar_delegate.h" + #include "components/remote_cocoa/common/native_widget_ns_window_host.mojom.h" ++#include "electron/mas.h" + #import "ui/base/cocoa/user_interface_item_command_handler.h" + #import "ui/base/cocoa/window_size_constants.h" + +@@ -111,14 +112,18 @@ void OrderChildWindow(NSWindow* child_window, } // namespace @@ -325,7 +380,7 @@ index 2aa2bd8d68c08359461254875f02fc37f8693058..6ba759f96ffff4d31509248bb7add047 - (BOOL)hasKeyAppearance; - (long long)_resizeDirectionForMouseLocation:(CGPoint)location; - (BOOL)_isConsideredOpenForPersistentState; -@@ -157,6 +161,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event { +@@ -157,6 +162,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event { } @end @@ -334,7 +389,7 @@ index 2aa2bd8d68c08359461254875f02fc37f8693058..6ba759f96ffff4d31509248bb7add047 @implementation NativeWidgetMacNSWindowTitledFrame - (void)mouseDown:(NSEvent*)event { if (self.window.isMovable) -@@ -184,6 +190,8 @@ - (BOOL)usesCustomDrawing { +@@ -184,6 +191,8 @@ - (BOOL)usesCustomDrawing { } @end @@ -343,7 +398,7 @@ index 2aa2bd8d68c08359461254875f02fc37f8693058..6ba759f96ffff4d31509248bb7add047 @implementation NativeWidgetMacNSWindow { @private CommandDispatcher* __strong _commandDispatcher; -@@ -374,6 +382,8 @@ - (NSAccessibilityRole)accessibilityRole { +@@ -374,6 +383,8 @@ - (NSAccessibilityRole)accessibilityRole { // NSWindow overrides. @@ -352,7 +407,7 @@ index 2aa2bd8d68c08359461254875f02fc37f8693058..6ba759f96ffff4d31509248bb7add047 + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { if (windowStyle & NSWindowStyleMaskTitled) { if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class]) -@@ -385,6 +395,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { +@@ -385,6 +396,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { return [super frameViewClassForStyleMask:windowStyle]; } @@ -362,10 +417,18 @@ index 2aa2bd8d68c08359461254875f02fc37f8693058..6ba759f96ffff4d31509248bb7add047 bool shouldShowWindowTitle = YES; if (_bridge) diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm -index f511bdc7fab3eb36b4a3590922c20212cf6aad34..d5f934512f3acd5a323f8838844a6bb7f3e64ace 100644 +index f511bdc7fab3eb36b4a3590922c20212cf6aad34..a71908016fb97423a13a927ff03da70630a5b06f 100644 --- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm +++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm -@@ -637,10 +637,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { +@@ -41,6 +41,7 @@ + #import "components/remote_cocoa/app_shim/views_nswindow_delegate.h" + #import "components/remote_cocoa/app_shim/window_move_loop.h" + #include "components/remote_cocoa/common/native_widget_ns_window_host.mojom.h" ++#include "electron/mas.h" + #include "mojo/public/cpp/bindings/self_owned_receiver.h" + #include "net/cert/x509_util_apple.h" + #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" +@@ -637,10 +638,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { // this should be treated as an error and caught early. CHECK(bridged_view_); @@ -379,14 +442,14 @@ index f511bdc7fab3eb36b4a3590922c20212cf6aad34..d5f934512f3acd5a323f8838844a6bb7 // Beware: This view was briefly removed (in favor of a bare CALayer) in // https://crrev.com/c/1236675. The ordering of unassociated layers relative diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn -index c72378fbfd823855b41e094e16e4e92d9fbaefcc..f907a3eea3843ccad7b15ca34137f42dbe57baa1 100644 +index c72378fbfd823855b41e094e16e4e92d9fbaefcc..239fdc5a9ffef56f3b2c6667b1324c9f0a75c58e 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn @@ -368,6 +368,7 @@ viz_component("service") { "frame_sinks/external_begin_frame_source_mac.h", ] } -+ configs = ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } if (is_android || use_ozone) { @@ -394,15 +457,23 @@ index c72378fbfd823855b41e094e16e4e92d9fbaefcc..f907a3eea3843ccad7b15ca34137f42d "display_embedder/software_output_device_mac_unittest.mm", ] frameworks = [ "IOSurface.framework" ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } if (is_win) { diff --git a/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm -index dbf334caa3a6d10017b69ad76802e389a011436b..0cdb0def975e457651771b43fd5432610481c7d0 100644 +index dbf334caa3a6d10017b69ad76802e389a011436b..da828823e8195cc9e497866363c9af93dcd4ec3f 100644 --- a/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm +++ b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm -@@ -63,7 +63,9 @@ explicit RenderWidgetHostNSViewBridgeOwner( +@@ -15,6 +15,7 @@ + #include "content/common/web_contents_ns_view_bridge.mojom.h" + #include "content/public/browser/remote_cocoa.h" + #include "content/public/browser/render_widget_host_view_mac_delegate.h" ++#include "electron/mas.h" + #include "mojo/public/cpp/bindings/associated_receiver.h" + #include "mojo/public/cpp/bindings/associated_remote.h" + #include "mojo/public/cpp/bindings/pending_associated_receiver.h" +@@ -63,7 +64,9 @@ explicit RenderWidgetHostNSViewBridgeOwner( const RenderWidgetHostNSViewBridgeOwner&) = delete; private: @@ -412,7 +483,7 @@ index dbf334caa3a6d10017b69ad76802e389a011436b..0cdb0def975e457651771b43fd543261 void OnMojoDisconnect() { delete this; } std::unique_ptr<blink::WebCoalescedInputEvent> TranslateEvent( -@@ -75,6 +77,7 @@ explicit RenderWidgetHostNSViewBridgeOwner( +@@ -75,6 +78,7 @@ explicit RenderWidgetHostNSViewBridgeOwner( } id GetAccessibilityElement() override { @@ -420,7 +491,7 @@ index dbf334caa3a6d10017b69ad76802e389a011436b..0cdb0def975e457651771b43fd543261 if (!remote_accessibility_element_) { base::ProcessId browser_pid = base::kNullProcessId; std::vector<uint8_t> element_token; -@@ -85,6 +88,9 @@ id GetAccessibilityElement() override { +@@ -85,6 +89,9 @@ id GetAccessibilityElement() override { ui::RemoteAccessibility::GetRemoteElementFromToken(element_token); } return remote_accessibility_element_; @@ -430,7 +501,7 @@ index dbf334caa3a6d10017b69ad76802e389a011436b..0cdb0def975e457651771b43fd543261 } // RenderWidgetHostNSViewHostHelper implementation. -@@ -103,8 +109,10 @@ id GetFocusedBrowserAccessibilityElement() override { +@@ -103,8 +110,10 @@ id GetFocusedBrowserAccessibilityElement() override { return [bridgedContentView accessibilityFocusedUIElement]; } void SetAccessibilityWindow(NSWindow* window) override { @@ -442,10 +513,18 @@ index dbf334caa3a6d10017b69ad76802e389a011436b..0cdb0def975e457651771b43fd543261 void ForwardKeyboardEvent(const input::NativeWebKeyboardEvent& key_event, diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -index 00493dc6c3f0229438b440a6fb2438ca668aba6b..6ce251058868529551cd6f008f840e06baa52bb7 100644 +index 00493dc6c3f0229438b440a6fb2438ca668aba6b..b07411a38c67ac0ecba1f8386ef2604878a6f3c3 100644 --- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -@@ -2062,15 +2062,21 @@ - (NSAccessibilityRole)accessibilityRole { +@@ -38,6 +38,7 @@ + #include "content/public/browser/browser_accessibility_state.h" + #import "content/public/browser/render_widget_host_view_mac_delegate.h" + #include "content/public/common/content_features.h" ++#include "electron/mas.h" + #include "skia/ext/skia_utils_mac.h" + #include "third_party/blink/public/common/features.h" + #include "third_party/blink/public/mojom/input/input_handler.mojom.h" +@@ -2062,15 +2063,21 @@ - (NSAccessibilityRole)accessibilityRole { // Since this implementation doesn't have to wait any IPC calls, this doesn't // make any key-typing jank. --hbono 7/23/09 // @@ -468,22 +547,27 @@ index 00493dc6c3f0229438b440a6fb2438ca668aba6b..6ce251058868529551cd6f008f840e06 return kAttributes; } diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 29dc84944dbf42dfdfdc43b8a49913cff374d919..3c3dfc789890eda3007c0723e6730e5fb88c4646 100644 +index 29dc84944dbf42dfdfdc43b8a49913cff374d919..149942fbbf832d470b6832a0d33699b3d5aeb558 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn -@@ -72,6 +72,7 @@ source_set("browser") { - "//content:content_implementation", - "//v8:external_startup_data", +@@ -319,6 +319,7 @@ source_set("browser") { + "//ui/strings:ax_strings", + "//ui/touch_selection", + "//v8:v8_version", ++ "//electron/build/config:generate_mas_config", ] -+ configs += ["//electron/build/config:mas_build"] - defines = [] - libs = [] - frameworks = [] + + public_deps = [ diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm -index cde2af9e67566aa010cf94b003f4c36ccd887879..88352a659a7aaac708c4e3b23ac888dd7e2abdd2 100644 +index cde2af9e67566aa010cf94b003f4c36ccd887879..6f9f4d16f92492c7e58a9db92f1a313f992c0b13 100644 --- a/content/browser/accessibility/browser_accessibility_manager_mac.mm +++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm -@@ -20,7 +20,9 @@ +@@ -16,11 +16,14 @@ + #import "content/browser/accessibility/browser_accessibility_cocoa.h" + #import "content/browser/accessibility/browser_accessibility_mac.h" + #include "content/browser/renderer_host/render_frame_host_impl.h" ++#include "electron/mas.h" + #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" #include "ui/accessibility/ax_role_properties.h" #include "ui/accessibility/platform/ax_platform_tree_manager_delegate.h" #include "ui/accessibility/platform/ax_private_webkit_constants_mac.h" @@ -493,7 +577,7 @@ index cde2af9e67566aa010cf94b003f4c36ccd887879..88352a659a7aaac708c4e3b23ac888dd namespace { -@@ -229,6 +231,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -229,6 +232,7 @@ void PostAnnouncementNotification(NSString* announcement, return; } @@ -501,7 +585,7 @@ index cde2af9e67566aa010cf94b003f4c36ccd887879..88352a659a7aaac708c4e3b23ac888dd BrowserAccessibilityManager* root_manager = GetManagerForRootFrame(); if (root_manager) { BrowserAccessibilityManagerMac* root_manager_mac = -@@ -251,6 +254,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -251,6 +255,7 @@ void PostAnnouncementNotification(NSString* announcement, return; } } @@ -509,7 +593,7 @@ index cde2af9e67566aa010cf94b003f4c36ccd887879..88352a659a7aaac708c4e3b23ac888dd // Use native VoiceOver support for live regions. BrowserAccessibilityCocoa* retained_node = native_node; -@@ -642,6 +646,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -642,6 +647,7 @@ void PostAnnouncementNotification(NSString* announcement, return window == [NSApp accessibilityFocusedWindow]; } @@ -517,7 +601,7 @@ index cde2af9e67566aa010cf94b003f4c36ccd887879..88352a659a7aaac708c4e3b23ac888dd // TODO(accessibility): We need a solution to the problem described below. // If the window is NSAccessibilityRemoteUIElement, there are some challenges: // 1. NSApp is the browser which spawned the PWA, and what it considers the -@@ -670,6 +675,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -670,6 +676,7 @@ void PostAnnouncementNotification(NSString* announcement, if ([window isKindOfClass:[NSAccessibilityRemoteUIElement class]]) { return true; } @@ -526,10 +610,18 @@ index cde2af9e67566aa010cf94b003f4c36ccd887879..88352a659a7aaac708c4e3b23ac888dd return false; } diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h -index 2285564db47ef15eb9a83affd1e481b5671c3940..bc18a276d3029c3b858cfcb378ae2e4255d4d83e 100644 +index 2285564db47ef15eb9a83affd1e481b5671c3940..cf5e79a5540d8208c34579d7e8b5a5715abb1beb 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h -@@ -53,7 +53,9 @@ class CursorManager; +@@ -23,6 +23,7 @@ + #include "content/browser/renderer_host/text_input_manager.h" + #include "content/common/content_export.h" + #include "content/common/render_widget_host_ns_view.mojom.h" ++#include "electron/mas.h" + #include "mojo/public/cpp/bindings/associated_receiver.h" + #include "mojo/public/cpp/bindings/associated_remote.h" + #include "third_party/blink/public/mojom/webshare/webshare.mojom.h" +@@ -53,7 +54,9 @@ class CursorManager; @protocol RenderWidgetHostViewMacDelegate; @@ -539,7 +631,7 @@ index 2285564db47ef15eb9a83affd1e481b5671c3940..bc18a276d3029c3b858cfcb378ae2e42 @class RenderWidgetHostViewCocoa; namespace content { -@@ -684,9 +686,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac +@@ -684,9 +687,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac // EnsureSurfaceSynchronizedForWebTest(). uint32_t latest_capture_sequence_number_ = 0u; @@ -552,10 +644,18 @@ index 2285564db47ef15eb9a83affd1e481b5671c3940..bc18a276d3029c3b858cfcb378ae2e42 // Used to force the NSApplication's focused accessibility element to be the // content::BrowserAccessibilityCocoa accessibility tree when the NSView for diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index dc71d54f9be1600e039b0d7361c7a31ee4e20cdb..6a595dfebeeb53706b60429bc904095a2ab4cba9 100644 +index dc71d54f9be1600e039b0d7361c7a31ee4e20cdb..962dd6c34974a9377ca5a87425b1b801ba0a3f4d 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -273,8 +273,10 @@ +@@ -51,6 +51,7 @@ + #include "content/public/browser/render_widget_host.h" + #include "content/public/browser/web_contents.h" + #include "content/public/common/page_visibility_state.h" ++#include "electron/mas.h" + #include "media/base/media_switches.h" + #include "skia/ext/platform_canvas.h" + #include "skia/ext/skia_utils_mac.h" +@@ -273,8 +274,10 @@ void RenderWidgetHostViewMac::MigrateNSViewBridge( remote_cocoa::mojom::Application* remote_cocoa_application, uint64_t parent_ns_view_id) { @@ -566,7 +666,7 @@ index dc71d54f9be1600e039b0d7361c7a31ee4e20cdb..6a595dfebeeb53706b60429bc904095a // Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling // pointers. `ns_view_` gets reinitialized later in this method. -@@ -1637,8 +1639,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1637,8 +1640,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, gfx::NativeViewAccessible RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() { @@ -577,7 +677,7 @@ index dc71d54f9be1600e039b0d7361c7a31ee4e20cdb..6a595dfebeeb53706b60429bc904095a return [GetInProcessNSView() window]; } -@@ -1687,9 +1691,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1687,9 +1692,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, } void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) { @@ -589,7 +689,7 @@ index dc71d54f9be1600e039b0d7361c7a31ee4e20cdb..6a595dfebeeb53706b60429bc904095a } bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame( -@@ -2213,20 +2219,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -2213,20 +2220,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, void RenderWidgetHostViewMac::GetRenderWidgetAccessibilityToken( GetRenderWidgetAccessibilityTokenCallback callback) { base::ProcessId pid = getpid(); @@ -617,34 +717,38 @@ index dc71d54f9be1600e039b0d7361c7a31ee4e20cdb..6a595dfebeeb53706b60429bc904095a /////////////////////////////////////////////////////////////////////////////// diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn -index 9f48c905f4abbb0f2e184299a915232cf6a0f6b0..f2d36e7b59533d7514a61a931341ef612f12b107 100644 +index 9f48c905f4abbb0f2e184299a915232cf6a0f6b0..83e1af29e9b035e54b447941d55b95eb960219f1 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn -@@ -198,6 +198,7 @@ source_set("common") { - "//content:content_implementation", - "//build/config:precompiled_headers", +@@ -287,6 +287,7 @@ source_set("common") { + "//ui/shell_dialogs", + "//url", + "//url/ipc:url_ipc", ++ "//electron/build/config:generate_mas_config", ] -+ configs += ["//electron/build/config:mas_build"] - public_deps = [ - ":mojo_bindings", + defines = [] diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn -index 2ac766d0149f0405b3fcad0ec1b6e0685ed3658c..5554eb0e084becf8100579f1d15e4796345676ba 100644 +index 2ac766d0149f0405b3fcad0ec1b6e0685ed3658c..2fc827605b134a3bf24438b42405f70a819dbd9b 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn -@@ -230,6 +230,7 @@ target(link_target_type, "renderer") { - } - - configs += [ "//content:content_implementation" ] -+ configs += ["//electron/build/config:mas_build"] - defines = [] +@@ -336,6 +336,7 @@ target(link_target_type, "renderer") { + "//ui/surface", + "//url", + "//v8", ++ "//electron/build/config:generate_mas_config", + ] + allow_circular_includes_from = [] - public_deps = [ diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm -index d4db3b179725cb96bcbd0f73db7d52ef8b7522db..6afbf1defb0591d9fe59a81e6c74746d3e15f081 100644 +index d4db3b179725cb96bcbd0f73db7d52ef8b7522db..703b0f56a61abac51961bfd918b7349b943900de 100644 --- a/content/renderer/renderer_main_platform_delegate_mac.mm +++ b/content/renderer/renderer_main_platform_delegate_mac.mm -@@ -10,9 +10,11 @@ +@@ -7,12 +7,15 @@ + #import <Cocoa/Cocoa.h> + + #include "base/check_op.h" ++#include "electron/mas.h" #include "sandbox/mac/seatbelt.h" #include "sandbox/mac/system_services.h" @@ -656,7 +760,7 @@ index d4db3b179725cb96bcbd0f73db7d52ef8b7522db..6afbf1defb0591d9fe59a81e6c74746d namespace content { -@@ -22,6 +24,7 @@ +@@ -22,6 +25,7 @@ // verifies there are no existing open connections), and then indicates that // Chrome should continue execution without access to launchservicesd. void DisableSystemServices() { @@ -664,7 +768,7 @@ index d4db3b179725cb96bcbd0f73db7d52ef8b7522db..6afbf1defb0591d9fe59a81e6c74746d // Tell the WindowServer that we don't want to make any future connections. // This will return Success as long as there are no open connections, which // is what we want. -@@ -30,6 +33,7 @@ void DisableSystemServices() { +@@ -30,6 +34,7 @@ void DisableSystemServices() { sandbox::DisableLaunchServices(); sandbox::DisableCoreServicesCheckFix(); @@ -673,12 +777,14 @@ index d4db3b179725cb96bcbd0f73db7d52ef8b7522db..6afbf1defb0591d9fe59a81e6c74746d } // namespace diff --git a/content/renderer/theme_helper_mac.mm b/content/renderer/theme_helper_mac.mm -index a119b4439bfb9218c7aaf09dca8e78527da7f20d..faa813b003940280c6eeb87e70173019bdd5280c 100644 +index a119b4439bfb9218c7aaf09dca8e78527da7f20d..b184c58519f3b008901caf8ae516febc1242bd97 100644 --- a/content/renderer/theme_helper_mac.mm +++ b/content/renderer/theme_helper_mac.mm -@@ -8,10 +8,11 @@ +@@ -7,11 +7,13 @@ + #include <Cocoa/Cocoa.h> #include "base/strings/sys_string_conversions.h" ++#include "electron/mas.h" +#if !IS_MAS_BUILD() extern "C" { @@ -689,7 +795,7 @@ index a119b4439bfb9218c7aaf09dca8e78527da7f20d..faa813b003940280c6eeb87e70173019 namespace content { void SystemColorsDidChange(int aqua_color_variant) { -@@ -24,8 +25,18 @@ void SystemColorsDidChange(int aqua_color_variant) { +@@ -24,8 +26,18 @@ void SystemColorsDidChange(int aqua_color_variant) { } bool IsSubpixelAntialiasingAvailable() { @@ -709,79 +815,80 @@ index a119b4439bfb9218c7aaf09dca8e78527da7f20d..faa813b003940280c6eeb87e70173019 } // namespace content diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn -index 73c16e94f6e8e037f82cfb403e1d60f89be523ed..ae8a3ecc109027b9ab86f970e612360056eacd55 100644 +index 73c16e94f6e8e037f82cfb403e1d60f89be523ed..d7b77fc28cae1a1cecaa8d63ae6d295f7c13034f 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn -@@ -504,6 +504,7 @@ static_library("test_support") { - configs += [ - "//build/config:precompiled_headers", - "//v8:external_startup_data", -+ "//electron/build/config:mas_build", +@@ -638,6 +638,7 @@ static_library("test_support") { + "//url", + "//url/mojom:url_mojom_gurl", + "//v8", ++ "//electron/build/config:generate_mas_config" ] - public_deps = [ + data_deps = [ @@ -1107,6 +1108,7 @@ static_library("browsertest_support") { } configs += [ "//v8:external_startup_data" ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } mojom("content_test_mojo_bindings") { -@@ -1721,6 +1723,7 @@ test("content_browsertests") { - defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] - - configs += [ "//build/config:precompiled_headers" ] -+ configs += ["//electron/build/config:mas_build"] - - public_deps = [ - ":test_interfaces", -@@ -2990,6 +2993,7 @@ test("content_unittests") { - } - - configs += [ "//build/config:precompiled_headers" ] -+ configs += ["//electron/build/config:mas_build"] +@@ -1863,6 +1865,7 @@ test("content_browsertests") { + "//ui/shell_dialogs", + "//ui/snapshot", + "//ui/webui:test_support", ++ "//electron/build/config:generate_mas_config" + ] - public_deps = [ "//content:content_resources" ] + if (!(is_chromeos_ash && target_cpu == "arm64" && current_cpu == "arm")) { +@@ -3155,6 +3158,7 @@ test("content_unittests") { + "//ui/latency:test_support", + "//ui/shell_dialogs:shell_dialogs", + "//ui/webui:test_support", ++ "//electron/build/config:generate_mas_config" + ] + if (enable_nocompile_tests) { diff --git a/content/web_test/BUILD.gn b/content/web_test/BUILD.gn -index 99e612f705c5dff041454802033564085718260a..dd2935c6ca926138b9d72e524b7c13b495e5335f 100644 +index 99e612f705c5dff041454802033564085718260a..aa37555d9a9c0fda19d0096d035c245eca5ca0c6 100644 --- a/content/web_test/BUILD.gn +++ b/content/web_test/BUILD.gn -@@ -159,6 +159,8 @@ static_library("web_test_browser") { - ] - } +@@ -228,6 +228,7 @@ static_library("web_test_browser") { + "//ui/gl", + "//ui/shell_dialogs:shell_dialogs", + "//url", ++ "//electron/build/config:generate_mas_config" + ] -+ configs += ["//electron/build/config:mas_build"] -+ - if (is_mac) { - sources += [ "browser/web_test_shell_platform_delegate_mac.mm" ] - } else if (toolkit_views && !is_castos) { + # TODO(crbug.com/40139469): Blink test plugin must be migrated from PPAPI. diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn -index 82d4f2bf563f6bf489b1f257efb249ba4ec9a7f3..2959a166d0acf29d79b2c006e0d0f5ab50f90d8b 100644 +index 82d4f2bf563f6bf489b1f257efb249ba4ec9a7f3..7ae5132961a01175d0d28004e5fc2e9cfb924bdd 100644 --- a/device/bluetooth/BUILD.gn +++ b/device/bluetooth/BUILD.gn @@ -258,6 +258,7 @@ component("bluetooth") { "IOKit.framework", "Foundation.framework", ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } if (is_mac) { diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm -index fa86583a2d82c4076cfcf64cdc3f6bbb533b95d7..71b731e2e25ba876639d169c2242087dcf9ff389 100644 +index fa86583a2d82c4076cfcf64cdc3f6bbb533b95d7..3e4bda0bc31431cb2cc0893d246be6bb54cfab83 100644 --- a/device/bluetooth/bluetooth_adapter_mac.mm +++ b/device/bluetooth/bluetooth_adapter_mac.mm -@@ -39,6 +39,7 @@ +@@ -38,7 +38,9 @@ + #include "device/bluetooth/bluetooth_discovery_session_outcome.h" #include "device/bluetooth/bluetooth_socket_mac.h" #include "device/bluetooth/public/cpp/bluetooth_address.h" ++#include "electron/mas.h" +#if !IS_MAS_BUILD() extern "C" { // Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and // `Karabiner` [3] to programmatically control the Bluetooth state. Calling the -@@ -52,6 +53,7 @@ +@@ -52,6 +54,7 @@ // [4] https://support.apple.com/kb/PH25091 void IOBluetoothPreferenceSetControllerPowerState(int state); } @@ -789,7 +896,7 @@ index fa86583a2d82c4076cfcf64cdc3f6bbb533b95d7..71b731e2e25ba876639d169c2242087d // A simple helper class that forwards any Bluetooth device connect notification // to its wrapped |_adapter|. -@@ -161,8 +163,10 @@ bool IsDeviceSystemPaired(const std::string& device_address) { +@@ -161,8 +164,10 @@ bool IsDeviceSystemPaired(const std::string& device_address) { : controller_state_function_( base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState, base::Unretained(this))), @@ -800,7 +907,7 @@ index fa86583a2d82c4076cfcf64cdc3f6bbb533b95d7..71b731e2e25ba876639d169c2242087d device_paired_status_callback_( base::BindRepeating(&IsDeviceSystemPaired)) { } -@@ -313,8 +317,12 @@ bool IsDeviceSystemPaired(const std::string& device_address) { +@@ -313,8 +318,12 @@ bool IsDeviceSystemPaired(const std::string& device_address) { } bool BluetoothAdapterMac::SetPoweredImpl(bool powered) { @@ -814,22 +921,30 @@ index fa86583a2d82c4076cfcf64cdc3f6bbb533b95d7..71b731e2e25ba876639d169c2242087d base::WeakPtr<BluetoothLowEnergyAdapterApple> diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn -index a4f541e3f4095a0f537137ae371555adc80c0023..f93f0b5bf8c47efbc67039d50e3bcd29e099459c 100644 +index a4f541e3f4095a0f537137ae371555adc80c0023..e5d4b6a42e57cf9681b61a186c517eb8cb483e46 100644 --- a/gpu/ipc/service/BUILD.gn +++ b/gpu/ipc/service/BUILD.gn @@ -135,6 +135,7 @@ component("service") { "QuartzCore.framework", ] defines += [ "GL_SILENCE_DEPRECATION" ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } if (is_ios) { sources += [ "image_transport_surface_ios.mm" ] diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h -index 36322ddd3047f96569f35807541a37d3c6672b09..3162cb6e3dce2c44e5b1e5f33f9177da832d26aa 100644 +index 36322ddd3047f96569f35807541a37d3c6672b09..0121a780cf3b79fc1120c1b85cd5cd30c14968ef 100644 --- a/gpu/ipc/service/image_transport_surface_overlay_mac.h +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h -@@ -23,7 +23,9 @@ +@@ -8,6 +8,7 @@ + #include <vector> + + #include "base/memory/weak_ptr.h" ++#include "electron/mas.h" + #include "gpu/ipc/service/command_buffer_stub.h" + #include "gpu/ipc/service/image_transport_surface.h" + #include "ui/gfx/ca_layer_result.h" +@@ -23,7 +24,9 @@ #include "ui/display/types/display_constants.h" #endif @@ -840,22 +955,30 @@ index 36322ddd3047f96569f35807541a37d3c6672b09..3162cb6e3dce2c44e5b1e5f33f9177da namespace ui { diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn -index 6f3b368103b05f07ae67da4c0307efe039b8dfce..a1b11c298ee8b2c9b3cbe6307bc7744c242976b6 100644 +index 6f3b368103b05f07ae67da4c0307efe039b8dfce..c8b18509dc508fbb928b97830536d210b378bf73 100644 --- a/media/audio/BUILD.gn +++ b/media/audio/BUILD.gn @@ -197,6 +197,7 @@ source_set("audio") { "CoreMedia.framework", ] weak_frameworks = [ "ScreenCaptureKit.framework" ] # macOS 13.0 -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } if (is_ios) { diff --git a/media/audio/apple/audio_low_latency_input.cc b/media/audio/apple/audio_low_latency_input.cc -index 9b78f60304a0e487904fdb22c9e6d85a237ca96e..fc5508c41aa08dd7bf1365a7c03b68723aae3a4b 100644 +index 9b78f60304a0e487904fdb22c9e6d85a237ca96e..e639558d34edab3ba3b1bb4f502bd91405e58637 100644 --- a/media/audio/apple/audio_low_latency_input.cc +++ b/media/audio/apple/audio_low_latency_input.cc -@@ -39,19 +39,23 @@ +@@ -28,6 +28,7 @@ + #include "base/strings/sys_string_conversions.h" + #include "base/time/time.h" + #include "base/trace_event/trace_event.h" ++#include "electron/mas.h" + #include "media/audio/apple/audio_manager_apple.h" + #include "media/audio/apple/scoped_audio_unit.h" + #include "media/base/audio_bus.h" +@@ -39,19 +40,23 @@ namespace { extern "C" { @@ -880,7 +1003,7 @@ index 9b78f60304a0e487904fdb22c9e6d85a237ca96e..fc5508c41aa08dd7bf1365a7c03b6872 } // namespace #endif diff --git a/net/dns/BUILD.gn b/net/dns/BUILD.gn -index 5f4ff9ff8172d4ad282cc9c781f85118b8ba7d1a..6a542c8f0d7afad876ab2739a1a2576a64cb6be9 100644 +index 5f4ff9ff8172d4ad282cc9c781f85118b8ba7d1a..cc85f488884f48df94198b7e4d4823946e750716 100644 --- a/net/dns/BUILD.gn +++ b/net/dns/BUILD.gn @@ -187,6 +187,8 @@ source_set("dns") { @@ -888,15 +1011,23 @@ index 5f4ff9ff8172d4ad282cc9c781f85118b8ba7d1a..6a542c8f0d7afad876ab2739a1a2576a ":mdns_client", ] + -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } # The standard API of net/dns. diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc -index 70d5665ad7b9ef62370497636af919ede2508ad4..3f6816de14f4bd19422a2b04830649d1d12e9179 100644 +index 70d5665ad7b9ef62370497636af919ede2508ad4..f4dc3e2b8053cdb3e8c439ab1a1d6369a8e6a7dc 100644 --- a/net/dns/dns_config_service_posix.cc +++ b/net/dns/dns_config_service_posix.cc -@@ -135,8 +135,8 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher { +@@ -28,6 +28,7 @@ + #include "base/threading/scoped_blocking_call.h" + #include "base/time/time.h" + #include "build/build_config.h" ++#include "electron/mas.h" + #include "net/base/ip_endpoint.h" + #include "net/dns/dns_config.h" + #include "net/dns/dns_hosts.h" +@@ -135,8 +136,8 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher { bool Watch() override { CheckOnCorrectSequence(); @@ -906,7 +1037,7 @@ index 70d5665ad7b9ef62370497636af919ede2508ad4..3f6816de14f4bd19422a2b04830649d1 if (!config_watcher_.Watch(base::BindRepeating(&Watcher::OnConfigChanged, base::Unretained(this)))) { LOG(ERROR) << "DNS config watch failed to start."; -@@ -153,6 +153,7 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher { +@@ -153,6 +154,7 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher { success = false; } #endif // !BUILDFLAG(IS_IOS) @@ -915,14 +1046,14 @@ index 70d5665ad7b9ef62370497636af919ede2508ad4..3f6816de14f4bd19422a2b04830649d1 } diff --git a/sandbox/mac/BUILD.gn b/sandbox/mac/BUILD.gn -index 299a028f23314f479d2da8f914a5bdf34698d854..672dcb04dd3cf4e3cc71403f727a1dde91ad4402 100644 +index 299a028f23314f479d2da8f914a5bdf34698d854..67a56a3b4c8fc524f1ec8cfec856f24d30402134 100644 --- a/sandbox/mac/BUILD.gn +++ b/sandbox/mac/BUILD.gn @@ -39,6 +39,7 @@ component("seatbelt") { ] public_deps = [ "//third_party/protobuf:protobuf_lite" ] defines = [ "SEATBELT_IMPLEMENTATION" ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } component("seatbelt_extension") { @@ -930,7 +1061,7 @@ index 299a028f23314f479d2da8f914a5bdf34698d854..672dcb04dd3cf4e3cc71403f727a1dde libs = [ "sandbox" ] public_deps = [ "//base" ] defines = [ "SEATBELT_IMPLEMENTATION" ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } component("system_services") { @@ -938,15 +1069,23 @@ index 299a028f23314f479d2da8f914a5bdf34698d854..672dcb04dd3cf4e3cc71403f727a1dde deps = [ ":seatbelt_export" ] public_deps = [ "//base" ] defines = [ "SEATBELT_IMPLEMENTATION" ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } source_set("sandbox_unittests") { diff --git a/sandbox/mac/sandbox_compiler.cc b/sandbox/mac/sandbox_compiler.cc -index f35d9ef2a2df3db8ecbf1d7b909c7b1cf33f3cd9..a710b8b4f851666fd65bb37f69ec2fa70259697b 100644 +index f35d9ef2a2df3db8ecbf1d7b909c7b1cf33f3cd9..5d52330d1bd70cd7b97ee3360721f10c8447c717 100644 --- a/sandbox/mac/sandbox_compiler.cc +++ b/sandbox/mac/sandbox_compiler.cc -@@ -47,6 +47,7 @@ bool SandboxCompiler::SetParameter(const std::string& key, +@@ -7,6 +7,7 @@ + #include <string> + #include <vector> + ++#include "electron/mas.h" + #include "sandbox/mac/seatbelt.h" + + namespace sandbox { +@@ -47,6 +48,7 @@ bool SandboxCompiler::SetParameter(const std::string& key, } bool SandboxCompiler::CompileAndApplyProfile(std::string& error) { @@ -954,7 +1093,7 @@ index f35d9ef2a2df3db8ecbf1d7b909c7b1cf33f3cd9..a710b8b4f851666fd65bb37f69ec2fa7 if (mode_ == Target::kSource) { std::vector<const char*> params; -@@ -67,6 +68,9 @@ bool SandboxCompiler::CompileAndApplyProfile(std::string& error) { +@@ -67,6 +69,9 @@ bool SandboxCompiler::CompileAndApplyProfile(std::string& error) { } } return false; @@ -965,10 +1104,18 @@ index f35d9ef2a2df3db8ecbf1d7b909c7b1cf33f3cd9..a710b8b4f851666fd65bb37f69ec2fa7 bool SandboxCompiler::CompilePolicyToProto(mac::SandboxPolicy& policy, diff --git a/sandbox/mac/sandbox_logging.cc b/sandbox/mac/sandbox_logging.cc -index 095c639b9893e885d8937e29ed7d47a7c28bc6b6..cfa5e307de8326fbc335996feaf9595d1572cd3d 100644 +index 095c639b9893e885d8937e29ed7d47a7c28bc6b6..7e0cf9b9f94b16741358bdb45122f8b2bd68c0f9 100644 --- a/sandbox/mac/sandbox_logging.cc +++ b/sandbox/mac/sandbox_logging.cc -@@ -33,9 +33,11 @@ +@@ -16,6 +16,7 @@ + #include <string> + + #include "build/build_config.h" ++#include "electron/mas.h" + #include "sandbox/mac/sandbox_crash_message.h" + + #if defined(ARCH_CPU_X86_64) +@@ -33,9 +34,11 @@ } #endif @@ -980,7 +1127,7 @@ index 095c639b9893e885d8937e29ed7d47a7c28bc6b6..cfa5e307de8326fbc335996feaf9595d namespace sandbox::logging { -@@ -76,9 +78,11 @@ void SendOsLog(Level level, const char* message) { +@@ -76,9 +79,11 @@ void SendOsLog(Level level, const char* message) { sandbox::crash_message::SetCrashMessage(message); } @@ -993,10 +1140,17 @@ index 095c639b9893e885d8937e29ed7d47a7c28bc6b6..cfa5e307de8326fbc335996feaf9595d // |error| is strerror(errno) when a P* logging function is called. Pass diff --git a/sandbox/mac/seatbelt.cc b/sandbox/mac/seatbelt.cc -index 15c835e118456394c0a00ac98c11241c14ca75bd..83759e5fbc252fa57ca2fa122873dfac3d61d46d 100644 +index 15c835e118456394c0a00ac98c11241c14ca75bd..a16faabe2bd63a5e0fbe9082a3b4b7c8aa0ea064 100644 --- a/sandbox/mac/seatbelt.cc +++ b/sandbox/mac/seatbelt.cc -@@ -9,7 +9,7 @@ +@@ -4,12 +4,14 @@ + + #include "sandbox/mac/seatbelt.h" + ++#include "electron/mas.h" ++ + #include <errno.h> + #include <unistd.h> extern "C" { #include <sandbox.h> @@ -1005,7 +1159,7 @@ index 15c835e118456394c0a00ac98c11241c14ca75bd..83759e5fbc252fa57ca2fa122873dfac int sandbox_init_with_parameters(const char* profile, uint64_t flags, const char* const parameters[], -@@ -40,13 +40,13 @@ sandbox_profile_t* sandbox_compile_string(const char* data, +@@ -40,13 +42,13 @@ sandbox_profile_t* sandbox_compile_string(const char* data, char** error); int sandbox_apply(sandbox_profile_t*); void sandbox_free_profile(sandbox_profile_t*); @@ -1021,7 +1175,7 @@ index 15c835e118456394c0a00ac98c11241c14ca75bd..83759e5fbc252fa57ca2fa122873dfac bool HandleSandboxResult(int rv, char* errorbuf, std::string* error) { if (rv == 0) { if (error) -@@ -74,36 +74,48 @@ bool HandleSandboxErrno(int rv, const char* message, std::string* error) { +@@ -74,36 +76,48 @@ bool HandleSandboxErrno(int rv, const char* message, std::string* error) { } return false; } @@ -1071,7 +1225,7 @@ index 15c835e118456394c0a00ac98c11241c14ca75bd..83759e5fbc252fa57ca2fa122873dfac } // Initialize the static member variables. -@@ -114,6 +126,7 @@ const char* Seatbelt::kProfilePureComputation = kSBXProfilePureComputation; +@@ -114,6 +128,7 @@ const char* Seatbelt::kProfilePureComputation = kSBXProfilePureComputation; // static bool Seatbelt::Init(const char* profile, uint64_t flags, std::string* error) { @@ -1079,7 +1233,7 @@ index 15c835e118456394c0a00ac98c11241c14ca75bd..83759e5fbc252fa57ca2fa122873dfac // OS X deprecated these functions, but did not provide a suitable replacement, // so ignore the deprecation warning. #pragma clang diagnostic push -@@ -122,6 +135,9 @@ bool Seatbelt::Init(const char* profile, uint64_t flags, std::string* error) { +@@ -122,6 +137,9 @@ bool Seatbelt::Init(const char* profile, uint64_t flags, std::string* error) { int rv = ::sandbox_init(profile, flags, &errorbuf); return HandleSandboxResult(rv, errorbuf, error); #pragma clang diagnostic pop @@ -1089,7 +1243,7 @@ index 15c835e118456394c0a00ac98c11241c14ca75bd..83759e5fbc252fa57ca2fa122873dfac } // static -@@ -129,10 +145,14 @@ bool Seatbelt::InitWithParams(const char* profile, +@@ -129,10 +147,14 @@ bool Seatbelt::InitWithParams(const char* profile, uint64_t flags, const char* const parameters[], std::string* error) { @@ -1104,7 +1258,7 @@ index 15c835e118456394c0a00ac98c11241c14ca75bd..83759e5fbc252fa57ca2fa122873dfac } // static -@@ -140,6 +160,7 @@ bool Seatbelt::Compile(const char* profile, +@@ -140,6 +162,7 @@ bool Seatbelt::Compile(const char* profile, const Seatbelt::Parameters& params, std::string& compiled_profile, std::string* error) { @@ -1112,7 +1266,7 @@ index 15c835e118456394c0a00ac98c11241c14ca75bd..83759e5fbc252fa57ca2fa122873dfac char* errorbuf = nullptr; sandbox_profile_t* sandbox_profile = ::sandbox_compile_string(profile, params.params(), &errorbuf); -@@ -149,33 +170,44 @@ bool Seatbelt::Compile(const char* profile, +@@ -149,33 +172,44 @@ bool Seatbelt::Compile(const char* profile, compiled_profile.assign(reinterpret_cast<const char*>(sandbox_profile->data), sandbox_profile->size); ::sandbox_free_profile(sandbox_profile); @@ -1158,18 +1312,21 @@ index 15c835e118456394c0a00ac98c11241c14ca75bd..83759e5fbc252fa57ca2fa122873dfac } // namespace sandbox diff --git a/sandbox/mac/seatbelt_extension.cc b/sandbox/mac/seatbelt_extension.cc -index b3f017a8be25209a78ed6a1221abcdeeb7904752..506d520e41f321e02b227e07b7b41a4bbfec8d4d 100644 +index b3f017a8be25209a78ed6a1221abcdeeb7904752..64aacf0542cbb899b04a9f957b8d094e9c8669ff 100644 --- a/sandbox/mac/seatbelt_extension.cc +++ b/sandbox/mac/seatbelt_extension.cc -@@ -11,6 +11,7 @@ +@@ -9,8 +9,10 @@ + #include "base/check.h" + #include "base/memory/ptr_util.h" #include "base/notreached.h" ++#include "electron/mas.h" #include "sandbox/mac/seatbelt_extension_token.h" +#if !IS_MAS_BUILD() // libsandbox private API. extern "C" { extern const char* APP_SANDBOX_READ; -@@ -22,6 +23,7 @@ char* sandbox_extension_issue_file(const char* type, +@@ -22,6 +24,7 @@ char* sandbox_extension_issue_file(const char* type, const char* path, uint32_t flags); } @@ -1177,7 +1334,7 @@ index b3f017a8be25209a78ed6a1221abcdeeb7904752..506d520e41f321e02b227e07b7b41a4b namespace sandbox { -@@ -50,7 +52,11 @@ std::unique_ptr<SeatbeltExtension> SeatbeltExtension::FromToken( +@@ -50,7 +53,11 @@ std::unique_ptr<SeatbeltExtension> SeatbeltExtension::FromToken( bool SeatbeltExtension::Consume() { DCHECK(!token_.empty()); @@ -1189,7 +1346,7 @@ index b3f017a8be25209a78ed6a1221abcdeeb7904752..506d520e41f321e02b227e07b7b41a4b return handle_ > 0; } -@@ -62,7 +68,11 @@ bool SeatbeltExtension::ConsumePermanently() { +@@ -62,7 +69,11 @@ bool SeatbeltExtension::ConsumePermanently() { } bool SeatbeltExtension::Revoke() { @@ -1201,7 +1358,7 @@ index b3f017a8be25209a78ed6a1221abcdeeb7904752..506d520e41f321e02b227e07b7b41a4b handle_ = 0; token_.clear(); return rv == 0; -@@ -80,12 +90,14 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token) +@@ -80,12 +91,14 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token) char* SeatbeltExtension::IssueToken(SeatbeltExtension::Type type, const std::string& resource) { switch (type) { @@ -1217,18 +1374,20 @@ index b3f017a8be25209a78ed6a1221abcdeeb7904752..506d520e41f321e02b227e07b7b41a4b NOTREACHED_IN_MIGRATION(); return nullptr; diff --git a/sandbox/mac/system_services.cc b/sandbox/mac/system_services.cc -index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..dc30306f2c5d20503399fc3a8860773aa0044352 100644 +index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..9921ccb10d3455600eddd85f77f10228016389af 100644 --- a/sandbox/mac/system_services.cc +++ b/sandbox/mac/system_services.cc -@@ -9,6 +9,7 @@ +@@ -8,7 +8,9 @@ + #include <CoreFoundation/CoreFoundation.h> #include "base/apple/osstatus_logging.h" ++#include "electron/mas.h" +#if !IS_MAS_BUILD() extern "C" { OSStatus SetApplicationIsDaemon(Boolean isDaemon); void _LSSetApplicationLaunchServicesServerConnectionStatus( -@@ -19,10 +20,12 @@ void _LSSetApplicationLaunchServicesServerConnectionStatus( +@@ -19,10 +21,12 @@ void _LSSetApplicationLaunchServicesServerConnectionStatus( // https://github.com/WebKit/WebKit/blob/24aaedc770d192d03a07ba4a71727274aaa8fc07/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm#L840 void _CSCheckFixDisable(); } // extern "C" @@ -1241,7 +1400,7 @@ index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..dc30306f2c5d20503399fc3a8860773a // Allow the process to continue without a LaunchServices ASN. The // INIT_Process function in HIServices will abort if it cannot connect to // launchservicesd to get an ASN. By setting this flag, HIServices skips -@@ -36,10 +39,13 @@ void DisableLaunchServices() { +@@ -36,10 +40,13 @@ void DisableLaunchServices() { 0, ^bool(CFDictionaryRef options) { return false; }); @@ -1256,17 +1415,17 @@ index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..dc30306f2c5d20503399fc3a8860773a } // namespace sandbox diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn -index 9cb087c578629d872d2a2c12a046471527372c81..2b1aa7a79bcae619c3fe205a64fc1bdae4a4efff 100644 +index 9cb087c578629d872d2a2c12a046471527372c81..2e0c6812da545c4609cf20a15f71fc76bfcaffc0 100644 --- a/third_party/blink/renderer/core/BUILD.gn +++ b/third_party/blink/renderer/core/BUILD.gn -@@ -332,6 +332,7 @@ component("core") { - configs -= core_config_remove - configs += core_config_add - configs += [ "//v8:external_startup_data" ] -+ configs += ["//electron/build/config:mas_build"] +@@ -402,6 +402,7 @@ component("core") { + "//ui/gfx/geometry", + "//ui/gfx/geometry:geometry_skia", + "//ui/strings", ++ "//electron/build/config:generate_mas_config", + ] - public_deps = [ - ":buildflags", + if (is_mac) { diff --git a/third_party/blink/renderer/core/editing/build.gni b/third_party/blink/renderer/core/editing/build.gni index f12dd0a759fd8a79e648e14711274ccc40642a3d..63ae0ca4f63e68913c809b9440a922a95e914dcd 100644 --- a/third_party/blink/renderer/core/editing/build.gni @@ -1288,23 +1447,30 @@ index f12dd0a759fd8a79e648e14711274ccc40642a3d..63ae0ca4f63e68913c809b9440a922a9 blink_core_sources_editing += [ "kill_ring_none.cc" ] } diff --git a/ui/accelerated_widget_mac/BUILD.gn b/ui/accelerated_widget_mac/BUILD.gn -index 3ead42e14ad9d41a30c5637678a3ac49296ce2a6..8dec61ee6a62e54ec3c8c5dd5e08601c28d04dfe 100644 +index 3ead42e14ad9d41a30c5637678a3ac49296ce2a6..07665bbefd34737bf6a8c3e79d70b066920788c9 100644 --- a/ui/accelerated_widget_mac/BUILD.gn +++ b/ui/accelerated_widget_mac/BUILD.gn -@@ -33,6 +33,8 @@ component("accelerated_widget_mac") { - "QuartzCore.framework", +@@ -64,6 +64,7 @@ component("accelerated_widget_mac") { + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gl", ++ "//electron/build/config:generate_mas_config", ] + } -+ configs += ["//electron/build/config:mas_build"] -+ - if (is_ios) { - sources += [ "ca_layer_frame_sink_provider.h" ] - } diff --git a/ui/accelerated_widget_mac/ca_layer_tree_coordinator.h b/ui/accelerated_widget_mac/ca_layer_tree_coordinator.h -index b11c365f42dd1ddc363de0d94c387b13ac65bef3..c274340cac7aaf22321b9cd35a8fad2c6eeae5ce 100644 +index b11c365f42dd1ddc363de0d94c387b13ac65bef3..5da42beb20b514396287cc6dc5cba608e1660b2e 100644 --- a/ui/accelerated_widget_mac/ca_layer_tree_coordinator.h +++ b/ui/accelerated_widget_mac/ca_layer_tree_coordinator.h -@@ -14,7 +14,9 @@ +@@ -7,6 +7,7 @@ + + #include <queue> + ++#include "electron/mas.h" + #include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h" + #include "ui/accelerated_widget_mac/ca_renderer_layer_tree.h" + #include "ui/gfx/ca_layer_result.h" +@@ -14,7 +15,9 @@ #include "ui/gl/gl_surface.h" #include "ui/gl/presenter.h" @@ -1314,7 +1480,7 @@ index b11c365f42dd1ddc363de0d94c387b13ac65bef3..c274340cac7aaf22321b9cd35a8fad2c @class CALayer; namespace ui { -@@ -110,7 +112,9 @@ class ACCELERATED_WIDGET_MAC_EXPORT CALayerTreeCoordinator { +@@ -110,7 +113,9 @@ class ACCELERATED_WIDGET_MAC_EXPORT CALayerTreeCoordinator { // both the current tree and the pending trees. size_t presented_ca_layer_trees_max_length_ = 2; @@ -1325,10 +1491,18 @@ index b11c365f42dd1ddc363de0d94c387b13ac65bef3..c274340cac7aaf22321b9cd35a8fad2c // The root CALayer to display the current frame. This does not change // over the lifetime of the object. diff --git a/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm b/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm -index b99461d52e3a62b58330691e65f9956748cfbf02..09abf39af3e7115744778c7260a68f13a080b162 100644 +index b99461d52e3a62b58330691e65f9956748cfbf02..f0c3bb1b809a29eee3d990b0a8bbffddb7500895 100644 --- a/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm +++ b/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm -@@ -33,6 +33,7 @@ +@@ -10,6 +10,7 @@ + #include "base/mac/mac_util.h" + #include "base/task/single_thread_task_runner.h" + #include "base/trace_event/trace_event.h" ++#include "electron/mas.h" + #include "ui/base/cocoa/animation_utils.h" + #include "ui/base/cocoa/remote_layer_api.h" + #include "ui/gfx/ca_layer_params.h" +@@ -33,6 +34,7 @@ new_presentation_feedback_timestamps_( new_presentation_feedback_timestamps), buffer_presented_callback_(buffer_presented_callback) { @@ -1336,7 +1510,7 @@ index b99461d52e3a62b58330691e65f9956748cfbf02..09abf39af3e7115744778c7260a68f13 if (allow_remote_layers_) { root_ca_layer_ = [[CALayer alloc] init]; #if BUILDFLAG(IS_MAC) -@@ -61,6 +62,7 @@ +@@ -61,6 +63,7 @@ #endif ca_context_.layer = root_ca_layer_; } @@ -1344,7 +1518,7 @@ index b99461d52e3a62b58330691e65f9956748cfbf02..09abf39af3e7115744778c7260a68f13 } CALayerTreeCoordinator::~CALayerTreeCoordinator() = default; -@@ -164,9 +166,13 @@ +@@ -164,9 +167,13 @@ TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", TRACE_EVENT_SCOPE_THREAD, "GLImpl", static_cast<int>(gl::GetGLImplementation()), "width", pixel_size_.width()); @@ -1359,10 +1533,18 @@ index b99461d52e3a62b58330691e65f9956748cfbf02..09abf39af3e7115744778c7260a68f13 if (io_surface) { DCHECK(!allow_remote_layers_); diff --git a/ui/accelerated_widget_mac/display_ca_layer_tree.mm b/ui/accelerated_widget_mac/display_ca_layer_tree.mm -index dcf493d62990018040a3f84b6f875af737bd2214..6ffffe8b3946e0427aead8be19878c537c841294 100644 +index dcf493d62990018040a3f84b6f875af737bd2214..3d1c4dcc9ee0bbfdac15f40d9c74e9f342a59e39 100644 --- a/ui/accelerated_widget_mac/display_ca_layer_tree.mm +++ b/ui/accelerated_widget_mac/display_ca_layer_tree.mm -@@ -121,6 +121,7 @@ - (void)setContentsChanged; +@@ -12,6 +12,7 @@ + #include "base/mac/mac_util.h" + #include "base/trace_event/trace_event.h" + #include "build/build_config.h" ++#include "electron/mas.h" + #include "ui/base/cocoa/animation_utils.h" + #include "ui/base/cocoa/remote_layer_api.h" + #include "ui/gfx/geometry/dip_util.h" +@@ -121,6 +122,7 @@ - (void)setContentsChanged; } void DisplayCALayerTree::GotCALayerFrame(uint32_t ca_context_id) { @@ -1370,7 +1552,7 @@ index dcf493d62990018040a3f84b6f875af737bd2214..6ffffe8b3946e0427aead8be19878c53 // Early-out if the remote layer has not changed. if (remote_layer_.contextId == ca_context_id) { return; -@@ -150,6 +151,9 @@ - (void)setContentsChanged; +@@ -150,6 +152,9 @@ - (void)setContentsChanged; [io_surface_layer_ removeFromSuperlayer]; io_surface_layer_ = nil; } @@ -1381,22 +1563,30 @@ index dcf493d62990018040a3f84b6f875af737bd2214..6ffffe8b3946e0427aead8be19878c53 void DisplayCALayerTree::GotIOSurfaceFrame( diff --git a/ui/accessibility/platform/BUILD.gn b/ui/accessibility/platform/BUILD.gn -index ad1807ebfa054c68aead72ac8eb9c7323ca1d9fa..91124462bd61672114479ea9577b3924c89417ac 100644 +index ad1807ebfa054c68aead72ac8eb9c7323ca1d9fa..be0e9df596b6903296c4e4010d73e172766e8464 100644 --- a/ui/accessibility/platform/BUILD.gn +++ b/ui/accessibility/platform/BUILD.gn @@ -240,6 +240,7 @@ component("platform") { "AppKit.framework", "Foundation.framework", ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } if (is_ios) { diff --git a/ui/accessibility/platform/inspect/ax_transform_mac.mm b/ui/accessibility/platform/inspect/ax_transform_mac.mm -index c8171f0527fe5194f0ea73b57c4444d4c630fbc4..7fa66598f2a541600602af47b3e1ed7b5d4463ee 100644 +index c8171f0527fe5194f0ea73b57c4444d4c630fbc4..c2ac4da580e3e7f749a0a4de1e859af62de11672 100644 --- a/ui/accessibility/platform/inspect/ax_transform_mac.mm +++ b/ui/accessibility/platform/inspect/ax_transform_mac.mm -@@ -111,6 +111,7 @@ +@@ -11,6 +11,7 @@ + + #include "base/apple/foundation_util.h" + #include "base/strings/sys_string_conversions.h" ++#include "electron/mas.h" + #include "ui/accessibility/ax_range.h" + #include "ui/accessibility/platform/ax_platform_node.h" + #include "ui/accessibility/platform/ax_platform_node_cocoa.h" +@@ -111,6 +112,7 @@ } } @@ -1404,7 +1594,7 @@ index c8171f0527fe5194f0ea73b57c4444d4c630fbc4..7fa66598f2a541600602af47b3e1ed7b // AXTextMarker if (IsAXTextMarker(value)) { return AXTextMarkerToBaseValue(value, indexer); -@@ -120,6 +121,7 @@ +@@ -120,6 +122,7 @@ if (IsAXTextMarkerRange(value)) { return AXTextMarkerRangeToBaseValue(value, indexer); } @@ -1413,18 +1603,10 @@ index c8171f0527fe5194f0ea73b57c4444d4c630fbc4..7fa66598f2a541600602af47b3e1ed7b // Accessible object if (AXElementWrapper::IsValidElement(value)) { diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index 64aca0117cd273bfcec0549e7b5b8ac77f2c91ce..e44c1bd4dd100b6b9b390f1fb07dc8e684182561 100644 +index 64aca0117cd273bfcec0549e7b5b8ac77f2c91ce..511d12116f0d85fec6d7c2c9947e9c2e6fc98285 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn -@@ -363,6 +363,7 @@ component("base") { - "interaction/element_tracker_mac.mm", - "resource/resource_bundle_mac.mm", - ] -+ configs += ["//electron/build/config:mas_build"] - } - - if (is_apple) { -@@ -380,6 +381,13 @@ component("base") { +@@ -380,6 +380,13 @@ component("base") { sources += [ "resource/resource_bundle_lacros.cc" ] } @@ -1438,11 +1620,28 @@ index 64aca0117cd273bfcec0549e7b5b8ac77f2c91ce..e44c1bd4dd100b6b9b390f1fb07dc8e6 if (is_ios) { sources += [ "device_form_factor_ios.mm", +@@ -531,6 +538,12 @@ component("base") { + "//url", + ] + ++ if (is_mac) { ++ deps += [ ++ "//electron/build/config:generate_mas_config" ++ ] ++ } ++ + if (is_debug || dcheck_always_on) { + deps += [ "//third_party/re2" ] + } diff --git a/ui/base/cocoa/remote_accessibility_api.h b/ui/base/cocoa/remote_accessibility_api.h -index 3182458838aa96d34911280ab4c6c3aa4aa22d6d..17b57f54492421743a0d69106eefce2c9beb8e87 100644 +index 3182458838aa96d34911280ab4c6c3aa4aa22d6d..6dc85c366b7e61c8bd0302e501c3223a19223313 100644 --- a/ui/base/cocoa/remote_accessibility_api.h +++ b/ui/base/cocoa/remote_accessibility_api.h -@@ -13,6 +13,8 @@ +@@ -10,9 +10,12 @@ + #include <vector> + + #include "base/component_export.h" ++#include "electron/mas.h" // NSAccessibilityRemoteUIElement is a private class in AppKit. @@ -1451,7 +1650,7 @@ index 3182458838aa96d34911280ab4c6c3aa4aa22d6d..17b57f54492421743a0d69106eefce2c @interface NSAccessibilityRemoteUIElement : NSObject + (void)setRemoteUIApp:(BOOL)flag; + (BOOL)isRemoteUIApp; -@@ -38,4 +40,6 @@ class COMPONENT_EXPORT(UI_BASE) RemoteAccessibility { +@@ -38,4 +41,6 @@ class COMPONENT_EXPORT(UI_BASE) RemoteAccessibility { } // namespace ui @@ -1459,10 +1658,18 @@ index 3182458838aa96d34911280ab4c6c3aa4aa22d6d..17b57f54492421743a0d69106eefce2c + #endif // UI_BASE_COCOA_REMOTE_ACCESSIBILITY_API_H_ diff --git a/ui/base/cocoa/remote_layer_api.h b/ui/base/cocoa/remote_layer_api.h -index 59dc2f82214cfd883b6ebef3b0fb25af6387a9cd..d585ba14b34021a93c878d0d9f9d9ef70eed32ca 100644 +index 59dc2f82214cfd883b6ebef3b0fb25af6387a9cd..912c5252d1b30d943a1552739b9eef9a8eae2d7a 100644 --- a/ui/base/cocoa/remote_layer_api.h +++ b/ui/base/cocoa/remote_layer_api.h -@@ -17,6 +17,7 @@ +@@ -9,6 +9,7 @@ + + #include "base/component_export.h" + #include "build/build_config.h" ++#include "electron/mas.h" + + #if defined(__OBJC__) + #import <Foundation/Foundation.h> +@@ -17,6 +18,7 @@ #if BUILDFLAG(IS_MAC) @@ -1470,7 +1677,7 @@ index 59dc2f82214cfd883b6ebef3b0fb25af6387a9cd..d585ba14b34021a93c878d0d9f9d9ef7 // The CGSConnectionID is used to create the CAContext in the process that is // going to share the CALayers that it is rendering to another process to // display. -@@ -68,6 +69,8 @@ extern NSString* const kCAContextIgnoresHitTest; +@@ -68,6 +70,8 @@ extern NSString* const kCAContextIgnoresHitTest; #endif // __OBJC__ @@ -1480,10 +1687,16 @@ index 59dc2f82214cfd883b6ebef3b0fb25af6387a9cd..d585ba14b34021a93c878d0d9f9d9ef7 // This function will check if all of the interfaces listed above are supported diff --git a/ui/base/cocoa/remote_layer_api.mm b/ui/base/cocoa/remote_layer_api.mm -index fc25ba79d2b0e1acdb7ba54b89e7d6e16f94771b..962df2d65d61ec0836cf465d847eb666033846f2 100644 +index fc25ba79d2b0e1acdb7ba54b89e7d6e16f94771b..de771ef414b9a69e331261524f08e9a12145ec60 100644 --- a/ui/base/cocoa/remote_layer_api.mm +++ b/ui/base/cocoa/remote_layer_api.mm -@@ -10,6 +10,7 @@ +@@ -5,11 +5,13 @@ + #include "ui/base/cocoa/remote_layer_api.h" + + #include "base/feature_list.h" ++#include "electron/mas.h" + + #include <objc/runtime.h> namespace ui { @@ -1491,7 +1704,7 @@ index fc25ba79d2b0e1acdb7ba54b89e7d6e16f94771b..962df2d65d61ec0836cf465d847eb666 namespace { // Control use of cross-process CALayers to display content directly from the // GPU process on Mac. -@@ -17,8 +18,10 @@ +@@ -17,8 +19,10 @@ "RemoteCoreAnimationAPI", base::FEATURE_ENABLED_BY_DEFAULT); } // namespace @@ -1502,7 +1715,7 @@ index fc25ba79d2b0e1acdb7ba54b89e7d6e16f94771b..962df2d65d61ec0836cf465d847eb666 if (!base::FeatureList::IsEnabled(kRemoteCoreAnimationAPI)) return false; -@@ -55,6 +58,9 @@ bool RemoteLayerAPISupported() { +@@ -55,6 +59,9 @@ bool RemoteLayerAPISupported() { // If everything is there, we should be able to use the API. return true; @@ -1513,25 +1726,35 @@ index fc25ba79d2b0e1acdb7ba54b89e7d6e16f94771b..962df2d65d61ec0836cf465d847eb666 } // namespace diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn -index 333424e572626bd9c372ed88601a1e80b45fe511..99aa8f04cdc22254eb70b5ab41987a5628841d0b 100644 +index 333424e572626bd9c372ed88601a1e80b45fe511..dda2e07351a11b2e43cd115b8a5a66a579f86a61 100644 --- a/ui/display/BUILD.gn +++ b/ui/display/BUILD.gn -@@ -74,6 +74,10 @@ component("display") { - "mac/display_link_mac.mm", - "mac/screen_mac.mm", - ] -+ -+ configs += [ -+ "//electron/build/config:mas_build" +@@ -130,6 +130,12 @@ component("display") { + "//ui/gfx/geometry", + ] + ++ if (is_mac) { ++ deps += [ ++ "//electron/build/config:generate_mas_config" + ] ++ } ++ + if (is_ios) { + deps += [ "//build:ios_buildflags" ] } - - if (is_win) { diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm -index 35b71abc95f83bb01dba3f69e2d69a026840b7a2..f9d556e6b221d17035cd9e8d1f5620c52f3fb744 100644 +index 35b71abc95f83bb01dba3f69e2d69a026840b7a2..6a2ff6768f16e503657cdb7ff6be7587c45842ec 100644 --- a/ui/display/mac/screen_mac.mm +++ b/ui/display/mac/screen_mac.mm -@@ -176,7 +176,17 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) { +@@ -30,6 +30,7 @@ + #include "base/trace_event/trace_event.h" + #include "build/build_config.h" + #include "components/device_event_log/device_event_log.h" ++#include "electron/mas.h" + #include "ui/display/display.h" + #include "ui/display/display_change_notifier.h" + #include "ui/display/util/display_util.h" +@@ -176,7 +177,17 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) { display.set_color_depth(Display::kDefaultBitsPerPixel); display.set_depth_per_component(Display::kDefaultBitsPerComponent); } @@ -1550,22 +1773,35 @@ index 35b71abc95f83bb01dba3f69e2d69a026840b7a2..f9d556e6b221d17035cd9e8d1f5620c5 // Query the display's refresh rate. if (@available(macos 12.0, *)) { diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn -index 5255116a8e8f897607e5c5df2875dbaf275ec919..0a28b2832470f3c9d45f70499be29c2b29cb1b25 100644 +index 5255116a8e8f897607e5c5df2875dbaf275ec919..5b53f9175e6076158fa2b2037eb2506b768d4601 100644 --- a/ui/gfx/BUILD.gn +++ b/ui/gfx/BUILD.gn -@@ -204,6 +204,7 @@ component("gfx") { - "scoped_ns_graphics_context_save_gstate_mac.h", - "scoped_ns_graphics_context_save_gstate_mac.mm", - ] -+ configs += ["//electron/build/config:mas_build"] - } - if (is_win) { +@@ -333,6 +333,12 @@ component("gfx") { + "//ui/base:ui_data_pack", + ] + ++ if (is_mac) { ++ deps += [ ++ "//electron/build/config:generate_mas_config" ++ ] ++ } ++ + if (!is_apple) { sources += [ + "platform_font_skia.cc", diff --git a/ui/gfx/platform_font_mac.mm b/ui/gfx/platform_font_mac.mm -index dd1a98234966ba069bb6c7e6ab95f64cae0b0f1f..fa17d4b1974b6844ee11343f652d6896b6f1b1db 100644 +index dd1a98234966ba069bb6c7e6ab95f64cae0b0f1f..4cc1d7c785b2930a878b115ecac17ed14f098100 100644 --- a/ui/gfx/platform_font_mac.mm +++ b/ui/gfx/platform_font_mac.mm -@@ -28,9 +28,11 @@ +@@ -19,6 +19,7 @@ + #include "base/numerics/safe_conversions.h" + #include "base/strings/sys_string_conversions.h" + #include "base/strings/utf_string_conversions.h" ++#include "electron/mas.h" + #include "third_party/skia/include/ports/SkTypeface_mac.h" + #include "ui/gfx/canvas.h" + #include "ui/gfx/font.h" +@@ -28,9 +29,11 @@ using Weight = Font::Weight; @@ -1577,7 +1813,7 @@ index dd1a98234966ba069bb6c7e6ab95f64cae0b0f1f..fa17d4b1974b6844ee11343f652d6896 namespace { -@@ -245,7 +247,13 @@ CTFontRef SystemFontForConstructorOfType(PlatformFontMac::SystemFontType type) { +@@ -245,7 +248,13 @@ CTFontRef SystemFontForConstructorOfType(PlatformFontMac::SystemFontType type) { // TODO(avi, etienneb): Figure out this font stuff. base::apple::ScopedCFTypeRef<CTFontDescriptorRef> descriptor( CTFontCopyFontDescriptor(font)); @@ -1592,14 +1828,14 @@ index dd1a98234966ba069bb6c7e6ab95f64cae0b0f1f..fa17d4b1974b6844ee11343f652d6896 // enough. return PlatformFontMac::SystemFontType::kGeneral; diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn -index b2b1a783ac0c243ef5cf573b2e73af82b432fbf9..1b43204b8ce15b9cc4cbf6c5a3d6853ab5da0858 100644 +index b2b1a783ac0c243ef5cf573b2e73af82b432fbf9..60aee1fd81e31b2ba43ec344990588921c9393a4 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn @@ -722,6 +722,7 @@ component("views") { "IOSurface.framework", "QuartzCore.framework", ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] } if (is_win) { @@ -1607,16 +1843,24 @@ index b2b1a783ac0c243ef5cf573b2e73af82b432fbf9..1b43204b8ce15b9cc4cbf6c5a3d6853a "//ui/base/mojom:mojom", ] -+ configs += ["//electron/build/config:mas_build"] ++ deps += ["//electron/build/config:generate_mas_config"] + if (is_win) { sources += [ "test/desktop_window_tree_host_win_test_api.cc", diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h -index 9879c3456c12e2b0f0d550df1062da4a50a8e89d..83560d83ee240bb9197476d00578197fd299c12f 100644 +index 9879c3456c12e2b0f0d550df1062da4a50a8e89d..61f655d78d83665af1ded11526eac7c2cc9219d1 100644 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.h +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h -@@ -32,7 +32,9 @@ +@@ -18,6 +18,7 @@ + #include "components/remote_cocoa/browser/scoped_cg_window_id.h" + #include "components/remote_cocoa/common/native_widget_ns_window.mojom.h" + #include "components/remote_cocoa/common/native_widget_ns_window_host.mojom.h" ++#include "electron/mas.h" + #include "mojo/public/cpp/bindings/associated_receiver.h" + #include "mojo/public/cpp/bindings/associated_remote.h" + #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" +@@ -32,7 +33,9 @@ #include "ui/views/window/dialog_observer.h" @class NativeWidgetMacNSWindow; @@ -1626,7 +1870,7 @@ index 9879c3456c12e2b0f0d550df1062da4a50a8e89d..83560d83ee240bb9197476d00578197f @class NSView; namespace remote_cocoa { -@@ -483,10 +485,12 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost +@@ -483,10 +486,12 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost mojo::AssociatedRemote<remote_cocoa::mojom::NativeWidgetNSWindow> remote_ns_window_remote_; @@ -1640,10 +1884,18 @@ index 9879c3456c12e2b0f0d550df1062da4a50a8e89d..83560d83ee240bb9197476d00578197f // Used to force the NSApplication's focused accessibility element to be the // views::Views accessibility tree when the NSView for this is focused. diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm -index 8b05cee4302216bf804320abc708d69379ab4a64..ad3b5fe6f39bb21d3b33a8828e7f4de7b04226fa 100644 +index 8b05cee4302216bf804320abc708d69379ab4a64..7ffc934e99944d185ba14c8c73fe7c53f0b3b5da 100644 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm -@@ -349,7 +349,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -21,6 +21,7 @@ + #include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h" + #include "components/remote_cocoa/browser/ns_view_ids.h" + #include "components/remote_cocoa/browser/window.h" ++#include "electron/mas.h" + #include "mojo/public/cpp/bindings/self_owned_associated_receiver.h" + #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" + #include "ui/accessibility/accessibility_features.h" +@@ -349,7 +350,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSView() const { if (in_process_ns_window_bridge_) return in_process_ns_window_bridge_->ns_view(); @@ -1655,7 +1907,7 @@ index 8b05cee4302216bf804320abc708d69379ab4a64..ad3b5fe6f39bb21d3b33a8828e7f4de7 } gfx::NativeViewAccessible -@@ -364,7 +368,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -364,7 +369,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, return [in_process_ns_window_bridge_->ns_view() window]; } @@ -1667,7 +1919,7 @@ index 8b05cee4302216bf804320abc708d69379ab4a64..ad3b5fe6f39bb21d3b33a8828e7f4de7 } remote_cocoa::mojom::NativeWidgetNSWindow* -@@ -1333,9 +1341,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -1333,9 +1342,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, // for PWAs. However this breaks accessibility on in-process windows, // so set it back to NO when a local window gains focus. See // https://crbug.com/41485830. @@ -1679,7 +1931,7 @@ index 8b05cee4302216bf804320abc708d69379ab4a64..ad3b5fe6f39bb21d3b33a8828e7f4de7 // Explicitly set the keyboard accessibility state on regaining key // window status. if (is_key && is_content_first_responder) -@@ -1473,17 +1483,20 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -1473,17 +1484,20 @@ void HandleAccelerator(const ui::Accelerator& accelerator, void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens( const std::vector<uint8_t>& window_token, const std::vector<uint8_t>& view_token) { @@ -1700,7 +1952,7 @@ index 8b05cee4302216bf804320abc708d69379ab4a64..ad3b5fe6f39bb21d3b33a8828e7f4de7 *pid = getpid(); id element_id = GetNativeViewAccessible(); -@@ -1496,6 +1509,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -1496,6 +1510,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator, } *token = ui::RemoteAccessibility::GetTokenForLocalElement(element_id); @@ -1709,16 +1961,19 @@ index 8b05cee4302216bf804320abc708d69379ab4a64..ad3b5fe6f39bb21d3b33a8828e7f4de7 } diff --git a/ui/views/controls/webview/BUILD.gn b/ui/views/controls/webview/BUILD.gn -index 111d6432586f47833dde50678b908c76ad88d37a..45601d06f85ba618fe38c96ae28c47d306784e53 100644 +index 111d6432586f47833dde50678b908c76ad88d37a..429ca4402652a2d89ead228d92971f0cb3b6222c 100644 --- a/ui/views/controls/webview/BUILD.gn +++ b/ui/views/controls/webview/BUILD.gn -@@ -19,6 +19,9 @@ component("webview") { +@@ -46,6 +46,12 @@ component("webview") { + "//url", + ] - if (is_mac) { - sources += [ "unhandled_keyboard_event_handler_mac.mm" ] -+ configs += [ -+ "//electron/build/config:mas_build", ++ if (is_mac) { ++ deps += [ ++ "//electron/build/config:generate_mas_config", + ] - } - - if (is_win) { ++ } ++ + public_deps = [ + "//base", + "//content/public/browser", diff --git a/patches/chromium/osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch b/patches/chromium/osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch index 24104a6813..7da977dc62 100644 --- a/patches/chromium/osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch +++ b/patches/chromium/osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch @@ -36,7 +36,7 @@ index 2096591596a26464ab8f71a399ccb16a04edfd59..9eb966b3ddc3551d6beeff123071b2c9 Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture; diff --git a/media/video/renderable_gpu_memory_buffer_video_frame_pool.cc b/media/video/renderable_gpu_memory_buffer_video_frame_pool.cc -index 208d048ee68fd92d1fa7b5e8ad79e02e29b8be40..c8c8c32cd44a96dc6a476b8bc02bb13b02f86300 100644 +index cf5bde2e431fd137ce3501e2a913aa5a3dad5d5b..2f1d64464d76fdbd9af69c8b122e508219d1cced 100644 --- a/media/video/renderable_gpu_memory_buffer_video_frame_pool.cc +++ b/media/video/renderable_gpu_memory_buffer_video_frame_pool.cc @@ -205,7 +205,7 @@ gfx::Size GetBufferSizeInPixelsForVideoPixelFormat( diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index a06fd30b7e..5acba6ef46 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -11,7 +11,7 @@ majority of changes originally come from these PRs: This patch also fixes callback for manual user cancellation and success. diff --git a/BUILD.gn b/BUILD.gn -index cec2b9df48ca16979e3171c4047f8a8326f1cbb3..a5f88ec8b01f8eecc639a0643fc3bbb917a98fb6 100644 +index 0b1865464e9edaa90b4077639350d05613da858a..fee38be7ce24d7062b1c4e4a99d320226c40f7c1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -998,7 +998,6 @@ if (is_win) { @@ -883,7 +883,7 @@ index 14de029740ffbebe06d309651c1a2c007d9fb96b..e9bf9c5bef2a9235260e7d6c8d26d415 ScriptingThrottler scripting_throttler_; diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 3c3dfc789890eda3007c0723e6730e5fb88c4646..00e4d081a6afac7414cb91d7d5bb276881f49ea0 100644 +index 149942fbbf832d470b6832a0d33699b3d5aeb558..a6756af31ee4f819d2fb57b945b8535dfa068b5a 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -3025,8 +3025,9 @@ source_set("browser") { diff --git a/script/generate-mas-config.py b/script/generate-mas-config.py new file mode 100644 index 0000000000..c81f0e5949 --- /dev/null +++ b/script/generate-mas-config.py @@ -0,0 +1,17 @@ +import sys + +def main(is_mas_build, out_file): + is_mas_num = 0 + if is_mas_build: + is_mas_num = 1 + with open(out_file, 'w', encoding="utf-8") as f: + content = '' + content += '#ifndef ELECTRON_GEN_MAS_BUILD_H_\n' + content += '#define ELECTRON_GEN_MAS_BUILD_H_\n' + content += '#define IS_MAS_BUILD() ' + str(is_mas_num) + '\n' + content += '#endif\n' + + f.write(content) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1] == "true", sys.argv[2])) diff --git a/shell/app/electron_main_delegate.cc b/shell/app/electron_main_delegate.cc index 0954f1d362..4a73b80414 100644 --- a/shell/app/electron_main_delegate.cc +++ b/shell/app/electron_main_delegate.cc @@ -25,6 +25,7 @@ #include "content/public/common/content_switches.h" #include "electron/buildflags/buildflags.h" #include "electron/fuses.h" +#include "electron/mas.h" #include "extensions/common/constants.h" #include "ipc/ipc_buildflags.h" #include "sandbox/policy/switches.h" diff --git a/shell/app/electron_main_mac.cc b/shell/app/electron_main_mac.cc index b91c3c27ba..030bac3b86 100644 --- a/shell/app/electron_main_mac.cc +++ b/shell/app/electron_main_mac.cc @@ -6,6 +6,7 @@ #include <memory> #include "electron/fuses.h" +#include "electron/mas.h" #include "shell/app/electron_library_main.h" #include "shell/app/uv_stdio_fix.h" diff --git a/shell/app/node_main.cc b/shell/app/node_main.cc index dfbc4a8b9e..88e2a8d6e5 100644 --- a/shell/app/node_main.cc +++ b/shell/app/node_main.cc @@ -20,6 +20,7 @@ #include "base/task/thread_pool/thread_pool_instance.h" #include "content/public/common/content_switches.h" #include "electron/fuses.h" +#include "electron/mas.h" #include "gin/array_buffer.h" #include "gin/public/isolate_holder.h" #include "gin/v8_initializer.h" diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index 2597e47bc8..4a2d21931a 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -39,6 +39,7 @@ #include "content/public/browser/network_service_instance.h" #include "content/public/browser/render_frame_host.h" #include "crypto/crypto_buildflags.h" +#include "electron/mas.h" #include "gin/handle.h" #include "media/audio/audio_manager.h" #include "net/dns/public/dns_over_https_config.h" diff --git a/shell/browser/api/electron_api_app.h b/shell/browser/api/electron_api_app.h index 0d17c25e7d..8707f71676 100644 --- a/shell/browser/api/electron_api_app.h +++ b/shell/browser/api/electron_api_app.h @@ -17,6 +17,7 @@ #include "content/public/browser/gpu_data_manager_observer.h" #include "content/public/browser/render_process_host.h" #include "crypto/crypto_buildflags.h" +#include "electron/mas.h" #include "net/base/completion_once_callback.h" #include "net/base/completion_repeating_callback.h" #include "net/ssl/client_cert_identity.h" diff --git a/shell/browser/api/electron_api_crash_reporter.cc b/shell/browser/api/electron_api_crash_reporter.cc index bd0a5a90c7..1e1dbedcc2 100644 --- a/shell/browser/api/electron_api_crash_reporter.cc +++ b/shell/browser/api/electron_api_crash_reporter.cc @@ -17,6 +17,7 @@ #include "chrome/common/chrome_paths.h" #include "components/upload_list/crash_upload_list.h" #include "components/upload_list/text_log_upload_list.h" +#include "electron/mas.h" #include "gin/arguments.h" #include "gin/data_object_builder.h" #include "shell/common/electron_paths.h" diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index e2414ee9f9..40766862d7 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -67,6 +67,7 @@ #include "content/public/common/result_codes.h" #include "content/public/common/webplugininfo.h" #include "electron/buildflags/buildflags.h" +#include "electron/mas.h" #include "electron/shell/common/api/api.mojom.h" #include "gin/arguments.h" #include "gin/data_object_builder.h" diff --git a/shell/browser/api/process_metric.cc b/shell/browser/api/process_metric.cc index 863ea832cc..f7a06c5ef0 100644 --- a/shell/browser/api/process_metric.cc +++ b/shell/browser/api/process_metric.cc @@ -19,6 +19,7 @@ #include <mach/mach.h> #include "base/process/port_provider_mac.h" #include "content/public/browser/browser_child_process_host.h" +#include "electron/mas.h" extern "C" int sandbox_check(pid_t pid, const char* operation, int type, ...); diff --git a/shell/browser/auto_updater.cc b/shell/browser/auto_updater.cc index cd6c9d8676..e3fbf865c9 100644 --- a/shell/browser/auto_updater.cc +++ b/shell/browser/auto_updater.cc @@ -3,7 +3,9 @@ // found in the LICENSE file. #include "shell/browser/auto_updater.h" + #include "build/build_config.h" +#include "electron/mas.h" namespace auto_updater { diff --git a/shell/browser/browser_mac.mm b/shell/browser/browser_mac.mm index b1d8662300..1a78da0a65 100644 --- a/shell/browser/browser_mac.mm +++ b/shell/browser/browser_mac.mm @@ -18,6 +18,7 @@ #include "base/mac/mac_util.mm" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/browser_process.h" +#include "electron/mas.h" #include "net/base/apple/url_conversions.h" #include "shell/browser/badging/badge_manager.h" #include "shell/browser/browser_observer.h" diff --git a/shell/browser/notifications/mac/notification_center_delegate.mm b/shell/browser/notifications/mac/notification_center_delegate.mm index 3417395753..aceec2336b 100644 --- a/shell/browser/notifications/mac/notification_center_delegate.mm +++ b/shell/browser/notifications/mac/notification_center_delegate.mm @@ -7,6 +7,7 @@ #include <string> #include "base/logging.h" +#include "electron/mas.h" #include "shell/browser/notifications/mac/cocoa_notification.h" #include "shell/browser/notifications/mac/notification_presenter_mac.h" diff --git a/shell/browser/ui/cocoa/electron_ns_window.mm b/shell/browser/ui/cocoa/electron_ns_window.mm index 17adef63de..573f4de577 100644 --- a/shell/browser/ui/cocoa/electron_ns_window.mm +++ b/shell/browser/ui/cocoa/electron_ns_window.mm @@ -5,6 +5,7 @@ #include "shell/browser/ui/cocoa/electron_ns_window.h" #include "base/strings/sys_string_conversions.h" +#include "electron/mas.h" #include "shell/browser/native_window_mac.h" #include "shell/browser/ui/cocoa/electron_preview_item.h" #include "shell/browser/ui/cocoa/electron_touch_bar.h" diff --git a/shell/browser/ui/file_dialog_mac.mm b/shell/browser/ui/file_dialog_mac.mm index 51a6e64e38..bd6d15ce5a 100644 --- a/shell/browser/ui/file_dialog_mac.mm +++ b/shell/browser/ui/file_dialog_mac.mm @@ -19,6 +19,7 @@ #include "base/strings/sys_string_conversions.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" +#include "electron/mas.h" #include "shell/browser/native_window.h" #include "shell/common/gin_converters/file_path_converter.h" #include "shell/common/gin_helper/dictionary.h" diff --git a/shell/common/api/electron_bindings.cc b/shell/common/api/electron_bindings.cc index 487bab7e35..1bd968e16a 100644 --- a/shell/common/api/electron_bindings.cc +++ b/shell/common/api/electron_bindings.cc @@ -14,6 +14,7 @@ #include "base/process/process.h" #include "base/process/process_handle.h" #include "base/system/sys_info.h" +#include "electron/mas.h" #include "services/resource_coordinator/public/cpp/memory_instrumentation/global_memory_dump.h" #include "services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h" #include "shell/browser/browser.h" diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 1f5944a50c..ef97b468ff 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -25,6 +25,7 @@ #include "electron/buildflags/buildflags.h" #include "electron/electron_version.h" #include "electron/fuses.h" +#include "electron/mas.h" #include "shell/browser/api/electron_api_app.h" #include "shell/common/api/electron_bindings.h" #include "shell/common/electron_command_line.h" diff --git a/shell/common/platform_util_mac.mm b/shell/common/platform_util_mac.mm index a19e81dd4b..3df0ce366f 100644 --- a/shell/common/platform_util_mac.mm +++ b/shell/common/platform_util_mac.mm @@ -21,6 +21,7 @@ #include "base/strings/sys_string_conversions.h" #include "base/task/thread_pool.h" #include "content/public/browser/browser_task_traits.h" +#include "electron/mas.h" #include "net/base/apple/url_conversions.h" #include "ui/views/widget/widget.h" #include "url/gurl.h" diff --git a/shell/renderer/api/electron_api_crash_reporter_renderer.cc b/shell/renderer/api/electron_api_crash_reporter_renderer.cc index 1d5e9f2553..1045eb611c 100644 --- a/shell/renderer/api/electron_api_crash_reporter_renderer.cc +++ b/shell/renderer/api/electron_api_crash_reporter_renderer.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. +#include "electron/mas.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/node_includes.h"
build
6a99c7b840e035bd7e6b75143ed92e3906be3817
Milan Burda
2023-10-09 01:43:50
refactor: eliminate duplicate code (#40088)
diff --git a/shell/browser/file_select_helper.cc b/shell/browser/file_select_helper.cc index dc6ea804e0..b1932e9b2d 100644 --- a/shell/browser/file_select_helper.cc +++ b/shell/browser/file_select_helper.cc @@ -101,14 +101,7 @@ void FileSelectHelper::FileSelectedWithExtraInfo( std::vector<ui::SelectedFileInfo> files; files.push_back(file); -#if BUILDFLAG(IS_MAC) - base::ThreadPool::PostTask( - FROM_HERE, - {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, - base::BindOnce(&FileSelectHelper::ProcessSelectedFilesMac, this, files)); -#else - ConvertToFileChooserFileInfoList(files); -#endif // BUILDFLAG(IS_MAC) + MultiFilesSelectedWithExtraInfo(files, params); } void FileSelectHelper::MultiFilesSelected( diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index aa57bd6cc4..e0ff57736c 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -202,6 +202,14 @@ void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) { } } +NSView* GetNativeNSView(NativeBrowserView* view) { + if (auto* inspectable = view->GetInspectableWebContentsView()) { + return inspectable->GetNativeView().GetNativeNSView(); + } else { + return nullptr; + } +} + } // namespace NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, @@ -1256,10 +1264,7 @@ void NativeWindowMac::AddBrowserView(NativeBrowserView* view) { } add_browser_view(view); - if (view->GetInspectableWebContentsView()) { - auto* native_view = view->GetInspectableWebContentsView() - ->GetNativeView() - .GetNativeNSView(); + if (auto* native_view = GetNativeNSView(view)) { [[window_ contentView] addSubview:native_view positioned:NSWindowAbove relativeTo:nil]; @@ -1278,9 +1283,9 @@ void NativeWindowMac::RemoveBrowserView(NativeBrowserView* view) { return; } - if (view->GetInspectableWebContentsView()) - [view->GetInspectableWebContentsView()->GetNativeView().GetNativeNSView() - removeFromSuperview]; + if (auto* native_view = GetNativeNSView(view)) { + [native_view removeFromSuperview]; + } remove_browser_view(view); [CATransaction commit]; @@ -1297,10 +1302,7 @@ void NativeWindowMac::SetTopBrowserView(NativeBrowserView* view) { remove_browser_view(view); add_browser_view(view); - if (view->GetInspectableWebContentsView()) { - auto* native_view = view->GetInspectableWebContentsView() - ->GetNativeView() - .GetNativeNSView(); + if (auto* native_view = GetNativeNSView(view)) { [[window_ contentView] addSubview:native_view positioned:NSWindowAbove relativeTo:nil];
refactor
3aa0014d238046854c612fc5b011469a34ecdef9
Sam Maddock
2024-12-16 09:46:20
fix: chrome.i18n unavailable in extension service workers (#45031) https://chromium-review.googlesource.com/c/chromium/src/+/3362491
diff --git a/shell/common/extensions/api/_api_features.json b/shell/common/extensions/api/_api_features.json index 95c02c58ca..b5af622579 100644 --- a/shell/common/extensions/api/_api_features.json +++ b/shell/common/extensions/api/_api_features.json @@ -24,20 +24,6 @@ "action.setBadgeTextColor": { "channel": "stable" }, - "tabs": { - "channel": "stable", - "extension_types": ["extension"], - "contexts": ["privileged_extension"] - }, - "tabs.executeScript": { - "max_manifest_version": 2 - }, - "tabs.insertCSS": { - "max_manifest_version": 2 - }, - "tabs.removeCSS": { - "max_manifest_version": 2 - }, "extension": { "channel": "stable", "extension_types": ["extension"], @@ -59,12 +45,6 @@ ], "max_manifest_version": 2 }, - "i18n": { - "channel": "stable", - "extension_types": ["extension"], - "contexts": ["privileged_extension", "unprivileged_extension", "content_script"], - "disallow_for_service_workers": true - }, "mimeHandlerViewGuestInternal": { "internal": true, "contexts": "all", @@ -93,5 +73,19 @@ "channel": "trunk", "dependencies": ["permission:scripting"], "contexts": ["content_script"] + }, + "tabs": { + "channel": "stable", + "extension_types": ["extension"], + "contexts": ["privileged_extension"] + }, + "tabs.executeScript": { + "max_manifest_version": 2 + }, + "tabs.insertCSS": { + "max_manifest_version": 2 + }, + "tabs.removeCSS": { + "max_manifest_version": 2 } }
fix
e64302cc91af38e96aa65c17c021ad9d7f302e9d
Shelley Vohr
2024-08-05 09:57:16
refactor: simplify window `moveAbove/moveTop` impl on macOS (#43157) refactor: simplify window moveAbove/moveTop impl on macOS
diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index b5dbcef130..1975fa9c67 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -114,50 +114,6 @@ struct Converter<electron::NativeWindowMac::VisualEffectState> { namespace electron { -namespace { -// -[NSWindow orderWindow] does not handle reordering for children -// windows. Their order is fixed to the attachment order (the last attached -// window is on the top). Therefore, work around it by re-parenting in our -// desired order. -void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) { - NSWindow* parent = [child_window parentWindow]; - DCHECK(parent); - - // `ordered_children` sorts children windows back to front. - NSArray<NSWindow*>* children = [[child_window parentWindow] childWindows]; - std::vector<std::pair<NSInteger, NSWindow*>> ordered_children; - for (NSWindow* child in children) - ordered_children.push_back({[child orderedIndex], child}); - std::sort(ordered_children.begin(), ordered_children.end(), std::greater<>()); - - // If `other_window` is nullptr, place `child_window` in front of - // all other children windows. - if (other_window == nullptr) - other_window = ordered_children.back().second; - - if (child_window == other_window) - return; - - for (NSWindow* child in children) - [parent removeChildWindow:child]; - - const bool relative_to_parent = parent == other_window; - if (relative_to_parent) - [parent addChildWindow:child_window ordered:NSWindowAbove]; - - // Re-parent children windows in the desired order. - for (auto [ordered_index, child] : ordered_children) { - if (child != child_window && child != other_window) { - [parent addChildWindow:child ordered:NSWindowAbove]; - } else if (child == other_window && !relative_to_parent) { - [parent addChildWindow:other_window ordered:NSWindowAbove]; - [parent addChildWindow:child_window ordered:NSWindowAbove]; - } - } -} - -} // namespace - NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, NativeWindow* parent) : NativeWindow(options, parent), root_view_(new RootViewMac(this)) { @@ -792,22 +748,12 @@ bool NativeWindowMac::MoveAbove(const std::string& sourceId) { if (!webrtc::GetWindowOwnerPid(window_id)) return false; - if (!parent() || is_modal()) { - [window_ orderWindow:NSWindowAbove relativeTo:window_id]; - } else { - NSWindow* other_window = [NSApp windowWithWindowNumber:window_id]; - ReorderChildWindowAbove(window_, other_window); - } - + [window_ orderWindowByShuffling:NSWindowAbove relativeTo:window_id]; return true; } void NativeWindowMac::MoveTop() { - if (!parent() || is_modal()) { - [window_ orderWindow:NSWindowAbove relativeTo:0]; - } else { - ReorderChildWindowAbove(window_, nullptr); - } + [window_ orderWindowByShuffling:NSWindowAbove relativeTo:0]; } void NativeWindowMac::SetResizable(bool resizable) {
refactor
31803125950f88bd53a9254cacefc093bab42b32
Milan Burda
2023-02-12 03:52:32
chore: update https://cs.chromium.org/ links to https://source.chromium.org/ (#37190) Co-authored-by: Milan Burda <[email protected]>
diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index c6b0e05d18..8eb8f5db21 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -1910,7 +1910,7 @@ removed in future Electron releases. On a Window with Window Controls Overlay already enabled, this method updates the style of the title bar overlay. -[runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70 +[runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5 [page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API [quick-look]: https://en.wikipedia.org/wiki/Quick_Look [vibrancy-docs]: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index 1acb17b038..c9c82f7832 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -1001,7 +1001,7 @@ Emitted when DevTools is closed. Emitted when DevTools is focused / opened. -[runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70 +[runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5 [chrome-webview]: https://developer.chrome.com/docs/extensions/reference/webviewTag/ ### Event: 'context-menu' diff --git a/docs/development/chromium-development.md b/docs/development/chromium-development.md index 6ad450dfbc..fc427b5d22 100644 --- a/docs/development/chromium-development.md +++ b/docs/development/chromium-development.md @@ -18,8 +18,8 @@ See also [V8 Development](v8-development.md) ### Code Resources -- [Code Search](https://cs.chromium.org/) - Indexed and searchable source code for Chromium and associated projects. -- [Source Code](https://cs.chromium.org/chromium/src/) - The source code for Chromium itself. +- [Code Search](https://source.chromium.org/chromium) - Indexed and searchable source code for Chromium and associated projects. +- [Source Code](https://source.chromium.org/chromium/chromium/src) - The source code for Chromium itself. - [Chromium Review](https://chromium-review.googlesource.com) - The searchable code host which facilitates code reviews for Chromium and related projects. ### Informational Resources diff --git a/shell/utility/electron_content_utility_client.cc b/shell/utility/electron_content_utility_client.cc index 5c681855bf..83c385b2d6 100644 --- a/shell/utility/electron_content_utility_client.cc +++ b/shell/utility/electron_content_utility_client.cc @@ -84,8 +84,7 @@ ElectronContentUtilityClient::ElectronContentUtilityClient() = default; ElectronContentUtilityClient::~ElectronContentUtilityClient() = default; // The guts of this came from the chromium implementation -// https://cs.chromium.org/chromium/src/chrome/utility/ -// chrome_content_utility_client.cc?sq=package:chromium&dr=CSs&g=0&l=142 +// https://source.chromium.org/chromium/chromium/src/+/main:chrome/utility/chrome_content_utility_client.cc void ElectronContentUtilityClient::ExposeInterfacesToBrowser( mojo::BinderMap* binders) { #if BUILDFLAG(IS_WIN) diff --git a/spec/api-dialog-spec.ts b/spec/api-dialog-spec.ts index 669f759615..6772f550b9 100644 --- a/spec/api-dialog-spec.ts +++ b/spec/api-dialog-spec.ts @@ -80,7 +80,7 @@ describe('dialog module', () => { afterEach(closeAllWindows); // parentless message boxes are synchronous on macOS - // dangling message boxes on windows cause a DCHECK: https://cs.chromium.org/chromium/src/base/win/message_window.cc?l=68&rcl=7faa4bf236a866d007dc5672c9ce42660e67a6a6 + // dangling message boxes on windows cause a DCHECK: https://source.chromium.org/chromium/chromium/src/+/main:base/win/message_window.cc;drc=7faa4bf236a866d007dc5672c9ce42660e67a6a6;l=68 ifit(process.platform !== 'darwin' && process.platform !== 'win32')('should not throw for a parentless message box', () => { expect(() => { dialog.showMessageBox({ message: 'i am message' });
chore
d0b4489b7d3fcbf789dea215d4e93a0e2ea4a894
Keeley Hammond
2024-02-17 15:04:36
ci: fix helperPath calls in ci configs (#41363) * ci: fix helperPath calls in ci configs Co-authored-by: codebytere <[email protected]> * ci: fix helperPaths harder --------- Co-authored-by: codebytere <[email protected]>
diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 31a6b34681..8042719220 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -353,10 +353,10 @@ step-setup-rbe-for-build: &step-setup-rbe-for-build mkdir third_party # Pull down credential helper and print status node -e "require('./src/utils/reclient.js').downloadAndPrepare({})" - HELPER=$(node -p "require('./src/utils/reclient.js').helperPath") + HELPER=$(node -p "require('./src/utils/reclient.js').helperPath({})") $HELPER login echo 'export RBE_service='`node -e "console.log(require('./src/utils/reclient.js').serviceAddress)"` >> $BASH_ENV - echo 'export RBE_experimental_credentials_helper='`node -e "console.log(require('./src/utils/reclient.js').helperPath)"` >> $BASH_ENV + echo 'export RBE_experimental_credentials_helper='`node -e "console.log(require('./src/utils/reclient.js').helperPath({}))"` >> $BASH_ENV echo 'export RBE_experimental_credentials_helper_args="print"' >> $BASH_ENV step-restore-brew-cache: &step-restore-brew-cache diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 073e9771f0..3723dc5505 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -106,7 +106,7 @@ for: - mkdir third_party - ps: >- node -e "require('./src/utils/reclient.js').downloadAndPrepare({})" - - ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath" + - ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath({})" - ps: >- & $env:RECLIENT_HELPER login - ps: >- diff --git a/appveyor.yml b/appveyor.yml index abbc7ef335..49520ced9a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -104,7 +104,7 @@ for: - mkdir third_party - ps: >- node -e "require('./src/utils/reclient.js').downloadAndPrepare({})" - - ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath" + - ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath({})" - ps: >- & $env:RECLIENT_HELPER login - ps: >-
ci
2c52eb7e1c61aa1ae5e91b4ad062dc7d67fb764e
Milan Burda
2023-07-24 12:32:54
refactor: replace .indexOf() with .includes() (#39195)
diff --git a/lib/browser/api/menu.ts b/lib/browser/api/menu.ts index b4beee8230..3cd17a8ce7 100644 --- a/lib/browser/api/menu.ts +++ b/lib/browser/api/menu.ts @@ -82,7 +82,7 @@ Menu.prototype.popup = function (options = {}) { // find which window to use const wins = BaseWindow.getAllWindows(); - if (!wins || wins.indexOf(window as any) === -1) { + if (!wins || !wins.includes(window as any)) { window = BaseWindow.getFocusedWindow() as any; if (!window && wins && wins.length > 0) { window = wins[0] as any; diff --git a/script/release/prepare-release.js b/script/release/prepare-release.js index 49e4d1b947..8ad1bfc72d 100755 --- a/script/release/prepare-release.js +++ b/script/release/prepare-release.js @@ -117,7 +117,7 @@ async function createRelease (branchToTarget, isBeta) { name: `electron ${newVersion}`, body: releaseBody, prerelease: releaseIsPrelease, - target_commitish: newVersion.indexOf('nightly') !== -1 ? 'main' : branchToTarget + target_commitish: newVersion.includes('nightly') ? 'main' : branchToTarget }).catch(err => { console.log(`${fail} Error creating new release: `, err); process.exit(1); diff --git a/script/release/release.js b/script/release/release.js index a856cf9d8a..148909e0fd 100755 --- a/script/release/release.js +++ b/script/release/release.js @@ -50,7 +50,7 @@ async function getDraftRelease (version, skipValidation) { if (!skipValidation) { failureCount = 0; check(drafts.length === 1, 'one draft exists', true); - if (versionToCheck.indexOf('beta') > -1) { + if (versionToCheck.includes('beta')) { check(draft.prerelease, 'draft is a prerelease'); } check(draft.body.length > 50 && !draft.body.includes('(placeholder)'), 'draft has release notes'); diff --git a/spec/api-menu-spec.ts b/spec/api-menu-spec.ts index 95d7cc1970..a6a6243a60 100644 --- a/spec/api-menu-spec.ts +++ b/spec/api-menu-spec.ts @@ -948,7 +948,7 @@ describe('Menu module', function () { await new Promise<void>((resolve) => { appProcess.stdout.on('data', data => { output += data; - if (data.indexOf('Window has') > -1) { + if (data.includes('Window has')) { resolve(); } }); diff --git a/spec/security-warnings-spec.ts b/spec/security-warnings-spec.ts index e1d72be976..de5905fb24 100644 --- a/spec/security-warnings-spec.ts +++ b/spec/security-warnings-spec.ts @@ -12,7 +12,7 @@ import { listen } from './lib/spec-helpers'; import { setTimeout } from 'node:timers/promises'; const messageContainsSecurityWarning = (event: Event, level: number, message: string) => { - return message.indexOf('Electron Security Warning') > -1; + return message.includes('Electron Security Warning'); }; const isLoaded = (event: Event, level: number, message: string) => {
refactor
f6e8544ef638f1e517a4a2b287950cb27edeac0f
Milan Burda
2023-09-07 08:50:14
refactor: use `replaceAll()` instead of `replace()` when appropriate (#39721) refactor: use replaceAll() instead of replace() when appropriate
diff --git a/lib/browser/api/dialog.ts b/lib/browser/api/dialog.ts index 3ec49b8bc2..c0cc75cfa5 100644 --- a/lib/browser/api/dialog.ts +++ b/lib/browser/api/dialog.ts @@ -33,7 +33,7 @@ const normalizeAccessKey = (text: string) => { // macOS does not have access keys so remove single ampersands // and replace double ampersands with a single ampersand if (process.platform === 'darwin') { - return text.replace(/&(&?)/g, '$1'); + return text.replaceAll(/&(&?)/g, '$1'); } // Linux uses a single underscore as an access key prefix so escape @@ -41,7 +41,7 @@ const normalizeAccessKey = (text: string) => { // ampersands with a single ampersand, and replace a single ampersand with // a single underscore if (process.platform === 'linux') { - return text.replace(/_/g, '__').replace(/&(.?)/g, (match, after) => { + return text.replaceAll('_', '__').replaceAll(/&(.?)/g, (match, after) => { if (after === '&') return after; return `_${after}`; }); diff --git a/lib/browser/init.ts b/lib/browser/init.ts index 5fb42e84fe..8359971653 100644 --- a/lib/browser/init.ts +++ b/lib/browser/init.ts @@ -63,8 +63,8 @@ if (process.platform === 'win32') { if (fs.existsSync(updateDotExe)) { const packageDir = path.dirname(path.resolve(updateDotExe)); - const packageName = path.basename(packageDir).replace(/\s/g, ''); - const exeName = path.basename(process.execPath).replace(/\.exe$/i, '').replace(/\s/g, ''); + const packageName = path.basename(packageDir).replaceAll(/\s/g, ''); + const exeName = path.basename(process.execPath).replace(/\.exe$/i, '').replaceAll(/\s/g, ''); app.setAppUserModelId(`com.squirrel.${packageName}.${exeName}`); } diff --git a/spec/api-browser-window-spec.ts b/spec/api-browser-window-spec.ts index 5f0466b16c..114385d944 100644 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -3425,7 +3425,7 @@ describe('BrowserWindow module', () => { w.loadURL(pageUrl); const [, url] = await once(ipcMain, 'answer'); const expectedUrl = process.platform === 'win32' - ? 'file:///' + htmlPath.replace(/\\/g, '/') + ? 'file:///' + htmlPath.replaceAll('\\', '/') : pageUrl; expect(url).to.equal(expectedUrl); }); @@ -3475,7 +3475,7 @@ describe('BrowserWindow module', () => { w.loadURL(pageUrl); const [, { url, frameName, options }] = await once(w.webContents, 'did-create-window') as [BrowserWindow, Electron.DidCreateWindowDetails]; const expectedUrl = process.platform === 'win32' - ? 'file:///' + htmlPath.replace(/\\/g, '/') + ? 'file:///' + htmlPath.replaceAll('\\', '/') : pageUrl; expect(url).to.equal(expectedUrl); expect(frameName).to.equal('popup!'); diff --git a/spec/api-debugger-spec.ts b/spec/api-debugger-spec.ts index 1e63bd9c2a..558f64599a 100644 --- a/spec/api-debugger-spec.ts +++ b/spec/api-debugger-spec.ts @@ -111,7 +111,7 @@ describe('debugger module', () => { it('fires message event', async () => { const url = process.platform !== 'win32' ? `file://${path.join(fixtures, 'pages', 'a.html')}` - : `file:///${path.join(fixtures, 'pages', 'a.html').replace(/\\/g, '/')}`; + : `file:///${path.join(fixtures, 'pages', 'a.html').replaceAll('\\', '/')}`; w.webContents.loadURL(url); w.webContents.debugger.attach(); const message = emittedUntil(w.webContents.debugger, 'message', diff --git a/spec/api-protocol-spec.ts b/spec/api-protocol-spec.ts index 1bb267c281..6e3659034a 100644 --- a/spec/api-protocol-spec.ts +++ b/spec/api-protocol-spec.ts @@ -1128,7 +1128,7 @@ describe('protocol module', () => { protocol.handle('file', (req) => { let file; if (process.platform === 'win32') { - file = `file:///${filePath.replace(/\\/g, '/')}`; + file = `file:///${filePath.replaceAll('\\', '/')}`; } else { file = `file://${filePath}`; } diff --git a/spec/api-session-spec.ts b/spec/api-session-spec.ts index 614ec6cba6..7a456fef39 100644 --- a/spec/api-session-spec.ts +++ b/spec/api-session-spec.ts @@ -237,7 +237,7 @@ describe('session module', () => { appProcess.stdout.on('data', data => { output += data; }); appProcess.on('exit', () => { - resolve(output.replace(/(\r\n|\n|\r)/gm, '')); + resolve(output.replaceAll(/(\r\n|\n|\r)/gm, '')); }); }); }; diff --git a/spec/api-web-request-spec.ts b/spec/api-web-request-spec.ts index 3d29cc6142..3afaba1cd9 100644 --- a/spec/api-web-request-spec.ts +++ b/spec/api-web-request-spec.ts @@ -181,7 +181,7 @@ describe('webRequest module', () => { callback({ cancel: true }); }); const fileURL = url.format({ - pathname: path.join(fixturesPath, 'blank.html').replace(/\\/g, '/'), + pathname: path.join(fixturesPath, 'blank.html').replaceAll('\\', '/'), protocol: 'file', slashes: true }); @@ -395,7 +395,7 @@ describe('webRequest module', () => { onSendHeadersCalled = true; }); await ajax(url.format({ - pathname: path.join(fixturesPath, 'blank.html').replace(/\\/g, '/'), + pathname: path.join(fixturesPath, 'blank.html').replaceAll('\\', '/'), protocol: 'file', slashes: true })); diff --git a/spec/asar-spec.ts b/spec/asar-spec.ts index b15a3d3149..ed7a587530 100644 --- a/spec/asar-spec.ts +++ b/spec/asar-spec.ts @@ -90,7 +90,7 @@ describe('asar package', () => { await w.loadFile(path.join(fixtures, 'workers', 'load_worker.html')); const workerUrl = url.format({ - pathname: path.resolve(fixtures, 'workers', 'workers.asar', 'worker.js').replace(/\\/g, '/'), + pathname: path.resolve(fixtures, 'workers', 'workers.asar', 'worker.js').replaceAll('\\', '/'), protocol: 'file', slashes: true }); @@ -103,7 +103,7 @@ describe('asar package', () => { await w.loadFile(path.join(fixtures, 'workers', 'load_shared_worker.html')); const workerUrl = url.format({ - pathname: path.resolve(fixtures, 'workers', 'workers.asar', 'shared_worker.js').replace(/\\/g, '/'), + pathname: path.resolve(fixtures, 'workers', 'workers.asar', 'shared_worker.js').replaceAll('\\', '/'), protocol: 'file', slashes: true }); @@ -1243,7 +1243,7 @@ describe('asar package', function () { const echo = path.join(asarDir, 'echo.asar', 'echo'); const stdout = await promisify(require(childProcess).exec)('echo ' + echo + ' foo bar'); - expect(stdout.toString().replace(/\r/g, '')).to.equal(echo + ' foo bar\n'); + expect(stdout.toString().replaceAll('\r', '')).to.equal(echo + ' foo bar\n'); }, [childProcess]); }); @@ -1252,7 +1252,7 @@ describe('asar package', function () { const echo = path.join(asarDir, 'echo.asar', 'echo'); const stdout = require(childProcess).execSync('echo ' + echo + ' foo bar'); - expect(stdout.toString().replace(/\r/g, '')).to.equal(echo + ' foo bar\n'); + expect(stdout.toString().replaceAll('\r', '')).to.equal(echo + ' foo bar\n'); }, [childProcess]); }); diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index f39526df5a..98973558e9 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -284,7 +284,7 @@ describe('web security', () => { describe('accessing file://', () => { async function loadFile (w: BrowserWindow) { const thisFile = url.format({ - pathname: __filename.replace(/\\/g, '/'), + pathname: __filename.replaceAll('\\', '/'), protocol: 'file', slashes: true }); @@ -461,7 +461,7 @@ describe('command line switches', () => { throw new Error(`Process exited with code "${code}" signal "${signal}" output "${output}" stderr "${stderr}"`); } - output = output.replace(/(\r\n|\n|\r)/gm, ''); + output = output.replaceAll(/(\r\n|\n|\r)/gm, ''); expect(output).to.equal(result); }; @@ -1050,7 +1050,7 @@ describe('chromium features', () => { it('defines a window.location getter', async () => { let targetURL: string; if (process.platform === 'win32') { - targetURL = `file:///${fixturesPath.replace(/\\/g, '/')}/pages/base-page.html`; + targetURL = `file:///${fixturesPath.replaceAll('\\', '/')}/pages/base-page.html`; } else { targetURL = `file://${fixturesPath}/pages/base-page.html`; } @@ -1977,7 +1977,7 @@ describe('chromium features', () => { ifdescribe(features.isPDFViewerEnabled())('PDF Viewer', () => { const pdfSource = url.format({ - pathname: path.join(__dirname, 'fixtures', 'cat.pdf').replace(/\\/g, '/'), + pathname: path.join(__dirname, 'fixtures', 'cat.pdf').replaceAll('\\', '/'), protocol: 'file', slashes: true }); diff --git a/spec/webview-spec.ts b/spec/webview-spec.ts index 240de3c8d4..8246ee6d15 100644 --- a/spec/webview-spec.ts +++ b/spec/webview-spec.ts @@ -249,7 +249,7 @@ describe('<webview> tag', function () { }); await w.loadURL('about:blank'); const src = url.format({ - pathname: `${fixtures.replace(/\\/g, '/')}/pages/theme-color.html`, + pathname: `${fixtures.replaceAll('\\', '/')}/pages/theme-color.html`, protocol: 'file', slashes: true });
refactor
33e66b5cd02d2b258b956022c482024c74c13b4b
Shelley Vohr
2023-08-24 22:54:08
fix: ensure windows respect fullscreenability with different resizability values (#39620) * fix: ensure child windows respect fullscreenability/resizability when parent is fullscreen * test: add an extra resize test
diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 8720028076..c847f0bf1e 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -830,23 +830,19 @@ void NativeWindowMac::SetResizable(bool resizable) { ScopedDisableResize disable_resize; SetStyleMask(resizable, NSWindowStyleMaskResizable); + bool was_fullscreenable = IsFullScreenable(); + // Right now, resizable and fullscreenable are decoupled in // documentation and on Windows/Linux. Chromium disables - // fullscreenability if resizability is false on macOS as well - // as disabling the maximize traffic light unless the window - // is both resizable and maximizable. To work around this, we want - // to match behavior on other platforms by disabiliting the maximize - // button but keeping fullscreenability enabled. - // TODO(codebytere): refactor this once we have a better solution. + // fullscreen collection behavior as well as the maximize traffic + // light in SetCanResize if resizability is false on macOS unless + // the window is both resizable and maximizable. We want consistent + // cross-platform behavior, so if resizability is disabled we disable + // the maximize button and ensure fullscreenability matches user setting. SetCanResize(resizable); - if (!resizable) { - SetFullScreenable(true); - [[window_ standardWindowButton:NSWindowZoomButton] setEnabled:false]; - } else { - SetFullScreenable(true); - [[window_ standardWindowButton:NSWindowZoomButton] - setEnabled:IsFullScreenable()]; - } + SetFullScreenable(was_fullscreenable); + [[window_ standardWindowButton:NSWindowZoomButton] + setEnabled:resizable ? was_fullscreenable : false]; } bool NativeWindowMac::IsResizable() { diff --git a/spec/api-browser-window-spec.ts b/spec/api-browser-window-spec.ts index 05fff05840..404465b5e1 100644 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -5416,6 +5416,42 @@ describe('BrowserWindow module', () => { expect(w.isFullScreenable()).to.be.true('isFullScreenable'); }); }); + + it('does not open non-fullscreenable child windows in fullscreen if parent is fullscreen', async () => { + const w = new BrowserWindow(); + + const enterFS = once(w, 'enter-full-screen'); + w.setFullScreen(true); + await enterFS; + + const child = new BrowserWindow({ parent: w, resizable: false, fullscreenable: false }); + const shown = once(child, 'show'); + await shown; + + expect(child.resizable).to.be.false('resizable'); + expect(child.fullScreen).to.be.false('fullscreen'); + expect(child.fullScreenable).to.be.false('fullscreenable'); + }); + + it('is set correctly with different resizable values', async () => { + const w1 = new BrowserWindow({ + resizable: false, + fullscreenable: false + }); + + const w2 = new BrowserWindow({ + resizable: true, + fullscreenable: false + }); + + const w3 = new BrowserWindow({ + fullscreenable: false + }); + + expect(w1.isFullScreenable()).to.be.false('isFullScreenable'); + expect(w2.isFullScreenable()).to.be.false('isFullScreenable'); + expect(w3.isFullScreenable()).to.be.false('isFullScreenable'); + }); }); ifdescribe(process.platform === 'darwin')('isHiddenInMissionControl state', () => {
fix
a6f7c7690d7fa73ea1decb00e5391079d39057ef
Milan Burda
2023-05-30 10:53:11
refactor: use literals instead of new RegExp() where possible (#38458)
diff --git a/script/prepare-appveyor.js b/script/prepare-appveyor.js index f16dd8ece8..0e15e4eaec 100644 --- a/script/prepare-appveyor.js +++ b/script/prepare-appveyor.js @@ -182,8 +182,7 @@ async function prepareAppVeyorImage (opts) { if (ROLLER_BRANCH_PATTERN.test(branch)) { useAppVeyorImage(branch, { ...opts, version: DEFAULT_BUILD_IMAGE, cloudId: DEFAULT_BUILD_CLOUD_ID }); } else { - // eslint-disable-next-line no-control-regex - const versionRegex = new RegExp('chromium_version\':\n +\'(.+?)\',', 'm'); + const versionRegex = /chromium_version':\n +'(.+?)',/m; const deps = fs.readFileSync(path.resolve(__dirname, '..', 'DEPS'), 'utf8'); const [, CHROMIUM_VERSION] = versionRegex.exec(deps); diff --git a/script/release/prepare-release.js b/script/release/prepare-release.js index c6bb5f7eb3..be9c430849 100755 --- a/script/release/prepare-release.js +++ b/script/release/prepare-release.js @@ -187,8 +187,7 @@ async function promptForVersion (version) { // function to determine if there have been commits to main since the last release async function changesToRelease () { - // eslint-disable-next-line no-useless-escape - const lastCommitWasRelease = new RegExp('^Bump v[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?(-alpha\.[0-9]+)?(-nightly\.[0-9]+)?$', 'g'); + const lastCommitWasRelease = /^Bump v[0-9]+.[0-9]+.[0-9]+(-beta.[0-9]+)?(-alpha.[0-9]+)?(-nightly.[0-9]+)?$/g; const lastCommit = await GitProcess.exec(['log', '-n', '1', '--pretty=format:\'%s\''], ELECTRON_DIR); return !lastCommitWasRelease.test(lastCommit.stdout); }
refactor
effafdf49860b828a031ee92eb272a6851da3ebe
David Sanders
2023-08-14 18:24:32
test: use as const to remove some usages of as any (#39475)
diff --git a/spec/api-session-spec.ts b/spec/api-session-spec.ts index 840748167a..592d43eb69 100644 --- a/spec/api-session-spec.ts +++ b/spec/api-session-spec.ts @@ -419,33 +419,33 @@ describe('session module', () => { }); it('allows configuring proxy settings with mode `direct`', async () => { - const config = { mode: 'direct' as any, proxyRules: 'http=myproxy:80' }; + const config = { mode: 'direct' as const, proxyRules: 'http=myproxy:80' }; await customSession.setProxy(config); const proxy = await customSession.resolveProxy('http://example.com/'); expect(proxy).to.equal('DIRECT'); }); it('allows configuring proxy settings with mode `auto_detect`', async () => { - const config = { mode: 'auto_detect' as any }; + const config = { mode: 'auto_detect' as const }; await customSession.setProxy(config); }); it('allows configuring proxy settings with mode `pac_script`', async () => { - const config = { mode: 'pac_script' as any }; + const config = { mode: 'pac_script' as const }; await customSession.setProxy(config); const proxy = await customSession.resolveProxy('http://example.com/'); expect(proxy).to.equal('DIRECT'); }); it('allows configuring proxy settings with mode `fixed_servers`', async () => { - const config = { mode: 'fixed_servers' as any, proxyRules: 'http=myproxy:80' }; + const config = { mode: 'fixed_servers' as const, proxyRules: 'http=myproxy:80' }; await customSession.setProxy(config); const proxy = await customSession.resolveProxy('http://example.com/'); expect(proxy).to.equal('PROXY myproxy:80'); }); it('allows configuring proxy settings with mode `system`', async () => { - const config = { mode: 'system' as any }; + const config = { mode: 'system' as const }; await customSession.setProxy(config); }); @@ -468,7 +468,7 @@ describe('session module', () => { res.end(pac); }); const { url } = await listen(server); - const config = { mode: 'pac_script' as any, pacScript: url }; + const config = { mode: 'pac_script' as const, pacScript: url }; await customSession.setProxy(config); { const proxy = await customSession.resolveProxy('https://google.com'); diff --git a/spec/api-system-preferences-spec.ts b/spec/api-system-preferences-spec.ts index 6a9395f5e9..ab4f33b171 100644 --- a/spec/api-system-preferences-spec.ts +++ b/spec/api-system-preferences-spec.ts @@ -29,7 +29,7 @@ describe('systemPreferences module', () => { { key: 'one', type: 'string', value: 'ONE' }, { key: 'two', value: 2, type: 'integer' }, { key: 'three', value: [1, 2, 3], type: 'array' } - ]; + ] as const; const defaultsDict: Record<string, any> = {}; defaultsMap.forEach(row => { defaultsDict[row.key] = row.value; }); @@ -38,7 +38,7 @@ describe('systemPreferences module', () => { for (const userDefault of defaultsMap) { const { key, value: expectedValue, type } = userDefault; - const actualValue = systemPreferences.getUserDefault(key, type as any); + const actualValue = systemPreferences.getUserDefault(key, type); expect(actualValue).to.deep.equal(expectedValue); } }); @@ -91,12 +91,12 @@ describe('systemPreferences module', () => { ['url', 'https://github.com/electron'], ['array', [1, 2, 3]], ['dictionary', { a: 1, b: 2 }] - ]; + ] as const; it('sets values', () => { for (const [type, value] of TEST_CASES) { - systemPreferences.setUserDefault(KEY, type as any, value as any); - const retrievedValue = systemPreferences.getUserDefault(KEY, type as any); + systemPreferences.setUserDefault(KEY, type, value as any); + const retrievedValue = systemPreferences.getUserDefault(KEY, type); expect(retrievedValue).to.deep.equal(value); } }); @@ -104,7 +104,7 @@ describe('systemPreferences module', () => { it('throws when type and value conflict', () => { for (const [type, value] of TEST_CASES) { expect(() => { - systemPreferences.setUserDefault(KEY, type as any, typeof value === 'string' ? {} : 'foo' as any); + systemPreferences.setUserDefault(KEY, type, typeof value === 'string' ? {} : 'foo' as any); }).to.throw(`Unable to convert value to: ${type}`); } }); @@ -158,10 +158,10 @@ describe('systemPreferences module', () => { }); it('returns a valid system color', () => { - const colors = ['blue', 'brown', 'gray', 'green', 'orange', 'pink', 'purple', 'red', 'yellow']; + const colors = ['blue', 'brown', 'gray', 'green', 'orange', 'pink', 'purple', 'red', 'yellow'] as const; colors.forEach(color => { - const sysColor = systemPreferences.getSystemColor(color as any); + const sysColor = systemPreferences.getSystemColor(color); expect(sysColor).to.be.a('string'); }); }); diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index aeb2a11349..38f77ece94 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -1280,9 +1280,9 @@ describe('webContents module', () => { 'default_public_interface_only', 'default_public_and_private_interfaces', 'disable_non_proxied_udp' - ]; + ] as const; policies.forEach((policy) => { - w.webContents.setWebRTCIPHandlingPolicy(policy as any); + w.webContents.setWebRTCIPHandlingPolicy(policy); expect(w.webContents.getWebRTCIPHandlingPolicy()).to.equal(policy); }); }); @@ -2254,7 +2254,7 @@ describe('webContents module', () => { const promise = once(w.webContents, 'context-menu') as Promise<[any, Electron.ContextMenuParams]>; // Simulate right-click to create context-menu event. - const opts = { x: 0, y: 0, button: 'right' as any }; + const opts = { x: 0, y: 0, button: 'right' as const }; w.webContents.sendInputEvent({ ...opts, type: 'mouseDown' }); w.webContents.sendInputEvent({ ...opts, type: 'mouseUp' });
test
679ce632a99d35e42ee3c42be5cb05401bd2af77
John Kleinschmidt
2022-11-22 16:57:49
build: fixup appveyor image for release (#36429) * build: make sure symstore is in the PATH when baking an image * build: update to use fixed baked image * cleanup sdk install
diff --git a/appveyor.yml b/appveyor.yml index 4c13990ed6..ab1f31e293 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,7 +25,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-110.0.5415.0 +image: e-110.0.5415.0-fix environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default diff --git a/script/setup-win-for-dev.bat b/script/setup-win-for-dev.bat index 8a4744602a..2b5fb9a2ea 100644 --- a/script/setup-win-for-dev.bat +++ b/script/setup-win-for-dev.bat @@ -1,7 +1,6 @@ REM Parameters vs_buildtools.exe download link and wsdk version @ECHO OFF -SET wsdk10_link=https://go.microsoft.com/fwlink/?linkid=2164145 SET wsdk=10SDK.20348 REM Check for disk space @@ -54,16 +53,17 @@ REM Install Visual Studio Toolchain choco install visualstudio2019buildtools --package-parameters "--quiet --wait --norestart --nocache --installPath ""%ProgramFiles(x86)%/Microsoft Visual Studio/2019/Community"" --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.140 --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.MFC.ARM64 --add Microsoft.VisualStudio.Component.Windows%wsdk% --includeRecommended" REM Install Windows SDK -powershell -command "& { iwr %wsdk10_link% -OutFile C:\TEMP\wsdk10.exe }" -C:\TEMP\wsdk10.exe /features /quiet +choco install windows-sdk-10-version-2104-all REM Install nodejs python git and yarn needed dependencies choco install -y nodejs-lts python2 git yarn choco install python --version 3.7.9 -choco install windows-sdk-10-version-2004-windbg call C:\ProgramData\chocolatey\bin\RefreshEnv.cmd SET PATH=C:\Python27\;C:\Python27\Scripts;C:\Python39\;C:\Python39\Scripts;%PATH% REM Setup Depot Tools git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git C:\depot_tools -SET PATH=%PATH%;C:\depot_tools\ \ No newline at end of file +SET PATH=%PATH%;C:\depot_tools\ + +REM Add symstore to PATH permanently +setx path "%%path%%;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64" \ No newline at end of file
build
9d6d606192b1be9d82175ed7d61091856a362f10
John Kleinschmidt
2023-08-16 14:05:39
build: fixup libcxx zip (#39536)
diff --git a/build/zip_libcxx.py b/build/zip_libcxx.py index cf71cc1c27..35cc30a78f 100644 --- a/build/zip_libcxx.py +++ b/build/zip_libcxx.py @@ -30,8 +30,8 @@ def get_object_files(base_path, archive_name): def main(argv): dist_zip, = argv out_dir = os.path.dirname(dist_zip) - base_path_libcxx = os.path.join(out_dir, 'obj/third_party/libc++') - base_path_libcxxabi = os.path.join(out_dir, 'obj/third_party/libc++abi') + base_path_libcxx = os.path.join(out_dir, 'obj/buildtools/third_party/libc++') + base_path_libcxxabi = os.path.join(out_dir, 'obj/buildtools/third_party/libc++abi') object_files_libcxx = get_object_files(base_path_libcxx, 'libc++.a') object_files_libcxxabi = get_object_files(base_path_libcxxabi, 'libc++abi.a') with zipfile.ZipFile(
build
2a613cabaa29134435672146f645392b4f3b1178
Shelley Vohr
2024-08-05 09:56:18
refactor: migrate `electron_login_helper` to non-deprecated API (#43182) refactor: migrate electron_login_helper to non-deprecated API
diff --git a/shell/app/electron_login_helper.mm b/shell/app/electron_login_helper.mm index dbcb0c9958..a5d562547c 100644 --- a/shell/app/electron_login_helper.mm +++ b/shell/app/electron_login_helper.mm @@ -4,12 +4,6 @@ #import <Cocoa/Cocoa.h> -// launchApplication is deprecated; should be migrated to -// [NSWorkspace openApplicationAtURL:configuration:completionHandler:] -// UserNotifications.frameworks API -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - int main(int argc, char* argv[]) { @autoreleasepool { NSArray* pathComponents = @@ -17,11 +11,18 @@ int main(int argc, char* argv[]) { pathComponents = [pathComponents subarrayWithRange:NSMakeRange(0, [pathComponents count] - 4)]; NSString* path = [NSString pathWithComponents:pathComponents]; + NSURL* url = [NSURL fileURLWithPath:path]; - [[NSWorkspace sharedWorkspace] launchApplication:path]; + [[NSWorkspace sharedWorkspace] + openApplicationAtURL:url + configuration:NSWorkspaceOpenConfiguration.configuration + completionHandler:^(NSRunningApplication* app, NSError* error) { + if (error) { + NSLog(@"Failed to launch application: %@", error); + } else { + NSLog(@"Application launched successfully: %@", app); + } + }]; return 0; } } - -// -Wdeprecated-declarations -#pragma clang diagnostic pop
refactor
fe93f69e5a3f5d8f28b9834329590dce9a5c97f5
Milan Burda
2023-08-03 14:29:57
refactor: use Set instead of Array when appropriate (#39324)
diff --git a/lib/browser/init.ts b/lib/browser/init.ts index db29322a5e..19fc26c4f8 100644 --- a/lib/browser/init.ts +++ b/lib/browser/init.ts @@ -146,14 +146,14 @@ require('@electron/internal/browser/api/web-frame-main'); // Set main startup script of the app. const mainStartupScript = packageJson.main || 'index.js'; -const KNOWN_XDG_DESKTOP_VALUES = ['Pantheon', 'Unity:Unity7', 'pop:GNOME']; +const KNOWN_XDG_DESKTOP_VALUES = new Set(['Pantheon', 'Unity:Unity7', 'pop:GNOME']); function currentPlatformSupportsAppIndicator () { if (process.platform !== 'linux') return false; const currentDesktop = process.env.XDG_CURRENT_DESKTOP; if (!currentDesktop) return false; - if (KNOWN_XDG_DESKTOP_VALUES.includes(currentDesktop)) return true; + if (KNOWN_XDG_DESKTOP_VALUES.has(currentDesktop)) return true; // ubuntu based or derived session (default ubuntu one, communitheme…) supports // indicator too. if (/ubuntu/ig.test(currentDesktop)) return true; diff --git a/lib/browser/parse-features-string.ts b/lib/browser/parse-features-string.ts index 47b3f06a0b..a6d451ea93 100644 --- a/lib/browser/parse-features-string.ts +++ b/lib/browser/parse-features-string.ts @@ -26,7 +26,7 @@ const keysOfTypeNumberCompileTimeCheck: { [K in IntegerBrowserWindowOptionKeys] }; // Note `top` / `left` are special cases from the browser which we later convert // to y / x. -const keysOfTypeNumber = ['top', 'left', ...Object.keys(keysOfTypeNumberCompileTimeCheck)]; +const keysOfTypeNumber = new Set(['top', 'left', ...Object.keys(keysOfTypeNumberCompileTimeCheck)]); /** * Note that we only allow "0" and "1" boolean conversion when the type is known @@ -37,7 +37,7 @@ const keysOfTypeNumber = ['top', 'left', ...Object.keys(keysOfTypeNumberCompileT */ type CoercedValue = string | number | boolean; function coerce (key: string, value: string): CoercedValue { - if (keysOfTypeNumber.includes(key)) { + if (keysOfTypeNumber.has(key)) { return parseInt(value, 10); } diff --git a/script/nan-spec-runner.js b/script/nan-spec-runner.js index 2889f3290b..d8f8a644ed 100644 --- a/script/nan-spec-runner.js +++ b/script/nan-spec-runner.js @@ -108,12 +108,12 @@ async function main () { const onlyTests = args.only && args.only.split(','); - const DISABLED_TESTS = [ + const DISABLED_TESTS = new Set([ 'nannew-test.js', 'buffer-test.js' - ]; + ]); const testsToRun = fs.readdirSync(path.resolve(NAN_DIR, 'test', 'js')) - .filter(test => !DISABLED_TESTS.includes(test)) + .filter(test => !DISABLED_TESTS.has(test)) .filter(test => { return !onlyTests || onlyTests.includes(test) || onlyTests.includes(test.replace('.js', '')) || onlyTests.includes(test.replace('-test.js', '')); })
refactor
6ccb9861f666da08e6f99285514df4514d5409e2
Keeley Hammond
2024-06-06 12:09:50
build: increase fetch-deps (#42387) * build: use fetch-depth: 0 and fetch-tags * debug: readd tmate SSH debugging * build: run SSH by default, remove debug conditional * build: remove redundent fetch-tags * build: pin tmate to SHA * build: remove tmate action
diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 65dbcb5f94..0e41aea2a1 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -293,6 +293,7 @@ jobs: uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 with: path: src/electron + fetch-depth: 0 - name: Run Electron Only Hooks run: | echo "Running Electron Only Hooks"
build
83f0d2645e78d9ee28b6abab9de21d64b79b28d2
Shelley Vohr
2023-11-01 18:21:16
docs: document our Node.js versioning policy (#40373)
diff --git a/docs/tutorial/electron-timelines.md b/docs/tutorial/electron-timelines.md index ccdfb1bfe7..da973d0cca 100644 --- a/docs/tutorial/electron-timelines.md +++ b/docs/tutorial/electron-timelines.md @@ -49,12 +49,6 @@ check out our [Electron Versioning](./electron-versioning.md) doc. * Since Electron 6, Electron major versions have been targeting every other Chromium major version. Each Electron stable should happen on the same day as Chrome stable ([see blog post](https://www.electronjs.org/blog/12-week-cadence)). * Since Electron 16, Electron has been releasing major versions on an 8-week cadence in accordance to Chrome's change to a 4-week release cadence ([see blog post](https://www.electronjs.org/blog/8-week-cadence)). -:::info Chrome release dates - -Chromium has the own public release schedule [here](https://chromiumdash.appspot.com/schedule). - -::: - ## Version support policy :::info @@ -79,6 +73,38 @@ and the version prior to that receives the vast majority of those fixes as time and bandwidth warrants. The oldest supported release line will receive only security fixes directly. +### Chromium version support + +:::info Chromium release schedule + +Chromium's public release schedule is [here](https://chromiumdash.appspot.com/schedule). + +::: + +Electron targets Chromium even-number versions, releasing every 8 weeks in concert +with Chromium's 4-week release schedule. For example, Electron 26 uses Chromium 116, while Electron 27 uses Chromium 118. + +### Node.js version support + +Electron upgrades its `main` branch to even-number versions of Node.js when they enter Active LTS. The schedule +is as follows: + +<img src="https://raw.githubusercontent.com/nodejs/Release/main/schedule.svg?sanitize=true" alt="Releases"> + +As a rule, stable branches of Electron do not receive Node.js upgrades after they have been cut. +If Electron has recently updated its `main` branch to a new major version of Node.js, the next stable +branch to be cut will be released with the new version. + +Patch upgrades of Node that contain significant security or bug fixes, and are submitted +more than 2 weeks prior to a stable release date, will be accepted into an Electron alpha +or beta release branch. + +Minor upgrades of Node that contain significant security or bug fixes, and are submitted +more than 2 weeks prior to a stable release date may be accepted into an Electron alpha or +beta release branch on a case-by-case basis. These requests will be reviewed and voted on +by the [Releases Working Group](https://github.com/electron/governance/tree/main/wg-releases), +to ensure minimal disruption for developers who may be consuming alpha or beta releases. + ### Breaking API changes When an API is changed or removed in a way that breaks existing functionality, the
docs
463586a6c57e3ae49d6b730e00eb724bfb05371f
Shelley Vohr
2023-09-20 15:37:10
chore(deps): roll nan to pick up upstreams (#39916)
diff --git a/DEPS b/DEPS index 2407be7916..1a4195cc41 100644 --- a/DEPS +++ b/DEPS @@ -6,7 +6,7 @@ vars = { 'node_version': 'v18.17.1', 'nan_version': - '16fa32231e2ccd89d2804b3f765319128b20c4ac', + 'e14bdcd1f72d62bca1d541b66da43130384ec213', 'squirrel.mac_version': '0e5d146ba13101a1302d59ea6e6e0b3cace4ae38', 'reactiveobjc_version': diff --git a/package.json b/package.json index 4fc8bfaaa0..71595f639e 100644 --- a/package.json +++ b/package.json @@ -152,6 +152,6 @@ ] }, "resolutions": { - "nan": "nodejs/nan#4290e23af108328269fcd4fe174ad657ad7cdd96" + "nan": "nodejs/nan#e14bdcd1f72d62bca1d541b66da43130384ec213" } } diff --git a/patches/nan/.patches b/patches/nan/.patches index 768b37ca2a..3b26a94483 100644 --- a/patches/nan/.patches +++ b/patches/nan/.patches @@ -1,3 +1 @@ use_new_constructor_for_scriptorigin_when_17_x.patch -chore_remove_deprecated_accessorsignatures.patch -chore_fix_v8_data_internal_field_casting.patch diff --git a/patches/nan/chore_fix_v8_data_internal_field_casting.patch b/patches/nan/chore_fix_v8_data_internal_field_casting.patch deleted file mode 100644 index 730e4464a8..0000000000 --- a/patches/nan/chore_fix_v8_data_internal_field_casting.patch +++ /dev/null @@ -1,265 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr <[email protected]> -Date: Mon, 11 Sep 2023 23:39:55 +0200 -Subject: chore: fix v8::Data internal field casting - -Changed in https://chromium-review.googlesource.com/c/v8/v8/+/4834471 - -Adapt to upstream changes in v8::Object::GetInternalField() and -v8::Object::SetInternalField() to accept v8::Data instead of just -v8::Value. - -diff --git a/nan_callbacks_12_inl.h b/nan_callbacks_12_inl.h -index c27b18d80d1299ff2142606d333804696bc17f93..2c734137fa1a5f8c6341e045f488fdcde5d040ef 100644 ---- a/nan_callbacks_12_inl.h -+++ b/nan_callbacks_12_inl.h -@@ -170,9 +170,9 @@ void FunctionCallbackWrapper(const v8::FunctionCallbackInfo<v8::Value> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - FunctionCallback callback = reinterpret_cast<FunctionCallback>( - reinterpret_cast<intptr_t>( -- obj->GetInternalField(kFunctionIndex).As<v8::External>()->Value())); -+ obj->GetInternalField(kFunctionIndex).As<v8::Value>().As<v8::External>()->Value())); - FunctionCallbackInfo<v8::Value> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - callback(cbinfo); - } - -@@ -185,10 +185,10 @@ void GetterCallbackWrapper( - , const v8::PropertyCallbackInfo<v8::Value> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Value> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - GetterCallback callback = reinterpret_cast<GetterCallback>( - reinterpret_cast<intptr_t>( -- obj->GetInternalField(kGetterIndex).As<v8::External>()->Value())); -+ obj->GetInternalField(kGetterIndex).As<v8::Value>().As<v8::External>()->Value())); - callback(property.As<v8::String>(), cbinfo); - } - -@@ -202,10 +202,10 @@ void SetterCallbackWrapper( - , const v8::PropertyCallbackInfo<void> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<void> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - SetterCallback callback = reinterpret_cast<SetterCallback>( - reinterpret_cast<intptr_t>( -- obj->GetInternalField(kSetterIndex).As<v8::External>()->Value())); -+ obj->GetInternalField(kSetterIndex).As<v8::Value>().As<v8::External>()->Value())); - callback(property.As<v8::String>(), value, cbinfo); - } - -@@ -220,10 +220,10 @@ void GetterCallbackWrapper( - , const v8::PropertyCallbackInfo<v8::Value> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Value> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - GetterCallback callback = reinterpret_cast<GetterCallback>( - reinterpret_cast<intptr_t>( -- obj->GetInternalField(kGetterIndex).As<v8::External>()->Value())); -+ obj->GetInternalField(kGetterIndex).As<v8::Value>().As<v8::External>()->Value())); - callback(property, cbinfo); - } - -@@ -237,10 +237,10 @@ void SetterCallbackWrapper( - , const v8::PropertyCallbackInfo<void> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<void> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - SetterCallback callback = reinterpret_cast<SetterCallback>( - reinterpret_cast<intptr_t>( -- obj->GetInternalField(kSetterIndex).As<v8::External>()->Value())); -+ obj->GetInternalField(kSetterIndex).As<v8::Value>().As<v8::External>()->Value())); - callback(property, value, cbinfo); - } - -@@ -257,11 +257,11 @@ void PropertyGetterCallbackWrapper( - , const v8::PropertyCallbackInfo<v8::Value> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Value> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - PropertyGetterCallback callback = reinterpret_cast<PropertyGetterCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kPropertyGetterIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(property.As<v8::String>(), cbinfo); - } - -@@ -275,11 +275,11 @@ void PropertySetterCallbackWrapper( - , const v8::PropertyCallbackInfo<v8::Value> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Value> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - PropertySetterCallback callback = reinterpret_cast<PropertySetterCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kPropertySetterIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(property.As<v8::String>(), value, cbinfo); - } - -@@ -293,11 +293,11 @@ void PropertyEnumeratorCallbackWrapper( - const v8::PropertyCallbackInfo<v8::Array> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Array> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - PropertyEnumeratorCallback callback = - reinterpret_cast<PropertyEnumeratorCallback>(reinterpret_cast<intptr_t>( - obj->GetInternalField(kPropertyEnumeratorIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(cbinfo); - } - -@@ -310,11 +310,11 @@ void PropertyDeleterCallbackWrapper( - , const v8::PropertyCallbackInfo<v8::Boolean> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Boolean> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - PropertyDeleterCallback callback = reinterpret_cast<PropertyDeleterCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kPropertyDeleterIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(property.As<v8::String>(), cbinfo); - } - -@@ -327,11 +327,11 @@ void PropertyQueryCallbackWrapper( - , const v8::PropertyCallbackInfo<v8::Integer> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Integer> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - PropertyQueryCallback callback = reinterpret_cast<PropertyQueryCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kPropertyQueryIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(property.As<v8::String>(), cbinfo); - } - -@@ -344,11 +344,11 @@ void PropertyGetterCallbackWrapper( - , const v8::PropertyCallbackInfo<v8::Value> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Value> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - PropertyGetterCallback callback = reinterpret_cast<PropertyGetterCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kPropertyGetterIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(property, cbinfo); - } - -@@ -384,7 +384,7 @@ void PropertyEnumeratorCallbackWrapper( - PropertyEnumeratorCallback callback = - reinterpret_cast<PropertyEnumeratorCallback>(reinterpret_cast<intptr_t>( - obj->GetInternalField(kPropertyEnumeratorIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(cbinfo); - } - -@@ -401,7 +401,7 @@ void PropertyDeleterCallbackWrapper( - PropertyDeleterCallback callback = reinterpret_cast<PropertyDeleterCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kPropertyDeleterIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(property, cbinfo); - } - -@@ -414,11 +414,11 @@ void PropertyQueryCallbackWrapper( - , const v8::PropertyCallbackInfo<v8::Integer> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Integer> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - PropertyQueryCallback callback = reinterpret_cast<PropertyQueryCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kPropertyQueryIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(property, cbinfo); - } - -@@ -431,11 +431,11 @@ void IndexGetterCallbackWrapper( - uint32_t index, const v8::PropertyCallbackInfo<v8::Value> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Value> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - IndexGetterCallback callback = reinterpret_cast<IndexGetterCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kIndexPropertyGetterIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(index, cbinfo); - } - -@@ -449,11 +449,11 @@ void IndexSetterCallbackWrapper( - , const v8::PropertyCallbackInfo<v8::Value> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Value> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - IndexSetterCallback callback = reinterpret_cast<IndexSetterCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kIndexPropertySetterIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(index, value, cbinfo); - } - -@@ -467,11 +467,11 @@ void IndexEnumeratorCallbackWrapper( - const v8::PropertyCallbackInfo<v8::Array> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Array> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - IndexEnumeratorCallback callback = reinterpret_cast<IndexEnumeratorCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField( -- kIndexPropertyEnumeratorIndex).As<v8::External>()->Value())); -+ kIndexPropertyEnumeratorIndex).As<v8::Value>().As<v8::External>()->Value())); - callback(cbinfo); - } - -@@ -483,11 +483,11 @@ void IndexDeleterCallbackWrapper( - uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Boolean> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - IndexDeleterCallback callback = reinterpret_cast<IndexDeleterCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kIndexPropertyDeleterIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(index, cbinfo); - } - -@@ -499,11 +499,11 @@ void IndexQueryCallbackWrapper( - uint32_t index, const v8::PropertyCallbackInfo<v8::Integer> &info) { - v8::Local<v8::Object> obj = info.Data().As<v8::Object>(); - PropertyCallbackInfo<v8::Integer> -- cbinfo(info, obj->GetInternalField(kDataIndex)); -+ cbinfo(info, obj->GetInternalField(kDataIndex).As<v8::Value>()); - IndexQueryCallback callback = reinterpret_cast<IndexQueryCallback>( - reinterpret_cast<intptr_t>( - obj->GetInternalField(kIndexPropertyQueryIndex) -- .As<v8::External>()->Value())); -+ .As<v8::Value>().As<v8::External>()->Value())); - callback(index, cbinfo); - } - diff --git a/patches/nan/chore_remove_deprecated_accessorsignatures.patch b/patches/nan/chore_remove_deprecated_accessorsignatures.patch deleted file mode 100644 index 8cd9f20001..0000000000 --- a/patches/nan/chore_remove_deprecated_accessorsignatures.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr <[email protected]> -Date: Thu, 2 Jun 2022 15:45:21 +0200 -Subject: chore: remove deprecated AccessorSignatures - -Removed in https://chromium-review.googlesource.com/c/v8/v8/+/3654096 -Upstreamed to nan: https://github.com/nodejs/nan/pull/941 - -diff --git a/nan.h b/nan.h -index df5496c1a001120d10cd7c4b87d5e7bce8169f38..c29a99b79970421a15c5520a94ab65b1c3c473ff 100644 ---- a/nan.h -+++ b/nan.h -@@ -2516,8 +2516,7 @@ inline void SetAccessor( - , SetterCallback setter = 0 - , v8::Local<v8::Value> data = v8::Local<v8::Value>() - , v8::AccessControl settings = v8::DEFAULT -- , v8::PropertyAttribute attribute = v8::None -- , imp::Sig signature = imp::Sig()) { -+ , v8::PropertyAttribute attribute = v8::None) { - HandleScope scope; - - imp::NativeGetter getter_ = -@@ -2550,9 +2549,6 @@ inline void SetAccessor( - , obj - , settings - , attribute --#if (NODE_MODULE_VERSION < NODE_18_0_MODULE_VERSION) -- , signature --#endif - ); - } - -diff --git a/nan_callbacks.h b/nan_callbacks.h -index 53ede846ac9a865a737218dabbbd48305d3d6b63..ea81e452d364e3d3c15a121dc69ae21134bfb586 100644 ---- a/nan_callbacks.h -+++ b/nan_callbacks.h -@@ -52,8 +52,6 @@ typedef void(*IndexQueryCallback)( - const PropertyCallbackInfo<v8::Integer>&); - - namespace imp { --typedef v8::Local<v8::AccessorSignature> Sig; -- - static const int kDataIndex = 0; - - static const int kFunctionIndex = 1; diff --git a/spec/package.json b/spec/package.json index 8048087796..34e7e5ee0e 100644 --- a/spec/package.json +++ b/spec/package.json @@ -39,7 +39,7 @@ "yargs": "^16.0.3" }, "resolutions": { - "nan": "nodejs/nan#4290e23af108328269fcd4fe174ad657ad7cdd96", + "nan": "nodejs/nan#e14bdcd1f72d62bca1d541b66da43130384ec213", "dbus-native/optimist/minimist": "1.2.7", "dbus-native/xml2js": "0.5.0" }
chore
e543126957bfd15c06722e7ba7b5a50a814af918
John Kleinschmidt
2023-07-24 16:38:34
ci: fail appveyor build if artifacts are missing (#39210)
diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 5dc86b92c3..2b5f135a0e 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -203,16 +203,28 @@ for: on_finish: # Uncomment this lines to enable RDP # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - - cd C:\projects\src - - if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json ) - - if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip) - - if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe) - - if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip) - - if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip) - - if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip) - - if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip) - - if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip) - - if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib) + - ps: | + cd C:\projects\src + $missing_artifacts = $false + $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') + foreach($artifact_name in $artifacts_to_upload) { + if ($artifact_name -eq 'ffmpeg.zip') { + $artifact_file = "out\ffmpeg\ffmpeg.zip" + } elseif ($artifact_name -eq 'node_headers.zip') { + $artifact_file = $artifact_name + } else { + $artifact_file = "out\Default\$artifact_name" + } + if (Test-Path $artifact_file) { + appveyor-retry appveyor PushArtifact $artifact_file + } else { + Write-warning "$artifact_name is missing and cannot be added to artifacts" + $missing_artifacts = $true + } + } + if ($missing_artifacts) { + throw "Build failed due to missing artifacts" + } - ps: >- if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) { appveyor-retry appveyor PushArtifact pdb.zip @@ -245,7 +257,7 @@ for: # Download build artifacts $apiUrl = 'https://ci.appveyor.com/api' $build_info = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID" - $artifacts_to_download = @('dist.zip','ffmpeg.zip','node_headers.zip','pdb.zip','electron.lib') + $artifacts_to_download = @('dist.zip','ffmpeg.zip','node_headers.zip','electron.lib') foreach ($job in $build_info.build.jobs) { if ($job.name -eq "Build Arm on X64 Windows") { $jobId = $job.jobId @@ -257,10 +269,13 @@ for: } Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile } + # Uncomment the following lines to download the pdb.zip to show real stacktraces when crashes happen during testing + # Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/pdb.zip" -OutFile pdb.zip + # 7z x -y -osrc pdb.zip } } - ps: | - $out_default_zips = @('dist.zip','pdb.zip') + $out_default_zips = @('dist.zip') foreach($zip_name in $out_default_zips) { 7z x -y -osrc\out\Default $zip_name } diff --git a/appveyor.yml b/appveyor.yml index 5fd4ff2893..43673d5813 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -201,16 +201,28 @@ for: on_finish: # Uncomment this lines to enable RDP # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - - cd C:\projects\src - - if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json ) - - if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip) - - if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe) - - if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip) - - if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip) - - if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip) - - if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip) - - if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip) - - if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib) + - ps: | + cd C:\projects\src + $missing_artifacts = $false + $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') + foreach($artifact_name in $artifacts_to_upload) { + if ($artifact_name -eq 'ffmpeg.zip') { + $artifact_file = "out\ffmpeg\ffmpeg.zip" + } elseif ($artifact_name -eq 'node_headers.zip') { + $artifact_file = $artifact_name + } else { + $artifact_file = "out\Default\$artifact_name" + } + if (Test-Path $artifact_file) { + appveyor-retry appveyor PushArtifact $artifact_file + } else { + Write-warning "$artifact_name is missing and cannot be added to artifacts" + $missing_artifacts = $true + } + } + if ($missing_artifacts) { + throw "Build failed due to missing artifacts" + } - ps: >- if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) { appveyor-retry appveyor PushArtifact pdb.zip @@ -253,6 +265,9 @@ for: } Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile } + # Uncomment the following lines to download the pdb.zip to show real stacktraces when crashes happen during testing + # Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/pdb.zip" -OutFile pdb.zip + # 7z x -y -osrc pdb.zip } } - ps: |
ci
42862347218b61b01c4891036d84ecda0b6a86d6
Alice Zhao
2024-07-29 04:00:51
fix: redirect webview navigation methods (#42981)
diff --git a/lib/browser/guest-view-manager.ts b/lib/browser/guest-view-manager.ts index 6b82328472..e2b1a39e61 100644 --- a/lib/browser/guest-view-manager.ts +++ b/lib/browser/guest-view-manager.ts @@ -2,7 +2,7 @@ import { webContents } from 'electron/main'; import { ipcMainInternal } from '@electron/internal/browser/ipc-main-internal'; import * as ipcMainUtils from '@electron/internal/browser/ipc-main-internal-utils'; import { parseWebViewWebPreferences } from '@electron/internal/browser/parse-features-string'; -import { syncMethods, asyncMethods, properties } from '@electron/internal/common/web-view-methods'; +import { syncMethods, asyncMethods, properties, navigationHistorySyncMethods } from '@electron/internal/common/web-view-methods'; import { webViewEvents } from '@electron/internal/browser/web-view-events'; import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages'; @@ -311,6 +311,14 @@ handleMessageSync(IPC_MESSAGES.GUEST_VIEW_MANAGER_CALL, function (event, guestIn if (!syncMethods.has(method)) { throw new Error(`Invalid method: ${method}`); } + // Redirect history methods to updated navigationHistory property on webContents. See issue #42879. + if (navigationHistorySyncMethods.has(method)) { + let navigationMethod = method; + if (method === 'clearHistory') { + navigationMethod = 'clear'; + } + return (guest as any).navigationHistory[navigationMethod](...args); + } return (guest as any)[method](...args); }); diff --git a/lib/common/web-view-methods.ts b/lib/common/web-view-methods.ts index 81fc88f1f8..f0f4fb4bad 100644 --- a/lib/common/web-view-methods.ts +++ b/lib/common/web-view-methods.ts @@ -1,3 +1,14 @@ +export const navigationHistorySyncMethods = new Set([ + 'canGoBack', + 'canGoForward', + 'canGoToOffset', + 'clearHistory', + 'goBack', + 'goForward', + 'goToIndex', + 'goToOffset' +]); + // Public-facing API methods. export const syncMethods = new Set([ 'getURL', @@ -8,14 +19,6 @@ export const syncMethods = new Set([ 'stop', 'reload', 'reloadIgnoringCache', - 'canGoBack', - 'canGoForward', - 'canGoToOffset', - 'clearHistory', - 'goBack', - 'goForward', - 'goToIndex', - 'goToOffset', 'isCrashed', 'setUserAgent', 'getUserAgent', @@ -51,7 +54,8 @@ export const syncMethods = new Set([ 'getZoomFactor', 'getZoomLevel', 'setZoomFactor', - 'setZoomLevel' + 'setZoomLevel', + ...navigationHistorySyncMethods ]); export const properties = new Set([
fix
3d2f68a9df2946074e4412b8ab31d4468a4baf9f
Charles Kerr
2024-10-10 08:34:55
refactor: spanify image utils (#44127) * refactor: electron::util::AddImageSkiaRepFromJPEG() takes a span arg * refactor: electron::util::AddImageSkiaRepFromPNG() takes a span arg * refactor: electron::util::AddImageSkiaRepFromBuffer() takes a span arg * feat: add Node-buffer-to-base-span helper function * refactor: electron::api::NativeImage::CreateFromPNG() now takes a span param * refactor: electron::api::NativeImage::CreateFromJPEG() now takes a span param * refactor: use base::as_byte_span() * fix: -Wunsafe-buffer-usage warning in NativeImage::CreateFromNamedImage() Warning fixed by this commit: ../../electron/shell/common/api/electron_api_native_image_mac.mm:131:11: error: function introduces unsafe buffer manipulation [-Werror,-Wunsafe-buffer-usage] 131 | {reinterpret_cast<const uint8_t*>((char*)[png_data bytes]), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 132 | [png_data length]}); | ~~~~~~~~~~~~~~~~~~ ../../electron/shell/common/api/electron_api_native_image_mac.mm:131:11: note: See //docs/unsafe_buffers.md for help. * chore: add // SAFETY comment for Node-buffer-to-span func * chore: add // SAFETY comment for NSData-to-span func
diff --git a/shell/common/api/electron_api_native_image.cc b/shell/common/api/electron_api_native_image.cc index f1a9eb11ab..dc02006b19 100644 --- a/shell/common/api/electron_api_native_image.cc +++ b/shell/common/api/electron_api_native_image.cc @@ -30,6 +30,7 @@ #include "shell/common/gin_helper/function_template_extensions.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/node_includes.h" +#include "shell/common/node_util.h" #include "shell/common/process_util.h" #include "shell/common/skia_util.h" #include "shell/common/thread_restrictions.h" @@ -397,20 +398,18 @@ void NativeImage::AddRepresentation(const gin_helper::Dictionary& options) { v8::Local<v8::Value> buffer; GURL url; if (options.Get("buffer", &buffer) && node::Buffer::HasInstance(buffer)) { - auto* data = reinterpret_cast<unsigned char*>(node::Buffer::Data(buffer)); - auto size = node::Buffer::Length(buffer); skia_rep_added = electron::util::AddImageSkiaRepFromBuffer( - &image_skia, data, size, width, height, scale_factor); + &image_skia, electron::util::as_byte_span(buffer), width, height, + scale_factor); } else if (options.Get("dataURL", &url)) { std::string mime_type, charset, data; if (net::DataURL::Parse(url, &mime_type, &charset, &data)) { - auto* data_ptr = reinterpret_cast<const unsigned char*>(data.c_str()); if (mime_type == "image/png") { skia_rep_added = electron::util::AddImageSkiaRepFromPNG( - &image_skia, data_ptr, data.size(), scale_factor); + &image_skia, base::as_byte_span(data), scale_factor); } else if (mime_type == "image/jpeg") { skia_rep_added = electron::util::AddImageSkiaRepFromJPEG( - &image_skia, data_ptr, data.size(), scale_factor); + &image_skia, base::as_byte_span(data), scale_factor); } } } @@ -442,22 +441,20 @@ gin::Handle<NativeImage> NativeImage::Create(v8::Isolate* isolate, } // static -gin::Handle<NativeImage> NativeImage::CreateFromPNG(v8::Isolate* isolate, - const char* buffer, - size_t length) { +gin::Handle<NativeImage> NativeImage::CreateFromPNG( + v8::Isolate* isolate, + const base::span<const uint8_t> data) { gfx::ImageSkia image_skia; - electron::util::AddImageSkiaRepFromPNG( - &image_skia, reinterpret_cast<const unsigned char*>(buffer), length, 1.0); + electron::util::AddImageSkiaRepFromPNG(&image_skia, data, 1.0); return Create(isolate, gfx::Image(image_skia)); } // static -gin::Handle<NativeImage> NativeImage::CreateFromJPEG(v8::Isolate* isolate, - const char* buffer, - size_t length) { +gin::Handle<NativeImage> NativeImage::CreateFromJPEG( + v8::Isolate* isolate, + const base::span<const uint8_t> buffer) { gfx::ImageSkia image_skia; - electron::util::AddImageSkiaRepFromJPEG( - &image_skia, reinterpret_cast<const unsigned char*>(buffer), length, 1.0); + electron::util::AddImageSkiaRepFromJPEG(&image_skia, buffer, 1.0); return Create(isolate, gfx::Image(image_skia)); } @@ -509,7 +506,8 @@ gin::Handle<NativeImage> NativeImage::CreateFromBitmap( auto info = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType); auto size_bytes = info.computeMinByteSize(); - if (size_bytes != node::Buffer::Length(buffer)) { + const auto buffer_data = electron::util::as_byte_span(buffer); + if (size_bytes != buffer_data.size()) { thrower.ThrowError("invalid buffer size"); return gin::Handle<NativeImage>(); } @@ -522,7 +520,7 @@ gin::Handle<NativeImage> NativeImage::CreateFromBitmap( SkBitmap bitmap; bitmap.allocN32Pixels(width, height, false); - bitmap.writePixels({info, node::Buffer::Data(buffer), bitmap.rowBytes()}); + bitmap.writePixels({info, buffer_data.data(), bitmap.rowBytes()}); gfx::ImageSkia image_skia = gfx::ImageSkia::CreateFromBitmap(bitmap, scale_factor); @@ -553,8 +551,8 @@ gin::Handle<NativeImage> NativeImage::CreateFromBuffer( gfx::ImageSkia image_skia; electron::util::AddImageSkiaRepFromBuffer( - &image_skia, reinterpret_cast<unsigned char*>(node::Buffer::Data(buffer)), - node::Buffer::Length(buffer), width, height, scale_factor); + &image_skia, electron::util::as_byte_span(buffer), width, height, + scale_factor); return Create(args->isolate(), gfx::Image(image_skia)); } @@ -564,9 +562,9 @@ gin::Handle<NativeImage> NativeImage::CreateFromDataURL(v8::Isolate* isolate, std::string mime_type, charset, data; if (net::DataURL::Parse(url, &mime_type, &charset, &data)) { if (mime_type == "image/png") - return CreateFromPNG(isolate, data.c_str(), data.size()); - else if (mime_type == "image/jpeg") - return CreateFromJPEG(isolate, data.c_str(), data.size()); + return CreateFromPNG(isolate, base::as_byte_span(data)); + if (mime_type == "image/jpeg") + return CreateFromJPEG(isolate, base::as_byte_span(data)); } return CreateEmpty(isolate); diff --git a/shell/common/api/electron_api_native_image.h b/shell/common/api/electron_api_native_image.h index 3b82956f82..ab8929a153 100644 --- a/shell/common/api/electron_api_native_image.h +++ b/shell/common/api/electron_api_native_image.h @@ -9,6 +9,7 @@ #include <vector> #include "base/containers/flat_map.h" +#include "base/containers/span.h" #include "base/memory/raw_ptr.h" #include "base/values.h" #include "gin/wrappable.h" @@ -61,11 +62,10 @@ class NativeImage final : public gin::Wrappable<NativeImage> { static gin::Handle<NativeImage> Create(v8::Isolate* isolate, const gfx::Image& image); static gin::Handle<NativeImage> CreateFromPNG(v8::Isolate* isolate, - const char* buffer, - size_t length); - static gin::Handle<NativeImage> CreateFromJPEG(v8::Isolate* isolate, - const char* buffer, - size_t length); + base::span<const uint8_t> data); + static gin::Handle<NativeImage> CreateFromJPEG( + v8::Isolate* isolate, + base::span<const uint8_t> data); static gin::Handle<NativeImage> CreateFromPath(v8::Isolate* isolate, const base::FilePath& path); static gin::Handle<NativeImage> CreateFromBitmap( diff --git a/shell/common/api/electron_api_native_image_mac.mm b/shell/common/api/electron_api_native_image_mac.mm index df151d97ec..2b7b18c60a 100644 --- a/shell/common/api/electron_api_native_image_mac.mm +++ b/shell/common/api/electron_api_native_image_mac.mm @@ -26,6 +26,19 @@ namespace electron::api { +namespace { + +base::span<const uint8_t> as_byte_span(NSData* data) { + // SAFETY: There is no NSData API that passes the UNSAFE_BUFFER_USAGE + // test, so let's isolate the unsafe API use into this function. Instead of + // calling '[data bytes]' and '[data length]' directly, the rest of our + // code should prefer to use spans returned by this function. + return UNSAFE_BUFFERS(base::span{ + reinterpret_cast<const uint8_t*>([data bytes]), [data length]}); +} + +} // namespace + NSData* bufferFromNSImage(NSImage* image) { CGImageRef ref = [image CGImageForProposedRect:nil context:nil hints:nil]; NSBitmapImageRep* rep = [[NSBitmapImageRep alloc] initWithCGImage:ref]; @@ -127,9 +140,7 @@ gin::Handle<NativeImage> NativeImage::CreateFromNamedImage(gin::Arguments* args, NSData* png_data = bufferFromNSImage(image); if (args->GetNext(&hsl_shift) && hsl_shift.size() == 3) { - gfx::Image gfx_image = gfx::Image::CreateFrom1xPNGBytes( - {reinterpret_cast<const uint8_t*>((char*)[png_data bytes]), - [png_data length]}); + auto gfx_image = gfx::Image::CreateFrom1xPNGBytes(as_byte_span(png_data)); color_utils::HSL shift = {safeShift(hsl_shift[0], -1), safeShift(hsl_shift[1], 0.5), safeShift(hsl_shift[2], 0.5)}; @@ -139,8 +150,7 @@ gin::Handle<NativeImage> NativeImage::CreateFromNamedImage(gin::Arguments* args, .AsNSImage()); } - return CreateFromPNG(args->isolate(), (char*)[png_data bytes], - [png_data length]); + return CreateFromPNG(args->isolate(), as_byte_span(png_data)); } } diff --git a/shell/common/node_util.cc b/shell/common/node_util.cc index d75208a929..da5b605e4d 100644 --- a/shell/common/node_util.cc +++ b/shell/common/node_util.cc @@ -4,6 +4,7 @@ #include "shell/common/node_util.h" +#include "base/compiler_specific.h" #include "base/logging.h" #include "gin/converter.h" #include "gin/dictionary.h" @@ -65,4 +66,14 @@ void EmitWarning(v8::Isolate* isolate, emit_warning.Run(warning_msg, warning_type, ""); } +// SAFETY: There is no node::Buffer API that passes the UNSAFE_BUFFER_USAGE +// test, so let's isolate the unsafe API use into this function. Instead of +// calling `Buffer::Data()` and `Buffer::Length()` directly, the rest of our +// code should prefer to use spans returned by this function. +base::span<uint8_t> as_byte_span(v8::Local<v8::Value> node_buffer) { + auto* data = reinterpret_cast<uint8_t*>(node::Buffer::Data(node_buffer)); + const auto size = node::Buffer::Length(node_buffer); + return UNSAFE_BUFFERS(base::span{data, size}); +} + } // namespace electron::util diff --git a/shell/common/node_util.h b/shell/common/node_util.h index 029a7452e9..d403db9dc3 100644 --- a/shell/common/node_util.h +++ b/shell/common/node_util.h @@ -8,6 +8,7 @@ #include <string_view> #include <vector> +#include "base/containers/span.h" #include "v8/include/v8-forward.h" namespace node { @@ -36,6 +37,11 @@ v8::MaybeLocal<v8::Value> CompileAndCall( std::vector<v8::Local<v8::String>>* parameters, std::vector<v8::Local<v8::Value>>* arguments); +// Convenience function to view a Node buffer's data as a base::span(). +// Analogous to base::as_byte_span() +[[nodiscard]] base::span<uint8_t> as_byte_span( + v8::Local<v8::Value> node_buffer); + } // namespace electron::util #endif // ELECTRON_SHELL_COMMON_NODE_UTIL_H_ diff --git a/shell/common/skia_util.cc b/shell/common/skia_util.cc index bbc7c33f0e..b80b1c53f8 100644 --- a/shell/common/skia_util.cc +++ b/shell/common/skia_util.cc @@ -56,11 +56,10 @@ float GetScaleFactorFromPath(const base::FilePath& path) { } bool AddImageSkiaRepFromPNG(gfx::ImageSkia* image, - const unsigned char* data, - size_t size, + const base::span<const uint8_t> data, double scale_factor) { SkBitmap bitmap; - if (!gfx::PNGCodec::Decode(data, size, &bitmap)) + if (!gfx::PNGCodec::Decode(data.data(), data.size(), &bitmap)) return false; image->AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor)); @@ -68,10 +67,9 @@ bool AddImageSkiaRepFromPNG(gfx::ImageSkia* image, } bool AddImageSkiaRepFromJPEG(gfx::ImageSkia* image, - const unsigned char* data, - size_t size, + const base::span<const uint8_t> data, double scale_factor) { - auto bitmap = gfx::JPEGCodec::Decode(data, size); + auto bitmap = gfx::JPEGCodec::Decode(data.data(), data.size()); if (!bitmap) return false; @@ -89,29 +87,28 @@ bool AddImageSkiaRepFromJPEG(gfx::ImageSkia* image, } bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image, - const unsigned char* data, - size_t size, + const base::span<const uint8_t> data, int width, int height, double scale_factor) { // Try PNG first. - if (AddImageSkiaRepFromPNG(image, data, size, scale_factor)) + if (AddImageSkiaRepFromPNG(image, data, scale_factor)) return true; // Try JPEG second. - if (AddImageSkiaRepFromJPEG(image, data, size, scale_factor)) + if (AddImageSkiaRepFromJPEG(image, data, scale_factor)) return true; if (width == 0 || height == 0) return false; auto info = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType); - if (size < info.computeMinByteSize()) + if (data.size() < info.computeMinByteSize()) return false; SkBitmap bitmap; bitmap.allocN32Pixels(width, height, false); - bitmap.writePixels({info, data, bitmap.rowBytes()}); + bitmap.writePixels({info, data.data(), bitmap.rowBytes()}); image->AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor)); return true; @@ -127,11 +124,8 @@ bool AddImageSkiaRepFromPath(gfx::ImageSkia* image, return false; } - const auto* data = - reinterpret_cast<const unsigned char*>(file_contents.data()); - size_t size = file_contents.size(); - - return AddImageSkiaRepFromBuffer(image, data, size, 0, 0, scale_factor); + return AddImageSkiaRepFromBuffer(image, base::as_byte_span(file_contents), 0, + 0, scale_factor); } bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image, diff --git a/shell/common/skia_util.h b/shell/common/skia_util.h index 2fd4376595..72f0a7a67e 100644 --- a/shell/common/skia_util.h +++ b/shell/common/skia_util.h @@ -5,9 +5,13 @@ #ifndef ELECTRON_SHELL_COMMON_SKIA_UTIL_H_ #define ELECTRON_SHELL_COMMON_SKIA_UTIL_H_ +#include <cstdint> + +#include "base/containers/span.h" + namespace base { class FilePath; -} +} // namespace base namespace gfx { class ImageSkia; @@ -19,20 +23,17 @@ bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image, const base::FilePath& path); bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image, - const unsigned char* data, - size_t size, + base::span<const uint8_t> data, int width, int height, double scale_factor); bool AddImageSkiaRepFromJPEG(gfx::ImageSkia* image, - const unsigned char* data, - size_t size, + base::span<const uint8_t> data, double scale_factor); bool AddImageSkiaRepFromPNG(gfx::ImageSkia* image, - const unsigned char* data, - size_t size, + base::span<const uint8_t> data, double scale_factor); #if BUILDFLAG(IS_WIN)
refactor
64b39dce14d701ea914ecde8d6139c901585e48e
David Sanders
2023-03-20 07:25:54
docs: update broken links (#37610)
diff --git a/docs/api/app.md b/docs/api/app.md index 9bae9c860d..054ece8caf 100755 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -1515,7 +1515,7 @@ A `boolean` property that returns `true` if the app is packaged, `false` otherw [electron-forge]: https://www.electronforge.io/ [electron-packager]: https://github.com/electron/electron-packager [CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115 -[LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme +[LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/documentation/coreservices/1441725-lscopydefaulthandlerforurlscheme?language=objc [handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html [activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType [unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher diff --git a/docs/api/notification.md b/docs/api/notification.md index 9731efca08..d68a4a5b93 100644 --- a/docs/api/notification.md +++ b/docs/api/notification.md @@ -160,7 +160,7 @@ A `boolean` property representing whether the notification has a reply action. A `string` property representing the urgency level of the notification. Can be 'normal', 'critical', or 'low'. -Default is 'low' - see [NotifyUrgency](https://developer.gnome.org/notification-spec/#urgency-levels) for more information. +Default is 'low' - see [NotifyUrgency](https://developer-old.gnome.org/notification-spec/#urgency-levels) for more information. #### `notification.timeoutType` _Linux_ _Windows_ diff --git a/docs/api/push-notifications.md b/docs/api/push-notifications.md index faf080fc5e..1cf8d88eb0 100644 --- a/docs/api/push-notifications.md +++ b/docs/api/push-notifications.md @@ -40,7 +40,7 @@ The `pushNotification` module has the following methods: Returns `Promise<string>` -Registers the app with Apple Push Notification service (APNS) to receive [Badge, Sound, and Alert](https://developer.apple.com/documentation/appkit/sremotenotificationtype?language=objc) notifications. If registration is successful, the promise will be resolved with the APNS device token. Otherwise, the promise will be rejected with an error message. +Registers the app with Apple Push Notification service (APNS) to receive [Badge, Sound, and Alert](https://developer.apple.com/documentation/appkit/nsremotenotificationtype?language=objc) notifications. If registration is successful, the promise will be resolved with the APNS device token. Otherwise, the promise will be rejected with an error message. See: https://developer.apple.com/documentation/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc ### `pushNotifications.unregisterForAPNSNotifications()` _macOS_ diff --git a/docs/development/creating-api.md b/docs/development/creating-api.md index f305ec0e54..97a523bce0 100644 --- a/docs/development/creating-api.md +++ b/docs/development/creating-api.md @@ -158,7 +158,7 @@ We will need to create a new TypeScript file in the path that follows: `"lib/browser/api/{electron_browser_{api_name}}.ts"` -An example of the contents of this file can be found [here](https://github.com/electron/electron/blob/main/lib/browser/api/native-image.ts). +An example of the contents of this file can be found [here](https://github.com/electron/electron/blob/main/lib/browser/api/native-theme.ts). ### Expose your module to TypeScript diff --git a/docs/development/debugging-on-windows.md b/docs/development/debugging-on-windows.md index aa047bf680..1e00f6776f 100644 --- a/docs/development/debugging-on-windows.md +++ b/docs/development/debugging-on-windows.md @@ -89,7 +89,7 @@ For an introduction to ProcMon's basic and advanced debugging features, go check out [this video tutorial][procmon-instructions] provided by Microsoft. [sys-internals]: https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx -[procmon-instructions]: https://channel9.msdn.com/shows/defrag-tools/defrag-tools-4-process-monitor +[procmon-instructions]: https://learn.microsoft.com/en-us/shows/defrag-tools/4-process-monitor ## Using WinDbg <!-- TODO(@codebytere): add images and more information here? --> diff --git a/docs/tutorial/code-signing.md b/docs/tutorial/code-signing.md index dff75072f5..fe9aaae00f 100644 --- a/docs/tutorial/code-signing.md +++ b/docs/tutorial/code-signing.md @@ -95,7 +95,7 @@ Before signing Windows builds, you must do the following: You can get a code signing certificate from a lot of resellers. Prices vary, so it may be worth your time to shop around. Popular resellers include: -- [digicert](https://www.digicert.com/code-signing/microsoft-authenticode.htm) +- [digicert](https://www.digicert.com/dc/code-signing/microsoft-authenticode.htm) - [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing) - Amongst others, please shop around to find one that suits your needs! 😄 diff --git a/docs/tutorial/tutorial-6-publishing-updating.md b/docs/tutorial/tutorial-6-publishing-updating.md index 44058c6997..f9613940ca 100644 --- a/docs/tutorial/tutorial-6-publishing-updating.md +++ b/docs/tutorial/tutorial-6-publishing-updating.md @@ -231,7 +231,7 @@ rest of our docs and happy developing! If you have questions, please stop by our [new-pat]: https://github.com/settings/tokens/new [publish command]: https://www.electronforge.io/cli#publish [publisher]: https://www.electronforge.io/config/publishers -[`publishergithubconfig`]: https://js.electronforge.io/publisher/github/interfaces/publishergithubconfig +[`publishergithubconfig`]: https://js.electronforge.io/interfaces/_electron_forge_publisher_github.PublisherGitHubConfig.html [`update-electron-app`]: https://github.com/electron/update-electron-app [update-server]: ./updates.md
docs
8f4f82618c51029f91cfb6516bc9c75164bfee9a
Shelley Vohr
2023-08-08 10:23:14
fix: `removeBrowserView` draggable region removal (#39387) fix: removeBrowserView draggable region removal Closes https://github.com/electron/electron/issues/39377.
diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index 421417ec9b..57841dd41d 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -780,8 +780,8 @@ void BaseWindow::RemoveBrowserView(gin::Handle<BrowserView> browser_view) { browser_view.ToV8()); if (iter != browser_views_.end()) { - window_->RemoveBrowserView(browser_view->view()); window_->RemoveDraggableRegionProvider(browser_view.get()); + window_->RemoveBrowserView(browser_view->view()); browser_view->SetOwnerWindow(nullptr); iter->Reset(); browser_views_.erase(iter);
fix
199f6d64db9e52fc877a7db4bee069e318921edd
Charles Kerr
2025-02-25 19:20:33
perf: avoid redundant method calls in EventEmitter (#45786) * refactor: move EventEmitter::EmitWithEvent() into EventEmitter::Emit() * perf: remove redundant calls to isolate() in EventEmitter::Emit() * perf: remove redundant calls to GetWrapper() in EventEmitter::EmitEvent() * perf: remove redundant calls to isolate() in EventEmitter::EmitWithoutEvent() * perf: remove redundant calls to GetWrapper() in EventEmitter::EmitWithoutEvent() * refactor: remove unused method EventEmitter::isolate() * refactor: remove unused method EventEmitter::GetWrapper(v8::Isolate*) * refactor: remove unused method EventEmitter::GetWrapper() refactor: make the EventEmitter::Base typedef private * refactor: remove unused typedef EventEmitter::Base See "Workarounds" section in https://isocpp.org/wiki/faq/templates#nondependent-name-lookup-members * refactor: remove redundant gin_helper:: namespace use
diff --git a/shell/common/gin_helper/event_emitter.h b/shell/common/gin_helper/event_emitter.h index 74b8c7f379..2a9485696d 100644 --- a/shell/common/gin_helper/event_emitter.h +++ b/shell/common/gin_helper/event_emitter.h @@ -23,37 +23,30 @@ namespace gin_helper { template <typename T> class EventEmitter : public gin_helper::Wrappable<T> { public: - using Base = gin_helper::Wrappable<T>; - - // Make the convenient methods visible: - // https://isocpp.org/wiki/faq/templates#nondependent-name-lookup-members - v8::Isolate* isolate() const { return Base::isolate(); } - v8::Local<v8::Object> GetWrapper() const { return Base::GetWrapper(); } - v8::MaybeLocal<v8::Object> GetWrapper(v8::Isolate* isolate) const { - return Base::GetWrapper(isolate); - } - // this.emit(name, new Event(), args...); template <typename... Args> bool Emit(const std::string_view name, Args&&... args) { - v8::HandleScope handle_scope(isolate()); - v8::Local<v8::Object> wrapper = GetWrapper(); + v8::Isolate* const isolate = this->isolate(); + v8::HandleScope handle_scope{isolate}; + v8::Local<v8::Object> wrapper = this->GetWrapper(); if (wrapper.IsEmpty()) return false; - gin::Handle<gin_helper::internal::Event> event = - internal::Event::New(isolate()); - return EmitWithEvent(name, event, std::forward<Args>(args)...); + gin::Handle<internal::Event> event = internal::Event::New(isolate); + // It's possible that |this| will be deleted by EmitEvent, so save anything + // we need from |this| before calling EmitEvent. + EmitEvent(isolate, wrapper, name, event, std::forward<Args>(args)...); + return event->GetDefaultPrevented(); } // this.emit(name, args...); template <typename... Args> void EmitWithoutEvent(const std::string_view name, Args&&... args) { - v8::HandleScope handle_scope(isolate()); - v8::Local<v8::Object> wrapper = GetWrapper(); + v8::Isolate* const isolate = this->isolate(); + v8::HandleScope handle_scope{isolate}; + v8::Local<v8::Object> wrapper = this->GetWrapper(); if (wrapper.IsEmpty()) return; - gin_helper::EmitEvent(isolate(), GetWrapper(), name, - std::forward<Args>(args)...); + EmitEvent(isolate, wrapper, name, std::forward<Args>(args)...); } // disable copy @@ -62,20 +55,6 @@ class EventEmitter : public gin_helper::Wrappable<T> { protected: EventEmitter() = default; - - private: - // this.emit(name, event, args...); - template <typename... Args> - bool EmitWithEvent(const std::string_view name, - gin::Handle<gin_helper::internal::Event> event, - Args&&... args) { - // It's possible that |this| will be deleted by EmitEvent, so save anything - // we need from |this| before calling EmitEvent. - auto* isolate = this->isolate(); - gin_helper::EmitEvent(isolate, GetWrapper(), name, event, - std::forward<Args>(args)...); - return event->GetDefaultPrevented(); - } }; } // namespace gin_helper
perf
8e5bb4949b5e978feb804450bc5ea0a4eb29e6d4
Shelley Vohr
2023-07-31 15:59:51
fix: skip artifact validation for doc-only PRs (#39296)
diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 2b5f135a0e..bf8ffa907e 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -74,8 +74,10 @@ for: - ps: | node script/yarn.js install --frozen-lockfile node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER + $env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false" if ($LASTEXITCODE -eq 0) { - Write-warning "Skipping build for doc only change" + Write-warning "Skipping build for doc-only change" + $env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true" Exit-AppveyorBuild } else { $global:LASTEXITCODE = 0 @@ -206,25 +208,29 @@ for: - ps: | cd C:\projects\src $missing_artifacts = $false - $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') - foreach($artifact_name in $artifacts_to_upload) { - if ($artifact_name -eq 'ffmpeg.zip') { - $artifact_file = "out\ffmpeg\ffmpeg.zip" - } elseif ($artifact_name -eq 'node_headers.zip') { - $artifact_file = $artifact_name - } else { - $artifact_file = "out\Default\$artifact_name" + if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') { + Write-warning "Skipping artifact validation for doc-only PR" + } else { + $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') + foreach($artifact_name in $artifacts_to_upload) { + if ($artifact_name -eq 'ffmpeg.zip') { + $artifact_file = "out\ffmpeg\ffmpeg.zip" + } elseif ($artifact_name -eq 'node_headers.zip') { + $artifact_file = $artifact_name + } else { + $artifact_file = "out\Default\$artifact_name" + } + if (Test-Path $artifact_file) { + appveyor-retry appveyor PushArtifact $artifact_file + } else { + Write-warning "$artifact_name is missing and cannot be added to artifacts" + $missing_artifacts = $true + } } - if (Test-Path $artifact_file) { - appveyor-retry appveyor PushArtifact $artifact_file - } else { - Write-warning "$artifact_name is missing and cannot be added to artifacts" - $missing_artifacts = $true + if ($missing_artifacts) { + throw "Build failed due to missing artifacts" } } - if ($missing_artifacts) { - throw "Build failed due to missing artifacts" - } - ps: >- if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) { appveyor-retry appveyor PushArtifact pdb.zip diff --git a/appveyor.yml b/appveyor.yml index 43673d5813..85ac52b756 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -72,8 +72,10 @@ for: - ps: | node script/yarn.js install --frozen-lockfile node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER + $env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false" if ($LASTEXITCODE -eq 0) { - Write-warning "Skipping build for doc only change" + Write-warning "Skipping build for doc-only change" + $env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true" Exit-AppveyorBuild } else { $global:LASTEXITCODE = 0 @@ -204,25 +206,30 @@ for: - ps: | cd C:\projects\src $missing_artifacts = $false - $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') - foreach($artifact_name in $artifacts_to_upload) { - if ($artifact_name -eq 'ffmpeg.zip') { - $artifact_file = "out\ffmpeg\ffmpeg.zip" - } elseif ($artifact_name -eq 'node_headers.zip') { - $artifact_file = $artifact_name - } else { - $artifact_file = "out\Default\$artifact_name" + + if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') { + Write-warning "Skipping artifact validation for doc-only PR" + } else { + $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') + foreach($artifact_name in $artifacts_to_upload) { + if ($artifact_name -eq 'ffmpeg.zip') { + $artifact_file = "out\ffmpeg\ffmpeg.zip" + } elseif ($artifact_name -eq 'node_headers.zip') { + $artifact_file = $artifact_name + } else { + $artifact_file = "out\Default\$artifact_name" + } + if (Test-Path $artifact_file) { + appveyor-retry appveyor PushArtifact $artifact_file + } else { + Write-warning "$artifact_name is missing and cannot be added to artifacts" + $missing_artifacts = $true + } } - if (Test-Path $artifact_file) { - appveyor-retry appveyor PushArtifact $artifact_file - } else { - Write-warning "$artifact_name is missing and cannot be added to artifacts" - $missing_artifacts = $true + if ($missing_artifacts) { + throw "Build failed due to missing artifacts" } } - if ($missing_artifacts) { - throw "Build failed due to missing artifacts" - } - ps: >- if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) { appveyor-retry appveyor PushArtifact pdb.zip
fix
158a87d4941dc050c75f79b142e505c0d1578e6a
Charles Kerr
2024-12-03 16:25:48
fix: modernize-use-equals-default warnings (#44935) fix: use '= default' to define a trivial destructor [modernize-use-equals-default]
diff --git a/shell/browser/auto_updater.h b/shell/browser/auto_updater.h index be2487c22d..8b8cd48f1d 100644 --- a/shell/browser/auto_updater.h +++ b/shell/browser/auto_updater.h @@ -43,7 +43,7 @@ class Delegate { const std::string& update_url) {} protected: - virtual ~Delegate() {} + virtual ~Delegate() = default; }; class AutoUpdater { diff --git a/shell/browser/browser_observer.h b/shell/browser/browser_observer.h index a5146660d5..94faa53684 100644 --- a/shell/browser/browser_observer.h +++ b/shell/browser/browser_observer.h @@ -85,7 +85,7 @@ class BrowserObserver : public base::CheckedObserver { #endif protected: - ~BrowserObserver() override {} + ~BrowserObserver() override = default; }; } // namespace electron diff --git a/shell/browser/extended_web_contents_observer.h b/shell/browser/extended_web_contents_observer.h index 39b204d83f..38013fe422 100644 --- a/shell/browser/extended_web_contents_observer.h +++ b/shell/browser/extended_web_contents_observer.h @@ -26,7 +26,7 @@ class ExtendedWebContentsObserver : public base::CheckedObserver { virtual void OnDevToolsResized() {} protected: - ~ExtendedWebContentsObserver() override {} + ~ExtendedWebContentsObserver() override = default; }; } // namespace electron diff --git a/shell/browser/extensions/api/extension_action/extension_action_api.h b/shell/browser/extensions/api/extension_action/extension_action_api.h index 1d2931c2e7..cb8c2634ab 100644 --- a/shell/browser/extensions/api/extension_action/extension_action_api.h +++ b/shell/browser/extensions/api/extension_action/extension_action_api.h @@ -106,14 +106,14 @@ class ExtensionActionFunction : public ExtensionFunction { // show class ExtensionActionShowFunction : public ExtensionActionFunction { protected: - ~ExtensionActionShowFunction() override {} + ~ExtensionActionShowFunction() override = default; ResponseAction RunExtensionAction() override; }; // hide class ExtensionActionHideFunction : public ExtensionActionFunction { protected: - ~ExtensionActionHideFunction() override {} + ~ExtensionActionHideFunction() override = default; ResponseAction RunExtensionAction() override; }; @@ -123,28 +123,28 @@ class ExtensionActionSetIconFunction : public ExtensionActionFunction { static void SetReportErrorForInvisibleIconForTesting(bool value); protected: - ~ExtensionActionSetIconFunction() override {} + ~ExtensionActionSetIconFunction() override = default; ResponseAction RunExtensionAction() override; }; // setTitle class ExtensionActionSetTitleFunction : public ExtensionActionFunction { protected: - ~ExtensionActionSetTitleFunction() override {} + ~ExtensionActionSetTitleFunction() override = default; ResponseAction RunExtensionAction() override; }; // setPopup class ExtensionActionSetPopupFunction : public ExtensionActionFunction { protected: - ~ExtensionActionSetPopupFunction() override {} + ~ExtensionActionSetPopupFunction() override = default; ResponseAction RunExtensionAction() override; }; // setBadgeText class ExtensionActionSetBadgeTextFunction : public ExtensionActionFunction { protected: - ~ExtensionActionSetBadgeTextFunction() override {} + ~ExtensionActionSetBadgeTextFunction() override = default; ResponseAction RunExtensionAction() override; }; @@ -152,35 +152,35 @@ class ExtensionActionSetBadgeTextFunction : public ExtensionActionFunction { class ExtensionActionSetBadgeBackgroundColorFunction : public ExtensionActionFunction { protected: - ~ExtensionActionSetBadgeBackgroundColorFunction() override {} + ~ExtensionActionSetBadgeBackgroundColorFunction() override = default; ResponseAction RunExtensionAction() override; }; // getTitle class ExtensionActionGetTitleFunction : public ExtensionActionFunction { protected: - ~ExtensionActionGetTitleFunction() override {} + ~ExtensionActionGetTitleFunction() override = default; ResponseAction RunExtensionAction() override; }; // getPopup class ExtensionActionGetPopupFunction : public ExtensionActionFunction { protected: - ~ExtensionActionGetPopupFunction() override {} + ~ExtensionActionGetPopupFunction() override = default; ResponseAction RunExtensionAction() override; }; // openPopup class ExtensionActionOpenPopupFunction : public ExtensionActionFunction { protected: - ~ExtensionActionOpenPopupFunction() override {} + ~ExtensionActionOpenPopupFunction() override = default; ResponseAction RunExtensionAction() override; }; // getBadgeText class ExtensionActionGetBadgeTextFunction : public ExtensionActionFunction { protected: - ~ExtensionActionGetBadgeTextFunction() override {} + ~ExtensionActionGetBadgeTextFunction() override = default; ResponseAction RunExtensionAction() override; }; @@ -188,7 +188,7 @@ class ExtensionActionGetBadgeTextFunction : public ExtensionActionFunction { class ExtensionActionGetBadgeBackgroundColorFunction : public ExtensionActionFunction { protected: - ~ExtensionActionGetBadgeBackgroundColorFunction() override {} + ~ExtensionActionGetBadgeBackgroundColorFunction() override = default; ResponseAction RunExtensionAction() override; }; @@ -201,7 +201,7 @@ class ActionSetIconFunction : public ExtensionActionSetIconFunction { DECLARE_EXTENSION_FUNCTION("action.setIcon", ACTION_SETICON) protected: - ~ActionSetIconFunction() override {} + ~ActionSetIconFunction() override = default; }; class ActionGetPopupFunction : public ExtensionActionGetPopupFunction { @@ -209,7 +209,7 @@ class ActionGetPopupFunction : public ExtensionActionGetPopupFunction { DECLARE_EXTENSION_FUNCTION("action.getPopup", ACTION_GETPOPUP) protected: - ~ActionGetPopupFunction() override {} + ~ActionGetPopupFunction() override = default; }; class ActionSetPopupFunction : public ExtensionActionSetPopupFunction { @@ -217,7 +217,7 @@ class ActionSetPopupFunction : public ExtensionActionSetPopupFunction { DECLARE_EXTENSION_FUNCTION("action.setPopup", ACTION_SETPOPUP) protected: - ~ActionSetPopupFunction() override {} + ~ActionSetPopupFunction() override = default; }; class ActionGetTitleFunction : public ExtensionActionGetTitleFunction { @@ -225,7 +225,7 @@ class ActionGetTitleFunction : public ExtensionActionGetTitleFunction { DECLARE_EXTENSION_FUNCTION("action.getTitle", ACTION_GETTITLE) protected: - ~ActionGetTitleFunction() override {} + ~ActionGetTitleFunction() override = default; }; class ActionSetTitleFunction : public ExtensionActionSetTitleFunction { @@ -233,7 +233,7 @@ class ActionSetTitleFunction : public ExtensionActionSetTitleFunction { DECLARE_EXTENSION_FUNCTION("action.setTitle", ACTION_SETTITLE) protected: - ~ActionSetTitleFunction() override {} + ~ActionSetTitleFunction() override = default; }; class ActionGetBadgeTextFunction : public ExtensionActionGetBadgeTextFunction { @@ -241,7 +241,7 @@ class ActionGetBadgeTextFunction : public ExtensionActionGetBadgeTextFunction { DECLARE_EXTENSION_FUNCTION("action.getBadgeText", ACTION_GETBADGETEXT) protected: - ~ActionGetBadgeTextFunction() override {} + ~ActionGetBadgeTextFunction() override = default; }; class ActionSetBadgeTextFunction : public ExtensionActionSetBadgeTextFunction { @@ -249,7 +249,7 @@ class ActionSetBadgeTextFunction : public ExtensionActionSetBadgeTextFunction { DECLARE_EXTENSION_FUNCTION("action.setBadgeText", ACTION_SETBADGETEXT) protected: - ~ActionSetBadgeTextFunction() override {} + ~ActionSetBadgeTextFunction() override = default; }; class ActionGetBadgeBackgroundColorFunction @@ -259,7 +259,7 @@ class ActionGetBadgeBackgroundColorFunction ACTION_GETBADGEBACKGROUNDCOLOR) protected: - ~ActionGetBadgeBackgroundColorFunction() override {} + ~ActionGetBadgeBackgroundColorFunction() override = default; }; class ActionSetBadgeBackgroundColorFunction @@ -269,7 +269,7 @@ class ActionSetBadgeBackgroundColorFunction ACTION_SETBADGEBACKGROUNDCOLOR) protected: - ~ActionSetBadgeBackgroundColorFunction() override {} + ~ActionSetBadgeBackgroundColorFunction() override = default; }; class ActionGetBadgeTextColorFunction : public ExtensionActionFunction { @@ -297,7 +297,7 @@ class ActionEnableFunction : public ExtensionActionShowFunction { DECLARE_EXTENSION_FUNCTION("action.enable", ACTION_ENABLE) protected: - ~ActionEnableFunction() override {} + ~ActionEnableFunction() override = default; }; class ActionDisableFunction : public ExtensionActionHideFunction { @@ -305,7 +305,7 @@ class ActionDisableFunction : public ExtensionActionHideFunction { DECLARE_EXTENSION_FUNCTION("action.disable", ACTION_DISABLE) protected: - ~ActionDisableFunction() override {} + ~ActionDisableFunction() override = default; }; class ActionIsEnabledFunction : public ExtensionActionFunction { @@ -350,7 +350,7 @@ class BrowserActionSetIconFunction : public ExtensionActionSetIconFunction { DECLARE_EXTENSION_FUNCTION("browserAction.setIcon", BROWSERACTION_SETICON) protected: - ~BrowserActionSetIconFunction() override {} + ~BrowserActionSetIconFunction() override = default; }; class BrowserActionSetTitleFunction : public ExtensionActionSetTitleFunction { @@ -358,7 +358,7 @@ class BrowserActionSetTitleFunction : public ExtensionActionSetTitleFunction { DECLARE_EXTENSION_FUNCTION("browserAction.setTitle", BROWSERACTION_SETTITLE) protected: - ~BrowserActionSetTitleFunction() override {} + ~BrowserActionSetTitleFunction() override = default; }; class BrowserActionSetPopupFunction : public ExtensionActionSetPopupFunction { @@ -366,7 +366,7 @@ class BrowserActionSetPopupFunction : public ExtensionActionSetPopupFunction { DECLARE_EXTENSION_FUNCTION("browserAction.setPopup", BROWSERACTION_SETPOPUP) protected: - ~BrowserActionSetPopupFunction() override {} + ~BrowserActionSetPopupFunction() override = default; }; class BrowserActionGetTitleFunction : public ExtensionActionGetTitleFunction { @@ -374,7 +374,7 @@ class BrowserActionGetTitleFunction : public ExtensionActionGetTitleFunction { DECLARE_EXTENSION_FUNCTION("browserAction.getTitle", BROWSERACTION_GETTITLE) protected: - ~BrowserActionGetTitleFunction() override {} + ~BrowserActionGetTitleFunction() override = default; }; class BrowserActionGetPopupFunction : public ExtensionActionGetPopupFunction { @@ -382,7 +382,7 @@ class BrowserActionGetPopupFunction : public ExtensionActionGetPopupFunction { DECLARE_EXTENSION_FUNCTION("browserAction.getPopup", BROWSERACTION_GETPOPUP) protected: - ~BrowserActionGetPopupFunction() override {} + ~BrowserActionGetPopupFunction() override = default; }; class BrowserActionSetBadgeTextFunction @@ -392,7 +392,7 @@ class BrowserActionSetBadgeTextFunction BROWSERACTION_SETBADGETEXT) protected: - ~BrowserActionSetBadgeTextFunction() override {} + ~BrowserActionSetBadgeTextFunction() override = default; }; class BrowserActionSetBadgeBackgroundColorFunction @@ -402,7 +402,7 @@ class BrowserActionSetBadgeBackgroundColorFunction BROWSERACTION_SETBADGEBACKGROUNDCOLOR) protected: - ~BrowserActionSetBadgeBackgroundColorFunction() override {} + ~BrowserActionSetBadgeBackgroundColorFunction() override = default; }; class BrowserActionGetBadgeTextFunction @@ -412,7 +412,7 @@ class BrowserActionGetBadgeTextFunction BROWSERACTION_GETBADGETEXT) protected: - ~BrowserActionGetBadgeTextFunction() override {} + ~BrowserActionGetBadgeTextFunction() override = default; }; class BrowserActionGetBadgeBackgroundColorFunction @@ -422,7 +422,7 @@ class BrowserActionGetBadgeBackgroundColorFunction BROWSERACTION_GETBADGEBACKGROUNDCOLOR) protected: - ~BrowserActionGetBadgeBackgroundColorFunction() override {} + ~BrowserActionGetBadgeBackgroundColorFunction() override = default; }; class BrowserActionEnableFunction : public ExtensionActionShowFunction { @@ -430,7 +430,7 @@ class BrowserActionEnableFunction : public ExtensionActionShowFunction { DECLARE_EXTENSION_FUNCTION("browserAction.enable", BROWSERACTION_ENABLE) protected: - ~BrowserActionEnableFunction() override {} + ~BrowserActionEnableFunction() override = default; }; class BrowserActionDisableFunction : public ExtensionActionHideFunction { @@ -438,7 +438,7 @@ class BrowserActionDisableFunction : public ExtensionActionHideFunction { DECLARE_EXTENSION_FUNCTION("browserAction.disable", BROWSERACTION_DISABLE) protected: - ~BrowserActionDisableFunction() override {} + ~BrowserActionDisableFunction() override = default; }; class BrowserActionOpenPopupFunction : public ExtensionActionOpenPopupFunction { @@ -447,7 +447,7 @@ class BrowserActionOpenPopupFunction : public ExtensionActionOpenPopupFunction { BROWSERACTION_OPEN_POPUP) protected: - ~BrowserActionOpenPopupFunction() override {} + ~BrowserActionOpenPopupFunction() override = default; }; } // namespace extensions @@ -461,7 +461,7 @@ class PageActionShowFunction : public extensions::ExtensionActionShowFunction { DECLARE_EXTENSION_FUNCTION("pageAction.show", PAGEACTION_SHOW) protected: - ~PageActionShowFunction() override {} + ~PageActionShowFunction() override = default; }; class PageActionHideFunction : public extensions::ExtensionActionHideFunction { @@ -469,7 +469,7 @@ class PageActionHideFunction : public extensions::ExtensionActionHideFunction { DECLARE_EXTENSION_FUNCTION("pageAction.hide", PAGEACTION_HIDE) protected: - ~PageActionHideFunction() override {} + ~PageActionHideFunction() override = default; }; class PageActionSetIconFunction @@ -478,7 +478,7 @@ class PageActionSetIconFunction DECLARE_EXTENSION_FUNCTION("pageAction.setIcon", PAGEACTION_SETICON) protected: - ~PageActionSetIconFunction() override {} + ~PageActionSetIconFunction() override = default; }; class PageActionSetTitleFunction @@ -487,7 +487,7 @@ class PageActionSetTitleFunction DECLARE_EXTENSION_FUNCTION("pageAction.setTitle", PAGEACTION_SETTITLE) protected: - ~PageActionSetTitleFunction() override {} + ~PageActionSetTitleFunction() override = default; }; class PageActionSetPopupFunction @@ -496,7 +496,7 @@ class PageActionSetPopupFunction DECLARE_EXTENSION_FUNCTION("pageAction.setPopup", PAGEACTION_SETPOPUP) protected: - ~PageActionSetPopupFunction() override {} + ~PageActionSetPopupFunction() override = default; }; class PageActionGetTitleFunction @@ -505,7 +505,7 @@ class PageActionGetTitleFunction DECLARE_EXTENSION_FUNCTION("pageAction.getTitle", PAGEACTION_GETTITLE) protected: - ~PageActionGetTitleFunction() override {} + ~PageActionGetTitleFunction() override = default; }; class PageActionGetPopupFunction @@ -514,7 +514,7 @@ class PageActionGetPopupFunction DECLARE_EXTENSION_FUNCTION("pageAction.getPopup", PAGEACTION_GETPOPUP) protected: - ~PageActionGetPopupFunction() override {} + ~PageActionGetPopupFunction() override = default; }; #endif // SHELL_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H_ diff --git a/shell/browser/extensions/api/tabs/tabs_api.h b/shell/browser/extensions/api/tabs/tabs_api.h index e86b3d3916..812f740ba5 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.h +++ b/shell/browser/extensions/api/tabs/tabs_api.h @@ -43,13 +43,13 @@ class TabsExecuteScriptFunction : public ExecuteCodeInTabFunction { bool ShouldRemoveCSS() const override; private: - ~TabsExecuteScriptFunction() override {} + ~TabsExecuteScriptFunction() override = default; DECLARE_EXTENSION_FUNCTION("tabs.executeScript", TABS_EXECUTESCRIPT) }; class TabsReloadFunction : public ExtensionFunction { - ~TabsReloadFunction() override {} + ~TabsReloadFunction() override = default; ResponseAction Run() override; @@ -57,7 +57,7 @@ class TabsReloadFunction : public ExtensionFunction { }; class TabsQueryFunction : public ExtensionFunction { - ~TabsQueryFunction() override {} + ~TabsQueryFunction() override = default; ResponseAction Run() override; @@ -65,7 +65,7 @@ class TabsQueryFunction : public ExtensionFunction { }; class TabsGetFunction : public ExtensionFunction { - ~TabsGetFunction() override {} + ~TabsGetFunction() override = default; ResponseAction Run() override; @@ -74,7 +74,7 @@ class TabsGetFunction : public ExtensionFunction { class TabsSetZoomFunction : public ExtensionFunction { private: - ~TabsSetZoomFunction() override {} + ~TabsSetZoomFunction() override = default; ResponseAction Run() override; @@ -83,7 +83,7 @@ class TabsSetZoomFunction : public ExtensionFunction { class TabsGetZoomFunction : public ExtensionFunction { private: - ~TabsGetZoomFunction() override {} + ~TabsGetZoomFunction() override = default; ResponseAction Run() override; @@ -92,7 +92,7 @@ class TabsGetZoomFunction : public ExtensionFunction { class TabsSetZoomSettingsFunction : public ExtensionFunction { private: - ~TabsSetZoomSettingsFunction() override {} + ~TabsSetZoomSettingsFunction() override = default; ResponseAction Run() override; @@ -101,7 +101,7 @@ class TabsSetZoomSettingsFunction : public ExtensionFunction { class TabsGetZoomSettingsFunction : public ExtensionFunction { private: - ~TabsGetZoomSettingsFunction() override {} + ~TabsGetZoomSettingsFunction() override = default; ResponseAction Run() override; @@ -113,7 +113,7 @@ class TabsUpdateFunction : public ExtensionFunction { TabsUpdateFunction(); protected: - ~TabsUpdateFunction() override {} + ~TabsUpdateFunction() override = default; bool UpdateURL(const std::string& url, int tab_id, std::string* error); ResponseValue GetResult(); diff --git a/shell/browser/native_window_observer.h b/shell/browser/native_window_observer.h index 23bec5c4ba..22efa174ae 100644 --- a/shell/browser/native_window_observer.h +++ b/shell/browser/native_window_observer.h @@ -27,7 +27,7 @@ namespace electron { class NativeWindowObserver : public base::CheckedObserver { public: - ~NativeWindowObserver() override {} + ~NativeWindowObserver() override = default; // Called when the web page in window wants to create a popup window. virtual void WillCreatePopupWindow(const std::u16string& frame_name, diff --git a/shell/browser/ui/electron_menu_model.h b/shell/browser/ui/electron_menu_model.h index 5d7749d43f..943f335f41 100644 --- a/shell/browser/ui/electron_menu_model.h +++ b/shell/browser/ui/electron_menu_model.h @@ -37,7 +37,7 @@ class ElectronMenuModel : public ui::SimpleMenuModel { class Delegate : public ui::SimpleMenuModel::Delegate { public: - ~Delegate() override {} + ~Delegate() override = default; virtual bool GetAcceleratorForCommandIdWithParams( int command_id, @@ -63,7 +63,7 @@ class ElectronMenuModel : public ui::SimpleMenuModel { class Observer : public base::CheckedObserver { public: - ~Observer() override {} + ~Observer() override = default; // Notifies the menu will open. virtual void OnMenuWillShow() {} diff --git a/shell/browser/ui/inspectable_web_contents_delegate.h b/shell/browser/ui/inspectable_web_contents_delegate.h index 91f2f12362..d549643ea7 100644 --- a/shell/browser/ui/inspectable_web_contents_delegate.h +++ b/shell/browser/ui/inspectable_web_contents_delegate.h @@ -16,7 +16,7 @@ namespace electron { class InspectableWebContentsDelegate { public: - virtual ~InspectableWebContentsDelegate() {} + virtual ~InspectableWebContentsDelegate() = default; // Requested by WebContents of devtools. virtual void DevToolsReloadPage() {} diff --git a/shell/browser/ui/inspectable_web_contents_view_delegate.h b/shell/browser/ui/inspectable_web_contents_view_delegate.h index 21a8e6daf2..46593888c4 100644 --- a/shell/browser/ui/inspectable_web_contents_view_delegate.h +++ b/shell/browser/ui/inspectable_web_contents_view_delegate.h @@ -14,7 +14,7 @@ namespace electron { class InspectableWebContentsViewDelegate { public: - virtual ~InspectableWebContentsViewDelegate() {} + virtual ~InspectableWebContentsViewDelegate() = default; virtual void DevToolsFocused() {} virtual void DevToolsOpened() {} diff --git a/shell/browser/ui/tray_icon_observer.h b/shell/browser/ui/tray_icon_observer.h index 6412d234f8..7796d58843 100644 --- a/shell/browser/ui/tray_icon_observer.h +++ b/shell/browser/ui/tray_icon_observer.h @@ -41,7 +41,7 @@ class TrayIconObserver : public base::CheckedObserver { virtual void OnMouseMoved(const gfx::Point& location, int modifiers) {} protected: - ~TrayIconObserver() override {} + ~TrayIconObserver() override = default; }; } // namespace electron diff --git a/shell/browser/ui/views/autofill_popup_view.h b/shell/browser/ui/views/autofill_popup_view.h index 9c0035dc49..df46fdb445 100644 --- a/shell/browser/ui/views/autofill_popup_view.h +++ b/shell/browser/ui/views/autofill_popup_view.h @@ -50,7 +50,7 @@ class AutofillPopupChildView : public views::View { AutofillPopupChildView& operator=(const AutofillPopupChildView&) = delete; private: - ~AutofillPopupChildView() override {} + ~AutofillPopupChildView() override = default; // views::Views implementation void GetAccessibleNodeData(ui::AXNodeData* node_data) override; diff --git a/shell/browser/window_list_observer.h b/shell/browser/window_list_observer.h index 5b7fc8d805..44ea0d0fa0 100644 --- a/shell/browser/window_list_observer.h +++ b/shell/browser/window_list_observer.h @@ -20,7 +20,7 @@ class WindowListObserver : public base::CheckedObserver { virtual void OnWindowAllClosed() {} protected: - ~WindowListObserver() override {} + ~WindowListObserver() override = default; }; } // namespace electron diff --git a/shell/common/color_util.h b/shell/common/color_util.h index 6fad7d6150..8ea422e75b 100644 --- a/shell/common/color_util.h +++ b/shell/common/color_util.h @@ -12,7 +12,7 @@ // SkColor is a typedef for uint32_t, this wrapper is to tag an SkColor for // ease of use in gin converters. struct WrappedSkColor { - WrappedSkColor() {} + WrappedSkColor() = default; WrappedSkColor(SkColor c) : value(c) {} // NOLINT(runtime/explicit) SkColor value; operator SkColor() const { return value; } diff --git a/shell/common/gin_helper/event_emitter.h b/shell/common/gin_helper/event_emitter.h index 352c39a5cb..74b8c7f379 100644 --- a/shell/common/gin_helper/event_emitter.h +++ b/shell/common/gin_helper/event_emitter.h @@ -61,7 +61,7 @@ class EventEmitter : public gin_helper::Wrappable<T> { EventEmitter& operator=(const EventEmitter&) = delete; protected: - EventEmitter() {} + EventEmitter() = default; private: // this.emit(name, event, args...);
fix
02b58333dc27c508f9389feb192b34e7b37fe0fa
David Sanders
2023-09-28 08:27:02
ci: update release project board workflows (#40020)
diff --git a/.github/workflows/branch-created.yml b/.github/workflows/branch-created.yml index 92c25c628a..5a800f2a54 100644 --- a/.github/workflows/branch-created.yml +++ b/.github/workflows/branch-created.yml @@ -60,106 +60,33 @@ jobs: done - name: Generate GitHub App token if: ${{ steps.check-major-version.outputs.MAJOR }} - uses: electron/github-app-auth-action@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0 + uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1 id: generate-token with: creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }} org: electron - - name: Create Release Project Board + - name: Generate Release Project Board Metadata if: ${{ steps.check-major-version.outputs.MAJOR }} - env: - GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} - MAJOR: ${{ steps.check-major-version.outputs.MAJOR }} - ELECTRON_ORG_ID: "O_kgDOAMybxg" - ELECTRON_REPO_ID: "R_kgDOAI8xSw" - TEMPLATE_PROJECT_ID: "PVT_kwDOAMybxs4AQvib" - run: | - # Copy template to create new project board - PROJECT_ID=$(gh api graphql -f query='mutation ($ownerId: ID!, $projectId: ID!, $title: String!) { - copyProjectV2(input: { - includeDraftIssues: true, - ownerId: $ownerId, - projectId: $projectId, - title: $title - }) { - projectV2 { - id - } - } - }' -f ownerId=$ELECTRON_ORG_ID -f projectId=$TEMPLATE_PROJECT_ID -f title="${MAJOR}-x-y" | jq -r '.data.copyProjectV2.projectV2.id') - - # Make the new project public - gh api graphql -f query='mutation ($projectId: ID!) { - updateProjectV2(input: { - projectId: $projectId, - public: true, - }) { - projectV2 { - id - } - } - }' -f projectId=$PROJECT_ID - - # Link the new project to the Electron repository - gh api graphql -f query='mutation ($projectId: ID!, $repositoryId: ID!) { - linkProjectV2ToRepository(input: { - projectId: $projectId, - repositoryId: $repositoryId - }) { - clientMutationId - } - }' -f projectId=$PROJECT_ID -f repositoryId=$ELECTRON_REPO_ID - - # Get all draft issues on the new project board - gh api graphql -f query='query ($id: ID!) { - node(id: $id) { - ... on ProjectV2 { - items(first: 100) { - nodes { - ... on ProjectV2Item { - id - content { - ... on DraftIssue { id title - body - } - } - } - } - } - } - } - }' -f id=$PROJECT_ID > issues.json - PROJECT_ITEMS=$(jq '.data.node.items.nodes[] | select(.content.id != null) | .id' issues.json) - - # - # Do template replacement for draft issues - # - echo "{\"major\": $MAJOR, \"next-major\": $((MAJOR + 1)), \"prev-major\": $((MAJOR - 1))}" > variables.json - - # npx mustache is annoyingly slow, so install mustache directly - yarn add -D mustache - - for PROJECT_ITEM_ID in $PROJECT_ITEMS; do - # These are done with the raw output flag and sent to file to better retain formatting - jq -r ".data.node.items.nodes[] | select(.id == $PROJECT_ITEM_ID) | .content.title" issues.json > title.txt - jq -r ".data.node.items.nodes[] | select(.id == $PROJECT_ITEM_ID) | .content.body" issues.json > body.txt - - ./node_modules/.bin/mustache variables.json title.txt new_title.txt - ./node_modules/.bin/mustache variables.json body.txt new_body.txt + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 + id: generate-project-metadata + with: + script: | + const major = ${{ steps.check-major-version.outputs.MAJOR }} - # Only update draft issues which had content change when interpolated - if ! cmp --silent -- new_title.txt title.txt || ! cmp --silent -- new_body.txt body.txt; then - DRAFT_ISSUE_ID=$(jq ".data.node.items.nodes[] | select(.id == $PROJECT_ITEM_ID) | .content.id" issues.json) - gh api graphql -f query='mutation ($draftIssueId: ID!, $title: String!, $body: String!) { - updateProjectV2DraftIssue(input: { - draftIssueId: $draftIssueId, - title: $title, - body: $body - }) { - draftIssue { - id - } - } - }' -f draftIssueId=$DRAFT_ISSUE_ID -f title="$(cat new_title.txt)" -f body="$(cat new_body.txt)" - fi - done + core.setOutput("template-view", JSON.stringify({ + major, + "next-major": major + 1, + "prev-major": major - 1, + })) + core.setOutput("title", `${major}-x-y`) + - name: Create Release Project Board + if: ${{ steps.check-major-version.outputs.MAJOR }} + uses: dsanders11/project-actions/copy-project@a24415515fa60a22f71f9d9d00e36ca82660cde9 # v1.0.1 + with: + drafts: true + project-number: 64 + # TODO - Set to public once GitHub fixes their GraphQL bug + # public: true + template-view: ${{ steps.generate-project-metadata.outputs.template-view }} + title: ${{ steps.generate-project-metadata.outputs.title}} + token: ${{ steps.generate-token.outputs.token }} diff --git a/.github/workflows/stable-prep-items.yml b/.github/workflows/stable-prep-items.yml new file mode 100644 index 0000000000..b5ec575b9f --- /dev/null +++ b/.github/workflows/stable-prep-items.yml @@ -0,0 +1,35 @@ +name: Check Stable Prep Items + +on: + schedule: + - cron: '0 */12 * * *' + workflow_dispatch: + +permissions: {} + +jobs: + check-stable-prep-items: + name: Check Stable Prep Items + runs-on: ubuntu-latest + steps: + - name: Generate GitHub App token + uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1 + id: generate-token + with: + creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }} + org: electron + - name: Find Newest Release Project Board + id: find-project-number + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + run: | + set -eo pipefail + PROJECT_NUMBER=$(gh project list --owner electron --format json | jq -r '.projects | map(select(.title | test("^[0-9]+-x-y$"))) | max_by(.number) | .number') + echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> "$GITHUB_OUTPUT" + - name: Update Completed Stable Prep Items + uses: dsanders11/project-actions/completed-by@a24415515fa60a22f71f9d9d00e36ca82660cde9 # v1.0.1 + with: + field: Prep Status + field-value: ✅ Complete + project-number: ${{ steps.find-project-number.outputs.PROJECT_NUMBER }} + token: ${{ steps.generate-token.outputs.token }}
ci
8543820d98bd0ace5173218f7e803106ca23d85c
John Kleinschmidt
2025-01-29 16:47:25
build: fixup concurrent builds on protected branches (#45355)
diff --git a/.github/workflows/pipeline-electron-build-and-test-and-nan.yml b/.github/workflows/pipeline-electron-build-and-test-and-nan.yml index 066faac254..f4a7ec5243 100644 --- a/.github/workflows/pipeline-electron-build-and-test-and-nan.yml +++ b/.github/workflows/pipeline-electron-build-and-test-and-nan.yml @@ -56,8 +56,8 @@ on: default: false concurrency: - group: electron-build-and-test-and-nan-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }} + group: electron-build-and-test-and-nan-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }} + cancel-in-progress: ${{ github.ref_protected != true }} jobs: build: diff --git a/.github/workflows/pipeline-electron-build-and-test.yml b/.github/workflows/pipeline-electron-build-and-test.yml index f55bbfb387..6a1a8ecd15 100644 --- a/.github/workflows/pipeline-electron-build-and-test.yml +++ b/.github/workflows/pipeline-electron-build-and-test.yml @@ -56,8 +56,8 @@ on: default: false concurrency: - group: electron-build-and-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }} + group: electron-build-and-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }} + cancel-in-progress: ${{ github.ref_protected != true }} permissions: contents: read diff --git a/.github/workflows/pipeline-electron-lint.yml b/.github/workflows/pipeline-electron-lint.yml index 166060e396..2124423e4b 100644 --- a/.github/workflows/pipeline-electron-lint.yml +++ b/.github/workflows/pipeline-electron-lint.yml @@ -9,8 +9,8 @@ on: type: string concurrency: - group: electron-lint-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }} + group: electron-lint-${{ github.ref_protected == true && github.run_id || github.ref }} + cancel-in-progress: ${{ github.ref_protected != true }} jobs: lint: diff --git a/.github/workflows/pipeline-segment-electron-build.yml b/.github/workflows/pipeline-segment-electron-build.yml index 4731c21db0..9fca1658e3 100644 --- a/.github/workflows/pipeline-segment-electron-build.yml +++ b/.github/workflows/pipeline-segment-electron-build.yml @@ -61,8 +61,8 @@ on: concurrency: - group: electron-build-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.target-variant }}-${{ inputs.is-asan }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }} + group: electron-build-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.target-variant }}-${{ inputs.is-asan }}-${{ github.ref_protected == true && github.run_id || github.ref }} + cancel-in-progress: ${{ github.ref_protected != true }} env: ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }} diff --git a/.github/workflows/pipeline-segment-electron-test.yml b/.github/workflows/pipeline-segment-electron-test.yml index 27e40a218d..e3a2336c51 100644 --- a/.github/workflows/pipeline-segment-electron-test.yml +++ b/.github/workflows/pipeline-segment-electron-test.yml @@ -27,8 +27,8 @@ on: default: false concurrency: - group: electron-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }} + group: electron-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ github.ref_protected == true && github.run_id || github.ref }} + cancel-in-progress: ${{ github.ref_protected != true }} permissions: contents: read diff --git a/.github/workflows/pipeline-segment-node-nan-test.yml b/.github/workflows/pipeline-segment-node-nan-test.yml index 093bcf9e5d..09b23cc6c8 100644 --- a/.github/workflows/pipeline-segment-node-nan-test.yml +++ b/.github/workflows/pipeline-segment-node-nan-test.yml @@ -27,8 +27,8 @@ on: default: testing concurrency: - group: electron-node-nan-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }} + group: electron-node-nan-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }} + cancel-in-progress: ${{ github.ref_protected != true }} env: ELECTRON_OUT_DIR: Default
build
905e41bbddd72f4d19c294b430d1a7c282e22a5d
Athul Iddya
2023-07-11 01:21:11
fix: use StartUpdating method for PipeWire capturer (#38833) * fix: use StartUpdating method for PipeWire capturer Fixed a crash related to PipeWire capturer by adapting to Chromium's interface changes. Chromium expects a call to `NativeDesktopMediaList::StartUpdating` with an implementation of `DesktopMediaListObserver` for delegated capturers like PipeWire. This interface allows listening to user permission events and listing sources only after the user has made a choice on the permission dialog. The interface has been implemented by an inner class to allow listening to screen and window capture permissions concurrently using two instances of the class. A patch that was resetting the capturer on the first refresh has been changed to exclude PipeWire. PipeWire capturer object will follow the lifecycle of `NativeDesktopMediaList`, as is the case in Chromium. Fixes #37463 * fix: wait for thumbnails from PipeWire when necessary The PipeWire stream starts after the dialog is dismissed. If the sources are listed immediately afterwards, the thumbnail may not have been generated by that time. Explicitly wait for both thumbnail generation and a selection on the source dialog before listing sources.
diff --git a/patches/chromium/desktop_media_list.patch b/patches/chromium/desktop_media_list.patch index ba0b284257..e3aefc69cd 100644 --- a/patches/chromium/desktop_media_list.patch +++ b/patches/chromium/desktop_media_list.patch @@ -82,7 +82,7 @@ index 33ca7a53dfb6d2c9e3a33f0065a3acd806e82e01..9fdf2e8ff0056ff407015b914c6b03eb const Source& GetSource(int index) const override; DesktopMediaList::Type GetMediaListType() const override; diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc -index b548c9fbd3c0bf425447b29dcd866cd27e96b14c..f994ac6086c7b4cd3e8534f34691189d78a21601 100644 +index b548c9fbd3c0bf425447b29dcd866cd27e96b14c..4de719510eaeaaf77cdbd46560f3b4ab1869877a 100644 --- a/chrome/browser/media/webrtc/native_desktop_media_list.cc +++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc @@ -147,7 +147,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) { @@ -94,17 +94,20 @@ index b548c9fbd3c0bf425447b29dcd866cd27e96b14c..f994ac6086c7b4cd3e8534f34691189d #endif } // namespace -@@ -457,6 +457,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() { +@@ -457,6 +457,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() { FROM_HERE, base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished, media_list_)); + + // This call is necessary to release underlying OS screen capture mechanisms. -+ capturer_.reset(); ++ // Skip if the source list is delegated, as the source list window will be active. ++ if (!capturer_->GetDelegatedSourceListController()) { ++ capturer_.reset(); ++ } } void NativeDesktopMediaList::Worker::OnCaptureResult( -@@ -829,6 +832,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows( +@@ -829,6 +835,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows( FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails, base::Unretained(worker_.get()), std::move(native_ids), thumbnail_size_)); diff --git a/shell/browser/api/electron_api_desktop_capturer.cc b/shell/browser/api/electron_api_desktop_capturer.cc index 650e4817c2..1e908db7c8 100644 --- a/shell/browser/api/electron_api_desktop_capturer.cc +++ b/shell/browser/api/electron_api_desktop_capturer.cc @@ -181,6 +181,41 @@ DesktopCapturer::DesktopCapturer(v8::Isolate* isolate) {} DesktopCapturer::~DesktopCapturer() = default; +DesktopCapturer::DesktopListListener::DesktopListListener( + OnceCallback update_callback, + OnceCallback failure_callback, + bool skip_thumbnails) + : update_callback_(std::move(update_callback)), + failure_callback_(std::move(failure_callback)), + have_thumbnail_(skip_thumbnails) {} + +DesktopCapturer::DesktopListListener::~DesktopListListener() = default; + +void DesktopCapturer::DesktopListListener::OnDelegatedSourceListSelection() { + if (have_thumbnail_) { + std::move(update_callback_).Run(); + } else { + have_selection_ = true; + } +} + +void DesktopCapturer::DesktopListListener::OnSourceThumbnailChanged(int index) { + if (have_selection_) { + // This is called every time a thumbnail is refreshed. Reset variable to + // ensure that the callback is not run again. + have_selection_ = false; + + // PipeWire returns a single source, so index is not relevant. + std::move(update_callback_).Run(); + } else { + have_thumbnail_ = true; + } +} + +void DesktopCapturer::DesktopListListener::OnDelegatedSourceListDismissed() { + std::move(failure_callback_).Run(); +} + void DesktopCapturer::StartHandling(bool capture_window, bool capture_screen, const gfx::Size& thumbnail_size, @@ -212,11 +247,22 @@ void DesktopCapturer::StartHandling(bool capture_window, window_capturer_ = std::make_unique<NativeDesktopMediaList>( DesktopMediaList::Type::kWindow, std::move(capturer)); window_capturer_->SetThumbnailSize(thumbnail_size); - window_capturer_->Update( - base::BindOnce(&DesktopCapturer::UpdateSourcesList, - weak_ptr_factory_.GetWeakPtr(), - window_capturer_.get()), - /* refresh_thumbnails = */ true); + + OnceCallback update_callback = base::BindOnce( + &DesktopCapturer::UpdateSourcesList, weak_ptr_factory_.GetWeakPtr(), + window_capturer_.get()); + + if (window_capturer_->IsSourceListDelegated()) { + OnceCallback failure_callback = base::BindOnce( + &DesktopCapturer::HandleFailure, weak_ptr_factory_.GetWeakPtr()); + window_listener_ = std::make_unique<DesktopListListener>( + std::move(update_callback), std::move(failure_callback), + thumbnail_size.IsEmpty()); + window_capturer_->StartUpdating(window_listener_.get()); + } else { + window_capturer_->Update(std::move(update_callback), + /* refresh_thumbnails = */ true); + } } } @@ -226,11 +272,22 @@ void DesktopCapturer::StartHandling(bool capture_window, screen_capturer_ = std::make_unique<NativeDesktopMediaList>( DesktopMediaList::Type::kScreen, std::move(capturer)); screen_capturer_->SetThumbnailSize(thumbnail_size); - screen_capturer_->Update( - base::BindOnce(&DesktopCapturer::UpdateSourcesList, - weak_ptr_factory_.GetWeakPtr(), - screen_capturer_.get()), - /* refresh_thumbnails = */ true); + + OnceCallback update_callback = base::BindOnce( + &DesktopCapturer::UpdateSourcesList, weak_ptr_factory_.GetWeakPtr(), + screen_capturer_.get()); + + if (screen_capturer_->IsSourceListDelegated()) { + OnceCallback failure_callback = base::BindOnce( + &DesktopCapturer::HandleFailure, weak_ptr_factory_.GetWeakPtr()); + screen_listener_ = std::make_unique<DesktopListListener>( + std::move(update_callback), std::move(failure_callback), + thumbnail_size.IsEmpty()); + screen_capturer_->StartUpdating(screen_listener_.get()); + } else { + screen_capturer_->Update(std::move(update_callback), + /* refresh_thumbnails = */ true); + } } } } @@ -269,12 +326,7 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) { // |media_list_sources|. if (!webrtc::DxgiDuplicatorController::Instance()->GetDeviceNames( &device_names)) { - v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); - v8::HandleScope scope(isolate); - gin_helper::CallMethod(this, "_onerror", "Failed to get sources."); - - Unpin(); - + HandleFailure(); return; } @@ -324,6 +376,14 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) { } } +void DesktopCapturer::HandleFailure() { + v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); + v8::HandleScope scope(isolate); + gin_helper::CallMethod(this, "_onerror", "Failed to get sources."); + + Unpin(); +} + // static gin::Handle<DesktopCapturer> DesktopCapturer::Create(v8::Isolate* isolate) { auto handle = gin::CreateHandle(isolate, new DesktopCapturer(isolate)); diff --git a/shell/browser/api/electron_api_desktop_capturer.h b/shell/browser/api/electron_api_desktop_capturer.h index f06ce5faee..65285086a1 100644 --- a/shell/browser/api/electron_api_desktop_capturer.h +++ b/shell/browser/api/electron_api_desktop_capturer.h @@ -62,8 +62,37 @@ class DesktopCapturer : public gin::Wrappable<DesktopCapturer>, void OnDelegatedSourceListDismissed() override {} private: + using OnceCallback = base::OnceClosure; + + class DesktopListListener : public DesktopMediaListObserver { + public: + DesktopListListener(OnceCallback update_callback, + OnceCallback failure_callback, + bool skip_thumbnails); + ~DesktopListListener() override; + + protected: + void OnSourceAdded(int index) override {} + void OnSourceRemoved(int index) override {} + void OnSourceMoved(int old_index, int new_index) override {} + void OnSourceNameChanged(int index) override {} + void OnSourceThumbnailChanged(int index) override; + void OnSourcePreviewChanged(size_t index) override {} + void OnDelegatedSourceListSelection() override; + void OnDelegatedSourceListDismissed() override; + + private: + OnceCallback update_callback_; + OnceCallback failure_callback_; + bool have_selection_ = false; + bool have_thumbnail_ = false; + }; + void UpdateSourcesList(DesktopMediaList* list); + void HandleFailure(); + std::unique_ptr<DesktopListListener> window_listener_; + std::unique_ptr<DesktopListListener> screen_listener_; std::unique_ptr<DesktopMediaList> window_capturer_; std::unique_ptr<DesktopMediaList> screen_capturer_; std::vector<DesktopCapturer::Source> captured_sources_;
fix
5ea885c87ffb3c0eeabe1dc6d1867028ff94a26b
Sam Maddock
2025-02-20 14:38:20
build: skip chromium git cookie on forks (#45735)
diff --git a/.github/actions/set-chromium-cookie/action.yml b/.github/actions/set-chromium-cookie/action.yml index 5b41dd6922..70d0852624 100644 --- a/.github/actions/set-chromium-cookie/action.yml +++ b/.github/actions/set-chromium-cookie/action.yml @@ -4,7 +4,7 @@ runs: using: "composite" steps: - name: Set the git cookie from chromium.googlesource.com (Unix) - if: ${{ runner.os != 'Windows' }} + if: ${{ runner.os != 'Windows' && env.CHROMIUM_GIT_COOKIE }} shell: bash run: | eval 'set +o history' 2>/dev/null || setopt HIST_IGNORE_SPACE 2>/dev/null @@ -18,7 +18,7 @@ runs: __END__ eval 'set -o history' 2>/dev/null || unsetopt HIST_IGNORE_SPACE 2>/dev/null - name: Set the git cookie from chromium.googlesource.com (Windows) - if: ${{ runner.os == 'Windows' }} + if: ${{ runner.os == 'Windows' && env.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }} shell: cmd run: | git config --global http.cookiefile "%USERPROFILE%\.gitcookies"
build
0d6743e79b230fda2ed80687bb927351c3a6f8a5
Robo
2024-11-20 01:32:48
fix: destroy url loader wrapper when JS env exits (#44574) * fix: destroy url loader wrapper when JS env exits * Revert "fix: destroy url loader wrapper when JS env exits" This reverts commit 419151a98a16814ea63e9abc197c6ae27f48128c. * Revert "Revert "fix: destroy url loader wrapper when JS env exits"" This reverts commit 4b401b03c62aca79498660f995825491ae52f179. * fix: double free of JSChunkedDataPipeGetter * fix: crash on process exit after stream completes
diff --git a/shell/common/api/electron_api_url_loader.cc b/shell/common/api/electron_api_url_loader.cc index 671bd926fe..0aa8734c9f 100644 --- a/shell/common/api/electron_api_url_loader.cc +++ b/shell/common/api/electron_api_url_loader.cc @@ -383,13 +383,13 @@ void SimpleURLLoaderWrapper::Start() { loader_->SetAllowHttpErrorResults(true); loader_->SetURLLoaderFactoryOptions(request_options_); loader_->SetOnResponseStartedCallback(base::BindOnce( - &SimpleURLLoaderWrapper::OnResponseStarted, base::Unretained(this))); + &SimpleURLLoaderWrapper::OnResponseStarted, weak_factory_.GetWeakPtr())); loader_->SetOnRedirectCallback(base::BindRepeating( - &SimpleURLLoaderWrapper::OnRedirect, base::Unretained(this))); + &SimpleURLLoaderWrapper::OnRedirect, weak_factory_.GetWeakPtr())); loader_->SetOnUploadProgressCallback(base::BindRepeating( - &SimpleURLLoaderWrapper::OnUploadProgress, base::Unretained(this))); + &SimpleURLLoaderWrapper::OnUploadProgress, weak_factory_.GetWeakPtr())); loader_->SetOnDownloadProgressCallback(base::BindRepeating( - &SimpleURLLoaderWrapper::OnDownloadProgress, base::Unretained(this))); + &SimpleURLLoaderWrapper::OnDownloadProgress, weak_factory_.GetWeakPtr())); url_loader_factory_ = GetURLLoaderFactoryForURL(request_ref->url); loader_->DownloadAsStream(url_loader_factory_.get(), this); @@ -719,14 +719,19 @@ void SimpleURLLoaderWrapper::OnDataReceived(std::string_view string_view, } void SimpleURLLoaderWrapper::OnComplete(bool success) { + auto self = weak_factory_.GetWeakPtr(); if (success) { Emit("complete"); } else { Emit("error", net::ErrorToString(loader_->NetError())); } - loader_.reset(); - pinned_wrapper_.Reset(); - pinned_chunk_pipe_getter_.Reset(); + // If users initiate process shutdown when the event is emitted, then + // we would perform cleanup of the wrapper and we should bail out below. + if (self) { + loader_.reset(); + pinned_wrapper_.Reset(); + pinned_chunk_pipe_getter_.Reset(); + } } void SimpleURLLoaderWrapper::OnResponseStarted( diff --git a/shell/common/api/electron_api_url_loader.h b/shell/common/api/electron_api_url_loader.h index 98b2c56701..f3f14cf6fa 100644 --- a/shell/common/api/electron_api_url_loader.h +++ b/shell/common/api/electron_api_url_loader.h @@ -21,6 +21,7 @@ #include "services/network/public/mojom/url_loader_network_service_observer.mojom.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "shell/browser/event_emitter_mixin.h" +#include "shell/common/gin_helper/cleaned_up_at_exit.h" #include "url/gurl.h" #include "v8/include/v8-forward.h" @@ -50,6 +51,7 @@ namespace electron::api { class SimpleURLLoaderWrapper final : public gin::Wrappable<SimpleURLLoaderWrapper>, public gin_helper::EventEmitterMixin<SimpleURLLoaderWrapper>, + public gin_helper::CleanedUpAtExit, private network::SimpleURLLoaderStreamConsumer, private network::mojom::URLLoaderNetworkServiceObserver { public:
fix
c5ea177b3d9736bd73177cb4157141ca7e6b1938
Savely Krasovsky
2024-11-22 20:47:36
feat: add query-session-end and improve session-end events on Windows (#44598) * feat: add query-session-end event for Windows * fix: remove debug line * feat: notify with reason on session-end * docs: add comments and return params * docs: add same docs to the BrowserWindow * fix: add shutdown reason if lParam == 0 * docs: remove 'force' word * docs: revert multithreading.md change * docs: add reasons documentation, reason variable renamed to reasons * docs: improve 'shutdown' reason wording * docs: reword with 'can be' * fix: pass reasons by reference * fix: use newer approach which expose reasons value directly on Event object * docs: add escaping * style: linter fixes * fix: project now should compile * fix: EmitWithoutEvent method added, EmitWithEvent moved to private again * docs: typo fix Co-authored-by: Sam Maddock <[email protected]> * docs: dedicated WindowSessionEndEvent type created * docs: better wording for session-end event description Co-authored-by: Will Anderson <[email protected]> --------- Co-authored-by: Sam Maddock <[email protected]> Co-authored-by: Will Anderson <[email protected]>
diff --git a/docs/api/base-window.md b/docs/api/base-window.md index c6cc7c878b..1cf5cb18e3 100644 --- a/docs/api/base-window.md +++ b/docs/api/base-window.md @@ -144,10 +144,24 @@ _**Note**: There is a subtle difference between the behaviors of `window.onbefor Emitted when the window is closed. After you have received this event you should remove the reference to the window and avoid using it any more. +#### Event: 'query-session-end' _Windows_ + +Returns: + +* `event` [WindowSessionEndEvent][window-session-end-event] + +Emitted when a session is about to end due to a shutdown, machine restart, or user log-off. +Calling `event.preventDefault()` can delay the system shutdown, though it’s generally best +to respect the user’s choice to end the session. However, you may choose to use it if +ending the session puts the user at risk of losing data. + #### Event: 'session-end' _Windows_ -Emitted when window session is going to end due to force shutdown or machine restart -or session log off. +Returns: + +* `event` [WindowSessionEndEvent][window-session-end-event] + +Emitted when a session is about to end due to a shutdown, machine restart, or user log-off. Once this event fires, there is no way to prevent the session from ending. #### Event: 'blur' @@ -1429,3 +1443,4 @@ On Linux, the `symbolColor` is automatically calculated to have minimum accessib [vibrancy-docs]: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc [window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level [event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter +[window-session-end-event]:../api/structures/window-session-end-event.md diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 89c9048585..7742039cf6 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -207,10 +207,24 @@ _**Note**: There is a subtle difference between the behaviors of `window.onbefor Emitted when the window is closed. After you have received this event you should remove the reference to the window and avoid using it any more. +#### Event: 'query-session-end' _Windows_ + +Returns: + +* `event` [WindowSessionEndEvent][window-session-end-event] + +Emitted when a session is about to end due to a shutdown, machine restart, or user log-off. +Calling `event.preventDefault()` can delay the system shutdown, though it’s generally best +to respect the user’s choice to end the session. However, you may choose to use it if +ending the session puts the user at risk of losing data. + #### Event: 'session-end' _Windows_ -Emitted when window session is going to end due to force shutdown or machine restart -or session log off. +Returns: + +* `event` [WindowSessionEndEvent][window-session-end-event] + +Emitted when a session is about to end due to a shutdown, machine restart, or user log-off. Once this event fires, there is no way to prevent the session from ending. #### Event: 'unresponsive' @@ -1672,3 +1686,4 @@ On Linux, the `symbolColor` is automatically calculated to have minimum accessib [vibrancy-docs]: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc [window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level [event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter +[window-session-end-event]:../api/structures/window-session-end-event.md diff --git a/docs/api/structures/window-session-end-event.md b/docs/api/structures/window-session-end-event.md new file mode 100644 index 0000000000..a5a062b6b4 --- /dev/null +++ b/docs/api/structures/window-session-end-event.md @@ -0,0 +1,7 @@ +# WindowSessionEndEvent Object extends `Event` + +* `reasons` string[] - List of reasons for shutdown. Can be 'shutdown', 'close-app', 'critical', or 'logoff'. + +Unfortunately, Windows does not offer a way to differentiate between a shutdown and a reboot, meaning the 'shutdown' +reason is triggered in both scenarios. For more details on the `WM_ENDSESSION` message and its associated reasons, +refer to the [MSDN documentation](https://learn.microsoft.com/en-us/windows/win32/shutdown/wm-endsession). diff --git a/filenames.auto.gni b/filenames.auto.gni index 9f70edb354..6dc0cf6e5b 100644 --- a/filenames.auto.gni +++ b/filenames.auto.gni @@ -151,6 +151,7 @@ auto_filenames = { "docs/api/structures/web-request-filter.md", "docs/api/structures/web-source.md", "docs/api/structures/window-open-handler-response.md", + "docs/api/structures/window-session-end-event.md", ] sandbox_bundle_deps = [ diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index 6bd02c292d..e034f4c30b 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -177,8 +177,37 @@ void BaseWindow::OnWindowClosed() { FROM_HERE, GetDestroyClosure()); } -void BaseWindow::OnWindowEndSession() { - Emit("session-end"); +void BaseWindow::OnWindowQueryEndSession( + const std::vector<std::string>& reasons, + bool* prevent_default) { + v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); + v8::HandleScope handle_scope(isolate); + + gin::Handle<gin_helper::internal::Event> event = + gin_helper::internal::Event::New(isolate); + v8::Local<v8::Object> event_object = event.ToV8().As<v8::Object>(); + + gin::Dictionary dict(isolate, event_object); + dict.Set("reasons", reasons); + + EmitWithoutEvent("query-session-end", event); + if (event->GetDefaultPrevented()) { + *prevent_default = true; + } +} + +void BaseWindow::OnWindowEndSession(const std::vector<std::string>& reasons) { + v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); + v8::HandleScope handle_scope(isolate); + + gin::Handle<gin_helper::internal::Event> event = + gin_helper::internal::Event::New(isolate); + v8::Local<v8::Object> event_object = event.ToV8().As<v8::Object>(); + + gin::Dictionary dict(isolate, event_object); + dict.Set("reasons", reasons); + + EmitWithoutEvent("session-end", event); } void BaseWindow::OnWindowBlur() { diff --git a/shell/browser/api/electron_api_base_window.h b/shell/browser/api/electron_api_base_window.h index 4cf992da7a..0291439da2 100644 --- a/shell/browser/api/electron_api_base_window.h +++ b/shell/browser/api/electron_api_base_window.h @@ -57,7 +57,9 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>, // NativeWindowObserver: void WillCloseWindow(bool* prevent_default) override; void OnWindowClosed() override; - void OnWindowEndSession() override; + void OnWindowQueryEndSession(const std::vector<std::string>& reasons, + bool* prevent_default) override; + void OnWindowEndSession(const std::vector<std::string>& reasons) override; void OnWindowBlur() override; void OnWindowFocus() override; void OnWindowShow() override; diff --git a/shell/browser/native_window.cc b/shell/browser/native_window.cc index 1506aa3abf..5acb2581c5 100644 --- a/shell/browser/native_window.cc +++ b/shell/browser/native_window.cc @@ -532,9 +532,17 @@ void NativeWindow::NotifyWindowClosed() { WindowList::RemoveWindow(this); } -void NativeWindow::NotifyWindowEndSession() { +void NativeWindow::NotifyWindowQueryEndSession( + const std::vector<std::string>& reasons, + bool* prevent_default) { for (NativeWindowObserver& observer : observers_) - observer.OnWindowEndSession(); + observer.OnWindowQueryEndSession(reasons, prevent_default); +} + +void NativeWindow::NotifyWindowEndSession( + const std::vector<std::string>& reasons) { + for (NativeWindowObserver& observer : observers_) + observer.OnWindowEndSession(reasons); } void NativeWindow::NotifyWindowBlur() { diff --git a/shell/browser/native_window.h b/shell/browser/native_window.h index 2eb262386f..6108e0b50e 100644 --- a/shell/browser/native_window.h +++ b/shell/browser/native_window.h @@ -302,7 +302,9 @@ class NativeWindow : public base::SupportsUserData, void NotifyWindowRequestPreferredWidth(int* width); void NotifyWindowCloseButtonClicked(); void NotifyWindowClosed(); - void NotifyWindowEndSession(); + void NotifyWindowQueryEndSession(const std::vector<std::string>& reasons, + bool* prevent_default); + void NotifyWindowEndSession(const std::vector<std::string>& reasons); void NotifyWindowBlur(); void NotifyWindowFocus(); void NotifyWindowShow(); diff --git a/shell/browser/native_window_observer.h b/shell/browser/native_window_observer.h index ba7d3fb14a..23bec5c4ba 100644 --- a/shell/browser/native_window_observer.h +++ b/shell/browser/native_window_observer.h @@ -50,8 +50,12 @@ class NativeWindowObserver : public base::CheckedObserver { // Called when the window is closed. virtual void OnWindowClosed() {} + // Called when Windows sends WM_QUERYENDSESSION message. + virtual void OnWindowQueryEndSession(const std::vector<std::string>& reasons, + bool* prevent_default) {} + // Called when Windows sends WM_ENDSESSION message - virtual void OnWindowEndSession() {} + virtual void OnWindowEndSession(const std::vector<std::string>& reasons) {} // Called when window loses focus. virtual void OnWindowBlur() {} diff --git a/shell/browser/native_window_views_win.cc b/shell/browser/native_window_views_win.cc index ce3b50a043..9857d93b22 100644 --- a/shell/browser/native_window_views_win.cc +++ b/shell/browser/native_window_views_win.cc @@ -27,6 +27,24 @@ namespace electron { namespace { +// Convert Win32 WM_QUERYENDSESSIONS to strings. +const std::vector<std::string> EndSessionToStringVec(LPARAM end_session_id) { + std::vector<std::string> params; + if (end_session_id == 0) { + params.push_back("shutdown"); + return params; + } + + if (end_session_id & ENDSESSION_CLOSEAPP) + params.push_back("close-app"); + if (end_session_id & ENDSESSION_CRITICAL) + params.push_back("critical"); + if (end_session_id & ENDSESSION_LOGOFF) + params.push_back("logoff"); + + return params; +} + // Convert Win32 WM_APPCOMMANDS to strings. constexpr std::string_view AppCommandToString(int command_id) { switch (command_id) { @@ -389,9 +407,20 @@ bool NativeWindowViews::PreHandleMSG(UINT message, } return false; } + case WM_QUERYENDSESSION: { + bool prevent_default = false; + std::vector<std::string> reasons = EndSessionToStringVec(l_param); + NotifyWindowQueryEndSession(reasons, &prevent_default); + // Result should be TRUE by default, otherwise WM_ENDSESSION will not be + // fired in some cases: More: + // https://learn.microsoft.com/en-us/windows/win32/rstmgr/guidelines-for-applications + *result = !prevent_default; + return prevent_default; + } case WM_ENDSESSION: { + std::vector<std::string> reasons = EndSessionToStringVec(l_param); if (w_param) { - NotifyWindowEndSession(); + NotifyWindowEndSession(reasons); } return false; } diff --git a/shell/common/gin_helper/event_emitter.h b/shell/common/gin_helper/event_emitter.h index 379181d79b..352c39a5cb 100644 --- a/shell/common/gin_helper/event_emitter.h +++ b/shell/common/gin_helper/event_emitter.h @@ -45,6 +45,17 @@ class EventEmitter : public gin_helper::Wrappable<T> { return EmitWithEvent(name, event, std::forward<Args>(args)...); } + // this.emit(name, args...); + template <typename... Args> + void EmitWithoutEvent(const std::string_view name, Args&&... args) { + v8::HandleScope handle_scope(isolate()); + v8::Local<v8::Object> wrapper = GetWrapper(); + if (wrapper.IsEmpty()) + return; + gin_helper::EmitEvent(isolate(), GetWrapper(), name, + std::forward<Args>(args)...); + } + // disable copy EventEmitter(const EventEmitter&) = delete; EventEmitter& operator=(const EventEmitter&) = delete;
feat
ef097b77adcfcc478837f0132962ce456b525130
Michaela Laurencin
2024-04-29 08:41:54
chore: fix notes stack updates (#41600) * chore: fix removeSupercededStackUpdates for generating notes * add early stop for less than * Update script/release/notes/notes.js Co-authored-by: David Sanders <[email protected]> * clean up comparison functionality * add tests --------- Co-authored-by: David Sanders <[email protected]>
diff --git a/script/release/notes/notes.js b/script/release/notes/notes.js index 7b2dc8392c..b7302e2613 100644 --- a/script/release/notes/notes.js +++ b/script/release/notes/notes.js @@ -485,6 +485,24 @@ const getNotes = async (fromRef, toRef, newVersion) => { return notes; }; +const compareVersions = (v1, v2) => { + const [split1, split2] = [v1.split('.'), v2.split('.')]; + + if (split1.length !== split2.length) { + throw new Error(`Expected version strings to have same number of sections: ${split1} and ${split2}`); + } + for (let i = 0; i < split1.length; i++) { + const p1 = parseInt(split1[i], 10); + const p2 = parseInt(split2[i], 10); + + if (p1 > p2) return 1; + else if (p1 < p2) return -1; + // Continue checking the value if this portion is equal + } + + return 0; +}; + const removeSupercededStackUpdates = (commits) => { const updateRegex = /^Updated ([a-zA-Z.]+) to v?([\d.]+)/; const notupdates = []; @@ -496,8 +514,9 @@ const removeSupercededStackUpdates = (commits) => { notupdates.push(commit); continue; } + const [, dep, version] = match; - if (!newest[dep] || newest[dep].version < version) { + if (!newest[dep] || compareVersions(version, newest[dep].version) > 0) { newest[dep] = { commit, version }; } } diff --git a/spec/release-notes-spec.ts b/spec/release-notes-spec.ts index 43d1bbd257..316f22ebc5 100644 --- a/spec/release-notes-spec.ts +++ b/spec/release-notes-spec.ts @@ -211,4 +211,51 @@ describe('release notes', () => { expect(results.breaking[0].hash).to.equal(testCommit.sha1); }); }); + // test that when you have multiple stack updates only the + // latest will be kept + describe('superseding stack updates', () => { + const oldBranch = '27-x-y'; + const newBranch = '28-x-y'; + + const version = 'v28.0.0'; + + it('with different major versions', async function () { + const mostRecentCommit = new Commit('9d0e6d09f0be0abbeae46dd3d66afd96d2daacaa', 'chore: bump chromium to 119.0.6043.0'); + + const sharedChromiumHistory = [ + new Commit('029127a8b6f7c511fca4612748ad5b50e43aadaa', 'chore: bump chromium to 118.0.5993.0') // merge-base + ]; + const chromiumPatchUpdates = [ + new Commit('d9ba26273ad3e7a34c905eccbd5dabda4eb7b402', 'chore: bump chromium to 118.0.5991.0'), + mostRecentCommit, + new Commit('d6c8ff2e7050f30dffd784915bcbd2a9f993cdb2', 'chore: bump chromium to 119.0.6029.0') + ]; + + gitFake.setBranch(oldBranch, sharedChromiumHistory); + gitFake.setBranch(newBranch, [...sharedChromiumHistory, ...chromiumPatchUpdates]); + + const results: any = await notes.get(oldBranch, newBranch, version); + expect(results.other).to.have.lengthOf(1); + expect(results.other[0].hash).to.equal(mostRecentCommit.sha1); + }); + it('with different build versions', async function () { + const mostRecentCommit = new Commit('8f7a48879ef8633a76279803637cdee7f7c6cd4f', 'chore: bump chromium to 119.0.6045.0'); + + const sharedChromiumHistory = [ + new Commit('029127a8b6f7c511fca4612748ad5b50e43aadaa', 'chore: bump chromium to 118.0.5993.0') // merge-base + ]; + const chromiumPatchUpdates = [ + mostRecentCommit, + new Commit('9d0e6d09f0be0abbeae46dd3d66afd96d2daacaa', 'chore: bump chromium to 119.0.6043.0'), + new Commit('d6c8ff2e7050f30dffd784915bcbd2a9f993cdb2', 'chore: bump chromium to 119.0.6029.0') + ]; + + gitFake.setBranch(oldBranch, sharedChromiumHistory); + gitFake.setBranch(newBranch, [...sharedChromiumHistory, ...chromiumPatchUpdates]); + + const results: any = await notes.get(oldBranch, newBranch, version); + expect(results.other).to.have.lengthOf(1); + expect(results.other[0].hash).to.equal(mostRecentCommit.sha1); + }); + }); });
chore
ecd5d0a3a48d6cf94ee40173a58c756bbdc755ad
Robo
2025-01-30 03:20:37
fix: crash in gin::wrappable::secondweakcallback (#45368)
diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 671a98a5b4..b0ae1dc093 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -140,3 +140,4 @@ build_add_public_config_simdutf_config.patch revert_code_health_clean_up_stale_macwebcontentsocclusion.patch build_remove_vr_directx_helpers_dependency.patch ignore_parse_errors_for_pkey_appusermodel_toastactivatorclsid.patch +feat_add_signals_when_embedder_cleanup_callbacks_run_for.patch diff --git a/patches/chromium/feat_add_signals_when_embedder_cleanup_callbacks_run_for.patch b/patches/chromium/feat_add_signals_when_embedder_cleanup_callbacks_run_for.patch new file mode 100644 index 0000000000..a19135828c --- /dev/null +++ b/patches/chromium/feat_add_signals_when_embedder_cleanup_callbacks_run_for.patch @@ -0,0 +1,168 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: deepak1556 <[email protected]> +Date: Wed, 29 Jan 2025 17:01:03 +0900 +Subject: feat: add signals when embedder cleanup callbacks run for + gin::wrappable + +Current setup of finalization callbacks does not work well with +gin_helper::CleanedUpAtExit for wrappables specifically on environment +shutdown leading to UAF in the second pass. + +Details at https://github.com/microsoft/vscode/issues/192119#issuecomment-2375851531 + +The signals exposed in this patch does the following 2 things, + +1) Fix weak state of the wrapped object when the finializer callbacks + have not yet been processed +2) Avoid calling into the second pass when the embedder has already + destroyed the wrapped object via CleanedUpAtExit. + +This patch is more of a bandaid fix to improve the lifetime +management with existing finalizer callbacks. We should be able to +remove this patch once gin::Wrappable can be managed by V8 Oilpan + +Refs https://issues.chromium.org/issues/40210365 which is blocked +on https://issues.chromium.org/issues/42203693 + +diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc +index 2be37976a1305f1deed561b3b829dbb5d7ae85e7..44eb16f17d272125e2b4a590f8962eb8144d9755 100644 +--- a/gin/isolate_holder.cc ++++ b/gin/isolate_holder.cc +@@ -34,6 +34,8 @@ v8::ArrayBuffer::Allocator* g_array_buffer_allocator = nullptr; + const intptr_t* g_reference_table = nullptr; + v8::FatalErrorCallback g_fatal_error_callback = nullptr; + v8::OOMErrorCallback g_oom_error_callback = nullptr; ++bool g_initialized_microtasks_runner = false; ++bool g_destroyed_microtasks_runner = false; + + std::unique_ptr<v8::Isolate::CreateParams> getModifiedIsolateParams( + std::unique_ptr<v8::Isolate::CreateParams> params, +@@ -198,10 +200,26 @@ IsolateHolder::getDefaultIsolateParams() { + return params; + } + ++// static ++bool IsolateHolder::DestroyedMicrotasksRunner() { ++ return g_initialized_microtasks_runner && ++ g_destroyed_microtasks_runner; ++} ++ + void IsolateHolder::EnableIdleTasks( + std::unique_ptr<V8IdleTaskRunner> idle_task_runner) { + DCHECK(isolate_data_.get()); + isolate_data_->EnableIdleTasks(std::move(idle_task_runner)); + } + ++void IsolateHolder::WillCreateMicrotasksRunner() { ++ DCHECK(!g_initialized_microtasks_runner); ++ g_initialized_microtasks_runner = true; ++} ++ ++void IsolateHolder::WillDestroyMicrotasksRunner() { ++ DCHECK(g_initialized_microtasks_runner); ++ g_destroyed_microtasks_runner = true; ++} ++ + } // namespace gin +diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h +index 52b8c1af58678b9fee684ff75340c98fcc73b552..f79407d741a30298d09efd53589f16dc9b26107f 100644 +--- a/gin/public/isolate_holder.h ++++ b/gin/public/isolate_holder.h +@@ -131,6 +131,8 @@ class GIN_EXPORT IsolateHolder { + // Should only be called after v8::IsolateHolder::Initialize() is invoked. + static std::unique_ptr<v8::Isolate::CreateParams> getDefaultIsolateParams(); + ++ static bool DestroyedMicrotasksRunner(); ++ + v8::Isolate* isolate() { return isolate_; } + + // This method returns if v8::Locker is needed to access isolate. +@@ -144,6 +146,9 @@ class GIN_EXPORT IsolateHolder { + + void EnableIdleTasks(std::unique_ptr<V8IdleTaskRunner> idle_task_runner); + ++ void WillCreateMicrotasksRunner(); ++ void WillDestroyMicrotasksRunner(); ++ + // This method returns V8IsolateMemoryDumpProvider of this isolate, used for + // testing. + V8IsolateMemoryDumpProvider* isolate_memory_dump_provider_for_testing() +diff --git a/gin/wrappable.cc b/gin/wrappable.cc +index 402355cb836cea14e9ee725a142a4bad44fd5bed..7e7f028dcfb87c7b80adebabac19ced8791f642e 100644 +--- a/gin/wrappable.cc ++++ b/gin/wrappable.cc +@@ -13,6 +13,9 @@ namespace gin { + WrappableBase::WrappableBase() = default; + + WrappableBase::~WrappableBase() { ++ if (!wrapper_.IsEmpty()) { ++ wrapper_.ClearWeak(); ++ } + wrapper_.Reset(); + } + +@@ -28,15 +31,24 @@ const char* WrappableBase::GetTypeName() { + void WrappableBase::FirstWeakCallback( + const v8::WeakCallbackInfo<WrappableBase>& data) { + WrappableBase* wrappable = data.GetParameter(); +- wrappable->dead_ = true; +- wrappable->wrapper_.Reset(); +- data.SetSecondPassCallback(SecondWeakCallback); ++ WrappableBase* wrappable_from_field = ++ static_cast<WrappableBase*>(data.GetInternalField(1)); ++ if (wrappable && wrappable == wrappable_from_field) { ++ wrappable->dead_ = true; ++ wrappable->wrapper_.Reset(); ++ data.SetSecondPassCallback(SecondWeakCallback); ++ } + } + + void WrappableBase::SecondWeakCallback( + const v8::WeakCallbackInfo<WrappableBase>& data) { ++ if (IsolateHolder::DestroyedMicrotasksRunner()) { ++ return; ++ } + WrappableBase* wrappable = data.GetParameter(); +- delete wrappable; ++ if (wrappable) { ++ delete wrappable; ++ } + } + + v8::MaybeLocal<v8::Object> WrappableBase::GetWrapperImpl(v8::Isolate* isolate, +@@ -71,10 +83,16 @@ v8::MaybeLocal<v8::Object> WrappableBase::GetWrapperImpl(v8::Isolate* isolate, + void* values[] = {info, this}; + wrapper->SetAlignedPointerInInternalFields(2, indices, values); + wrapper_.Reset(isolate, wrapper); +- wrapper_.SetWeak(this, FirstWeakCallback, v8::WeakCallbackType::kParameter); ++ wrapper_.SetWeak(this, FirstWeakCallback, v8::WeakCallbackType::kInternalFields); + return v8::MaybeLocal<v8::Object>(wrapper); + } + ++void WrappableBase::ClearWeak() { ++ if (!wrapper_.IsEmpty()) { ++ wrapper_.ClearWeak(); ++ } ++} ++ + namespace internal { + + void* FromV8Impl(v8::Isolate* isolate, v8::Local<v8::Value> val, +diff --git a/gin/wrappable.h b/gin/wrappable.h +index 4e7115685a5bf6997e78edcc1851e28bd00b1aa2..ca51fe33605e855438e88969e3d3cc734ef4523e 100644 +--- a/gin/wrappable.h ++++ b/gin/wrappable.h +@@ -80,6 +80,13 @@ class GIN_EXPORT WrappableBase { + v8::MaybeLocal<v8::Object> GetWrapperImpl(v8::Isolate* isolate, + WrapperInfo* wrapper_info); + ++ // Make this wrappable strong again. This is useful when the wrappable is ++ // destroyed outside the finalizer callbacks and we want to avoid scheduling ++ // the weak callbacks if they haven't been scheduled yet. ++ // NOTE!!! this does not prevent finalization callbacks from running if they ++ // have already been processed. ++ void ClearWeak(); ++ + private: + static void FirstWeakCallback( + const v8::WeakCallbackInfo<WrappableBase>& data); diff --git a/patches/chromium/ignore_parse_errors_for_pkey_appusermodel_toastactivatorclsid.patch b/patches/chromium/ignore_parse_errors_for_pkey_appusermodel_toastactivatorclsid.patch index 6f97dd9b9c..f55532ec44 100644 --- a/patches/chromium/ignore_parse_errors_for_pkey_appusermodel_toastactivatorclsid.patch +++ b/patches/chromium/ignore_parse_errors_for_pkey_appusermodel_toastactivatorclsid.patch @@ -11,10 +11,10 @@ Bug: N/A Change-Id: I9fc472212b2d3afac2c8e18a2159bc2d50bbdf98 diff --git a/AUTHORS b/AUTHORS -index 55dc38c1448c1960b802c136018c8be22ed61c18..5cd195df3650331fbfd62b2f964368b5f3217f3c 100644 +index 6008db66fcb0686046a5ca40d04bb2534cb0b04a..d5079e68cef38168c4c66833a53121930fa59afd 100644 --- a/AUTHORS +++ b/AUTHORS -@@ -337,6 +337,7 @@ David Futcher <[email protected]> +@@ -339,6 +339,7 @@ David Futcher <[email protected]> David Jin <[email protected]> David Lechner <[email protected]> David Leen <[email protected]> @@ -23,10 +23,10 @@ index 55dc38c1448c1960b802c136018c8be22ed61c18..5cd195df3650331fbfd62b2f964368b5 David McAllister <[email protected]> David Michael Barr <[email protected]> diff --git a/base/win/shortcut.cc b/base/win/shortcut.cc -index e790adb2f1d6529ac0dd77145f5da2796264c7ae..8a7edcfaf9af963468b4b42fe55a771fb31f13a2 100644 +index 967e130e823f41c402411dfadb53b805e8a8c92b..3a9df7f31861ca69168fd24513ee554d0984798d 100644 --- a/base/win/shortcut.cc +++ b/base/win/shortcut.cc -@@ -342,8 +342,9 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path, +@@ -356,8 +356,9 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path, *(pv_toast_activator_clsid.get().puuid)); break; default: diff --git a/shell/browser/api/electron_api_notification.cc b/shell/browser/api/electron_api_notification.cc index 459a2e1b7e..db63ac7326 100644 --- a/shell/browser/api/electron_api_notification.cc +++ b/shell/browser/api/electron_api_notification.cc @@ -236,6 +236,10 @@ const char* Notification::GetTypeName() { return GetClassName(); } +void Notification::WillBeDestroyed() { + ClearWeak(); +} + } // namespace electron::api namespace { diff --git a/shell/browser/api/electron_api_notification.h b/shell/browser/api/electron_api_notification.h index c67c5d7160..96f5329158 100644 --- a/shell/browser/api/electron_api_notification.h +++ b/shell/browser/api/electron_api_notification.h @@ -57,6 +57,9 @@ class Notification final : public gin::Wrappable<Notification>, static gin::WrapperInfo kWrapperInfo; const char* GetTypeName() override; + // gin_helper::CleanedUpAtExit + void WillBeDestroyed() override; + // disable copy Notification(const Notification&) = delete; Notification& operator=(const Notification&) = delete; diff --git a/shell/browser/api/electron_api_session.cc b/shell/browser/api/electron_api_session.cc index e7cd8320fe..9f9c21278b 100644 --- a/shell/browser/api/electron_api_session.cc +++ b/shell/browser/api/electron_api_session.cc @@ -1909,6 +1909,10 @@ const char* Session::GetTypeName() { return GetClassName(); } +void Session::WillBeDestroyed() { + ClearWeak(); +} + } // namespace electron::api namespace { diff --git a/shell/browser/api/electron_api_session.h b/shell/browser/api/electron_api_session.h index e1a6255d9d..0ffaabcd2d 100644 --- a/shell/browser/api/electron_api_session.h +++ b/shell/browser/api/electron_api_session.h @@ -103,6 +103,9 @@ class Session final : public gin::Wrappable<Session>, static const char* GetClassName() { return "Session"; } const char* GetTypeName() override; + // gin_helper::CleanedUpAtExit + void WillBeDestroyed() override; + // Methods. v8::Local<v8::Promise> ResolveHost( std::string host, diff --git a/shell/browser/api/electron_api_tray.cc b/shell/browser/api/electron_api_tray.cc index 1d69d84885..0cfd053234 100644 --- a/shell/browser/api/electron_api_tray.cc +++ b/shell/browser/api/electron_api_tray.cc @@ -431,6 +431,10 @@ const char* Tray::GetTypeName() { return GetClassName(); } +void Tray::WillBeDestroyed() { + ClearWeak(); +} + } // namespace electron::api namespace { diff --git a/shell/browser/api/electron_api_tray.h b/shell/browser/api/electron_api_tray.h index fbcb908d04..b59615c095 100644 --- a/shell/browser/api/electron_api_tray.h +++ b/shell/browser/api/electron_api_tray.h @@ -58,6 +58,9 @@ class Tray final : public gin::Wrappable<Tray>, static gin::WrapperInfo kWrapperInfo; const char* GetTypeName() override; + // gin_helper::CleanedUpAtExit + void WillBeDestroyed() override; + // disable copy Tray(const Tray&) = delete; Tray& operator=(const Tray&) = delete; diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index aabdada64f..751baa8d66 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -4569,6 +4569,10 @@ const char* WebContents::GetTypeName() { return GetClassName(); } +void WebContents::WillBeDestroyed() { + ClearWeak(); +} + ElectronBrowserContext* WebContents::GetBrowserContext() const { return static_cast<ElectronBrowserContext*>( web_contents()->GetBrowserContext()); diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index c750aea4f6..2275f90171 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -180,6 +180,9 @@ class WebContents final : public ExclusiveAccessContext, static gin::WrapperInfo kWrapperInfo; const char* GetTypeName() override; + // gin_helper::CleanedUpAtExit + void WillBeDestroyed() override; + void Destroy(); void Close(std::optional<gin_helper::Dictionary> options); base::WeakPtr<WebContents> GetWeakPtr() { return weak_factory_.GetWeakPtr(); } diff --git a/shell/browser/api/message_port.cc b/shell/browser/api/message_port.cc index 9792bedaca..3d56361fc7 100644 --- a/shell/browser/api/message_port.cc +++ b/shell/browser/api/message_port.cc @@ -306,6 +306,10 @@ const char* MessagePort::GetTypeName() { return "MessagePort"; } +void MessagePort::WillBeDestroyed() { + ClearWeak(); +} + } // namespace electron namespace { diff --git a/shell/browser/api/message_port.h b/shell/browser/api/message_port.h index 1a2c7ff52b..e46be76cbe 100644 --- a/shell/browser/api/message_port.h +++ b/shell/browser/api/message_port.h @@ -61,6 +61,9 @@ class MessagePort final : public gin::Wrappable<MessagePort>, v8::Isolate* isolate) override; const char* GetTypeName() override; + // gin_helper::CleanedUpAtExit + void WillBeDestroyed() override; + private: MessagePort(); diff --git a/shell/browser/javascript_environment.cc b/shell/browser/javascript_environment.cc index b7bfa4a19b..3661d4132f 100644 --- a/shell/browser/javascript_environment.cc +++ b/shell/browser/javascript_environment.cc @@ -133,11 +133,16 @@ v8::Isolate* JavascriptEnvironment::GetIsolate() { void JavascriptEnvironment::CreateMicrotasksRunner() { DCHECK(!microtasks_runner_); microtasks_runner_ = std::make_unique<MicrotasksRunner>(isolate()); + isolate_holder_.WillCreateMicrotasksRunner(); base::CurrentThread::Get()->AddTaskObserver(microtasks_runner_.get()); } void JavascriptEnvironment::DestroyMicrotasksRunner() { DCHECK(microtasks_runner_); + // Should be called before running gin_helper::CleanedUpAtExit::DoCleanup. + // This helps to signal wrappable finalizer callbacks to not act on freed + // parameters. + isolate_holder_.WillDestroyMicrotasksRunner(); { v8::HandleScope scope(isolate_); gin_helper::CleanedUpAtExit::DoCleanup(); diff --git a/shell/common/api/electron_api_url_loader.cc b/shell/common/api/electron_api_url_loader.cc index 3189e45945..612843565f 100644 --- a/shell/common/api/electron_api_url_loader.cc +++ b/shell/common/api/electron_api_url_loader.cc @@ -819,4 +819,8 @@ const char* SimpleURLLoaderWrapper::GetTypeName() { return "SimpleURLLoaderWrapper"; } +void SimpleURLLoaderWrapper::WillBeDestroyed() { + ClearWeak(); +} + } // namespace electron::api diff --git a/shell/common/api/electron_api_url_loader.h b/shell/common/api/electron_api_url_loader.h index eddb0423d3..14557d91a8 100644 --- a/shell/common/api/electron_api_url_loader.h +++ b/shell/common/api/electron_api_url_loader.h @@ -66,6 +66,9 @@ class SimpleURLLoaderWrapper final v8::Isolate* isolate) override; const char* GetTypeName() override; + // gin_helper::CleanedUpAtExit + void WillBeDestroyed() override; + private: SimpleURLLoaderWrapper(ElectronBrowserContext* browser_context, std::unique_ptr<network::ResourceRequest> request, diff --git a/shell/common/gin_helper/cleaned_up_at_exit.cc b/shell/common/gin_helper/cleaned_up_at_exit.cc index 2632061219..6a73bfeccb 100644 --- a/shell/common/gin_helper/cleaned_up_at_exit.cc +++ b/shell/common/gin_helper/cleaned_up_at_exit.cc @@ -27,11 +27,14 @@ CleanedUpAtExit::~CleanedUpAtExit() { std::erase(GetDoomed(), this); } +void CleanedUpAtExit::WillBeDestroyed() {} + // static void CleanedUpAtExit::DoCleanup() { auto& doomed = GetDoomed(); while (!doomed.empty()) { CleanedUpAtExit* next = doomed.back(); + next->WillBeDestroyed(); delete next; } } diff --git a/shell/common/gin_helper/cleaned_up_at_exit.h b/shell/common/gin_helper/cleaned_up_at_exit.h index 35d9e1618e..e037264275 100644 --- a/shell/common/gin_helper/cleaned_up_at_exit.h +++ b/shell/common/gin_helper/cleaned_up_at_exit.h @@ -19,6 +19,8 @@ class CleanedUpAtExit { CleanedUpAtExit(); virtual ~CleanedUpAtExit(); + virtual void WillBeDestroyed(); + static void DoCleanup(); }; diff --git a/shell/common/gin_helper/wrappable.cc b/shell/common/gin_helper/wrappable.cc index 06b5061f18..81fa5b8373 100644 --- a/shell/common/gin_helper/wrappable.cc +++ b/shell/common/gin_helper/wrappable.cc @@ -4,6 +4,7 @@ #include "shell/common/gin_helper/wrappable.h" +#include "gin/public/isolate_holder.h" #include "shell/common/gin_helper/dictionary.h" #include "v8/include/v8-function.h" @@ -60,8 +61,10 @@ void WrappableBase::InitWith(v8::Isolate* isolate, // static void WrappableBase::FirstWeakCallback( const v8::WeakCallbackInfo<WrappableBase>& data) { - auto* wrappable = static_cast<WrappableBase*>(data.GetInternalField(0)); - if (wrappable) { + WrappableBase* wrappable = data.GetParameter(); + auto* wrappable_from_field = + static_cast<WrappableBase*>(data.GetInternalField(0)); + if (wrappable && wrappable == wrappable_from_field) { wrappable->wrapper_.Reset(); data.SetSecondPassCallback(SecondWeakCallback); } @@ -70,6 +73,9 @@ void WrappableBase::FirstWeakCallback( // static void WrappableBase::SecondWeakCallback( const v8::WeakCallbackInfo<WrappableBase>& data) { + if (gin::IsolateHolder::DestroyedMicrotasksRunner()) { + return; + } delete static_cast<WrappableBase*>(data.GetInternalField(0)); }
fix
7d045dcddb513f36cbf2cd022455963cddc9a9eb
Charles Kerr
2025-02-25 19:50:09
refactor: remove unused gin_helper::WrappableBase::GetWrapper(v8::Isolate*) (#45793) refactor: remove unused EventEmitter::GetWrapper(v8::Isolate*)
diff --git a/shell/common/gin_helper/wrappable.cc b/shell/common/gin_helper/wrappable.cc index 81fa5b8373..1d0f45e004 100644 --- a/shell/common/gin_helper/wrappable.cc +++ b/shell/common/gin_helper/wrappable.cc @@ -29,14 +29,6 @@ v8::Local<v8::Object> WrappableBase::GetWrapper() const { return {}; } -v8::MaybeLocal<v8::Object> WrappableBase::GetWrapper( - v8::Isolate* isolate) const { - if (!wrapper_.IsEmpty()) - return {v8::Local<v8::Object>::New(isolate, wrapper_)}; - else - return {}; -} - void WrappableBase::InitWithArgs(gin::Arguments* args) { v8::Local<v8::Object> holder; args->GetHolder(&holder); diff --git a/shell/common/gin_helper/wrappable_base.h b/shell/common/gin_helper/wrappable_base.h index 397fa5171e..9fa255bfe4 100644 --- a/shell/common/gin_helper/wrappable_base.h +++ b/shell/common/gin_helper/wrappable_base.h @@ -39,7 +39,6 @@ class WrappableBase { // Retrieve the v8 wrapper object corresponding to this object. v8::Local<v8::Object> GetWrapper() const; - v8::MaybeLocal<v8::Object> GetWrapper(v8::Isolate* isolate) const; // Returns the Isolate this object is created in. v8::Isolate* isolate() const { return isolate_; }
refactor
f727da4a74a93cca627f5db0da9f88c450944f69
github-actions[bot]
2023-04-21 10:37:02
ci: update appveyor image to latest version (#38015) build: update appveyor image to latest version Co-authored-by: jkleinsc <[email protected]>
diff --git a/appveyor-woa.yml b/appveyor-woa.yml index a219e9ffb6..09e96d5776 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-114.0.5710.0 +image: e-114.0.5719.0 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default diff --git a/appveyor.yml b/appveyor.yml index f8ee5cdc53..24d13665d2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-114.0.5710.0 +image: e-114.0.5719.0 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default
ci
47dbab3856d1a33b8de51e8c189827ef3a6359ea
Shelley Vohr
2025-02-14 10:22:13
fix: pointer lock permission after focus loss and regain (#45574)
diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index f0cc5b03a8..15f07ab865 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -1608,6 +1608,12 @@ void WebContents::LostPointerLock() { ->ExitExclusiveAccessToPreviousState(); } +bool WebContents::IsWaitingForPointerLockPrompt( + content::WebContents* web_contents) { + return exclusive_access_manager_.pointer_lock_controller() + ->IsWaitingForPointerLockPrompt(web_contents); +} + void WebContents::OnRequestKeyboardLock(content::WebContents* web_contents, bool esc_key_locked, bool allowed) { diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 057d6e0120..1ae4e56e5a 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -613,6 +613,8 @@ class WebContents final : public ExclusiveAccessContext, bool user_gesture, bool last_unlocked_by_target) override; void LostPointerLock() override; + bool IsWaitingForPointerLockPrompt( + content::WebContents* web_contents) override; void OnRequestKeyboardLock(content::WebContents* web_contents, bool esc_key_locked, bool allowed);
fix
b5997a012d181535246a1518900618babae07163
Robo
2023-08-28 23:16:20
chore: enable v8_enable_private_mapping_fork_optimization by default (#39253) * chore: enable v8_enable_private_mapping_fork_optimization by default * chore: cherry-pick 292a4a6 from v8
diff --git a/build/args/all.gn b/build/args/all.gn index c63574b7ac..7105de72a0 100644 --- a/build/args/all.gn +++ b/build/args/all.gn @@ -56,3 +56,7 @@ v8_builtins_profiling_log_file = "" # https://chromium.googlesource.com/chromium/src/+/main/docs/dangling_ptr.md # TODO(vertedinde): hunt down dangling pointers on Linux enable_dangling_raw_ptr_checks = false + +# This flag speeds up the performance of fork/execve on linux systems. +# Ref: https://chromium-review.googlesource.com/c/v8/v8/+/4602858 +v8_enable_private_mapping_fork_optimization = true diff --git a/patches/v8/.patches b/patches/v8/.patches index 4bd64c3307..562b73cdd4 100644 --- a/patches/v8/.patches +++ b/patches/v8/.patches @@ -2,3 +2,4 @@ build_gn.patch do_not_export_private_v8_symbols_on_windows.patch fix_build_deprecated_attribute_for_older_msvc_versions.patch chore_allow_customizing_microtask_policy_per_context.patch +fix_compile_error_on_macos_with_fork_optimization.patch diff --git a/patches/v8/fix_compile_error_on_macos_with_fork_optimization.patch b/patches/v8/fix_compile_error_on_macos_with_fork_optimization.patch new file mode 100644 index 0000000000..d1fc9ccdbc --- /dev/null +++ b/patches/v8/fix_compile_error_on_macos_with_fork_optimization.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: deepak1556 <[email protected]> +Date: Tue, 15 Aug 2023 23:59:59 +0900 +Subject: fix: compile error on macOS with + v8_enable_private_mapping_fork_optimization=true + +Follow-up to https://chromium-review.googlesource.com/c/v8/v8/+/4602858, +we are trying to enable this flag in Electron without any OS conditions in +args.gn which results in a compilation failure on macOS due to the lack of MADV_DONTFORK. + +Given that Node.js and Electron both use posix_spawn on macOS which +by default does not copy MAP_JIT locations, it would be safe to isolate +the change only for linux. + +Change-Id: I58ad50e557016fa573d7a27f33a60e2e5b7d1804 +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4780212 +Reviewed-by: Michael Lippautz <[email protected]> +Commit-Queue: Michael Lippautz <[email protected]> +Auto-Submit: Deepak Mohan (Robo) <[email protected]> +Cr-Commit-Position: refs/heads/main@{#89557} + +diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc +index 77fd9e8f6dd5938d38344ffb0074fb70a0969fd9..73cdbdb19df2aecf3046b2bb2b6cb121f4dc5ca7 100644 +--- a/src/base/platform/platform-posix.cc ++++ b/src/base/platform/platform-posix.cc +@@ -161,7 +161,7 @@ void* Allocate(void* hint, size_t size, OS::MemoryPermission access, + void* result = mmap(hint, size, prot, flags, kMmapFd, kMmapFdOffset); + if (result == MAP_FAILED) return nullptr; + +-#if V8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION ++#if V8_OS_LINUX && V8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION + // This is advisory, so we ignore errors. + madvise(result, size, MADV_DONTFORK); + #endif
chore