From 7521454161562594578ca28f62d7e7ce6982ce54 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 17 May 2019 06:20:10 +0900 Subject: [PATCH 01/94] fix: lagging when using tabbed window (#18314) --- patches/common/chromium/.patches | 1 + .../chromium/tabbed_window_lagging.patch | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 patches/common/chromium/tabbed_window_lagging.patch diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index 945628de73284..87563427f30da 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -100,3 +100,4 @@ make_--explicitly-allowed-ports_work_with_networkservice.patch fix_crashes_in_renderframeimpl_onselectpopupmenuitem_s.patch fix_re-entracy_problem_with_invalidateframesinkid.patch chore_expose_getcontentclient_to_embedders.patch +tabbed_window_lagging.patch diff --git a/patches/common/chromium/tabbed_window_lagging.patch b/patches/common/chromium/tabbed_window_lagging.patch new file mode 100644 index 0000000000000..1538624675ac3 --- /dev/null +++ b/patches/common/chromium/tabbed_window_lagging.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Cheng Zhao +Date: Thu May 16 13:52:12 JST 2019 +Subject: tabbed_window_lagging.patch + +Fix lagging when using tabbed windows. + +Later Chromium has some enhancements on graphics code that fix the lagging +problem, but the changes are split in multiple commits on multiple files and +we can not just cherry-pick them. + +Instead I'm just using the dummy fix and it does not seem to have side effects. + +diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm +index 69c5f1f44d7e..45aba19b2390 100644 +--- a/ui/views/cocoa/bridged_native_widget.mm ++++ b/ui/views/cocoa/bridged_native_widget.mm +@@ -1037,6 +1037,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { + // BridgedNativeWidget, ui::CATransactionObserver + + bool BridgedNativeWidget::ShouldWaitInPreCommit() { ++ // Fix lagging when using tabbed windows, see the issue for more: ++ // https://github.com/electron/electron/issues/16925 ++ if (@available(macOS 10.12, *)) { ++ if ([[window_ tabbedWindows] count] > 0) ++ return false; ++ } + if (!window_visible_) + return false; + if (ca_transaction_sync_suppressed_) From b763d81d79755d7e1637193147588d32e41e796b Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 16 May 2019 14:21:46 -0700 Subject: [PATCH 02/94] Bump v4.2.2 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index d87edbfc10694..078bf8b7ddcbb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.1 \ No newline at end of file +4.2.2 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 25886d5d66699..a9e2259ec8986 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.1 + 4.2.2 CFBundleShortVersionString - 4.2.1 + 4.2.2 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index e48ece6e23ce7..a85d7fffefa68 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,1,0 - PRODUCTVERSION 4,2,1,0 + FILEVERSION 4,2,2,0 + PRODUCTVERSION 4,2,2,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.1" + VALUE "FileVersion", "4.2.2" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.1" + VALUE "ProductVersion", "4.2.2" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 01a8fb350c511..614d5dcd82a4c 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 1 +#define ATOM_PATCH_VERSION 2 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index c8bfdd4ea320c..7a58f8f95ea9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.1", + "version": "4.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1cc773a244c7e..999a8f322d5dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.1", + "version": "4.2.2", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From e77b6878a9a9213c248c3e1827d3d8c94f569a27 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Tue, 21 May 2019 16:21:26 +0900 Subject: [PATCH 03/94] fix: 'page-title-updated' event forwarding + documentation (#18320) --- docs/api/browser-window.md | 2 ++ docs/api/web-contents.md | 11 +++++++++++ lib/browser/api/browser-window.js | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 42880cba0af3b..91707ba853715 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -406,9 +406,11 @@ Returns: * `event` Event * `title` String +* `explicitSet` Boolean Emitted when the document changed its title, calling `event.preventDefault()` will prevent the native window's title from changing. +`explicitSet` is false when title is synthesized from file url. #### Event: 'close' diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index fd96d6d53eb2a..7df2b6b282356 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -101,6 +101,17 @@ Returns: Emitted when the document in the given frame is loaded. +#### Event: 'page-title-updated' + +Returns: + +* `event` Event +* `title` String +* `explicitSet` Boolean + +Fired when page title is set during navigation. `explicitSet` is false when +title is synthesized from file url. + #### Event: 'page-favicon-updated' Returns: diff --git a/lib/browser/api/browser-window.js b/lib/browser/api/browser-window.js index 3694acd119c99..a35747afe69db 100644 --- a/lib/browser/api/browser-window.js +++ b/lib/browser/api/browser-window.js @@ -39,9 +39,9 @@ BrowserWindow.prototype._init = function () { }) // Change window title to page title. - this.webContents.on('page-title-updated', (event, title) => { + this.webContents.on('page-title-updated', (event, title, ...args) => { // Route the event to BrowserWindow. - this.emit('page-title-updated', event, title) + this.emit('page-title-updated', event, title, ...args) if (!this.isDestroyed() && !event.defaultPrevented) this.setTitle(title) }) From 02e325d1ab2ac6660708f5dd2c9ad9f558f64d7f Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 28 May 2019 23:20:32 +0200 Subject: [PATCH 04/94] chore: remove leftovers from memory property removal from app.getAppMetrics() (#18422) --- docs/api/structures/memory-info.md | 12 ------------ lib/browser/api/app.js | 12 ------------ 2 files changed, 24 deletions(-) delete mode 100644 docs/api/structures/memory-info.md diff --git a/docs/api/structures/memory-info.md b/docs/api/structures/memory-info.md deleted file mode 100644 index fe0b7d4d7efc9..0000000000000 --- a/docs/api/structures/memory-info.md +++ /dev/null @@ -1,12 +0,0 @@ -# MemoryInfo Object - -* `pid` Integer - Process id of the process. -* `workingSetSize` Integer - The amount of memory currently pinned to actual physical RAM. -* `peakWorkingSetSize` Integer - The maximum amount of memory that has ever been pinned - to actual physical RAM. On macOS its value will always be 0. -* `privateBytes` Integer - The amount of memory not shared by other processes, such as - JS heap or HTML content. -* `sharedBytes` Integer - The amount of memory shared between processes, typically - memory consumed by the Electron code itself - -Note that all statistics are reported in Kilobytes. diff --git a/lib/browser/api/app.js b/lib/browser/api/app.js index 4cef536ff5133..53ffb31f1dd3e 100644 --- a/lib/browser/api/app.js +++ b/lib/browser/api/app.js @@ -40,18 +40,6 @@ Object.assign(app, { } }) -const nativeFn = app.getAppMetrics -app.getAppMetrics = () => { - const metrics = nativeFn.call(app) - for (const metric of metrics) { - if ('memory' in metric) { - deprecate.removeProperty(metric, 'memory') - } - } - - return metrics -} - app.isPackaged = (() => { const execFile = path.basename(process.execPath).toLowerCase() if (process.platform === 'win32') { From 75d27c081033606d4e796fc4f27039da0ace0239 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 28 May 2019 21:26:38 -0700 Subject: [PATCH 05/94] fix: respect minimizable/closable for customButtonsOnHover (#18479) --- atom/browser/native_window_mac.h | 2 +- atom/browser/native_window_mac.mm | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/atom/browser/native_window_mac.h b/atom/browser/native_window_mac.h index f948c7a3acec6..e8fbf84e76c2b 100644 --- a/atom/browser/native_window_mac.h +++ b/atom/browser/native_window_mac.h @@ -164,7 +164,7 @@ class NativeWindowMac : public NativeWindow { private: // Add custom layers to the content view. - void AddContentViewLayers(); + void AddContentViewLayers(bool minimizable, bool closable); void InternalSetParentWindow(NativeWindow* parent, bool attach); void ShowWindowButton(NSWindowButton button); diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index f9b6d9a7e05d2..541c90fff4235 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -73,9 +73,11 @@ - (id)initWithFrame:(NSRect)frame { NSButton* close_button = [NSWindow standardWindowButton:NSWindowCloseButton forStyleMask:NSWindowStyleMaskTitled]; + [close_button setTag:1]; NSButton* miniaturize_button = [NSWindow standardWindowButton:NSWindowMiniaturizeButton forStyleMask:NSWindowStyleMaskTitled]; + [miniaturize_button setTag:2]; CGFloat x = 0; const CGFloat space_between = 20; @@ -466,7 +468,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { // Default content view. SetContentView(new views::View()); - AddContentViewLayers(); + AddContentViewLayers(minimizable, closable); original_frame_ = [window_ frame]; original_level_ = [window_ level]; @@ -857,9 +859,9 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { if (newLevel >= minWindowLevel && newLevel <= maxWindowLevel) { [window_ setLevel:newLevel]; } else { - *error = std::string([ - [NSString stringWithFormat:@"relativeLevel must be between %d and %d", - minWindowLevel, maxWindowLevel] UTF8String]); + *error = std::string([[NSString + stringWithFormat:@"relativeLevel must be between %d and %d", + minWindowLevel, maxWindowLevel] UTF8String]); } } @@ -1080,7 +1082,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { if (browser_view()) { [browser_view()->GetInspectableWebContentsView()->GetNativeView() - removeFromSuperview]; + removeFromSuperview]; set_browser_view(nullptr); } @@ -1379,7 +1381,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { return root_view_.get(); } -void NativeWindowMac::AddContentViewLayers() { +void NativeWindowMac::AddContentViewLayers(bool minimizable, bool closable) { // Make sure the bottom corner is rounded for non-modal windows: // http://crbug.com/396264. But do not enable it on OS X 10.9 for transparent // window, otherwise a semi-transparent frame would show. @@ -1420,6 +1422,12 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { [[CustomWindowButtonView alloc] initWithFrame:NSZeroRect]); // NSWindowStyleMaskFullSizeContentView does not work with zoom button SetFullScreenable(false); + + if (!minimizable) + [[buttons_view_ viewWithTag:2] removeFromSuperview]; + if (!closable) + [[buttons_view_ viewWithTag:1] removeFromSuperview]; + [[window_ contentView] addSubview:buttons_view_]; } else { if (title_bar_style_ != NORMAL) { @@ -1484,7 +1492,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [container_view_ setFrame:[[[window_ contentView] superview] bounds]]; [window_ setContentView:container_view_]; - AddContentViewLayers(); + AddContentViewLayers(IsMinimizable(), IsClosable()); } void NativeWindowMac::SetStyleMask(bool on, NSUInteger flag) { From fb0c56c9464ce49727c33ab5024a6e995b995979 Mon Sep 17 00:00:00 2001 From: Alexey Kuzmin Date: Thu, 30 May 2019 16:16:54 +0200 Subject: [PATCH 06/94] build: backport "Restore live region changed events for processing by JAWS focus mode" (#18474) --- patches/common/chromium/.patches | 1 + ...ts_for_processing_by_jaws_focus_mode.patch | 67 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 patches/common/chromium/restore_live_region_changed_events_for_processing_by_jaws_focus_mode.patch diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index 87563427f30da..6bd488631d24e 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -101,3 +101,4 @@ fix_crashes_in_renderframeimpl_onselectpopupmenuitem_s.patch fix_re-entracy_problem_with_invalidateframesinkid.patch chore_expose_getcontentclient_to_embedders.patch tabbed_window_lagging.patch +restore_live_region_changed_events_for_processing_by_jaws_focus_mode.patch diff --git a/patches/common/chromium/restore_live_region_changed_events_for_processing_by_jaws_focus_mode.patch b/patches/common/chromium/restore_live_region_changed_events_for_processing_by_jaws_focus_mode.patch new file mode 100644 index 0000000000000..fbf5adfca58ec --- /dev/null +++ b/patches/common/chromium/restore_live_region_changed_events_for_processing_by_jaws_focus_mode.patch @@ -0,0 +1,67 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aaron Leventhal +Date: Mon, 10 Sep 2018 19:54:14 +0000 +Subject: Restore live region changed events for processing by JAWS focus mode + +The live region changed events are needed by current versions of JAWS, +which do not process the text inserted events fired by Chrome in all +modes. Specifically, current versions of JAWS processes text inserted +events in virtual cursor mode but not in focus mode. This may change +in future versions of JAWS, and so at some point the live region +changed events may truly become redundant with the text inserted events. + +Bug: 878929 +Change-Id: I3286c84d1d6366735a38af19e68f4c526658b68b +Reviewed-on: https://chromium-review.googlesource.com/1211508 +Commit-Queue: Dominic Mazzoni +Reviewed-by: Dominic Mazzoni +Cr-Original-Commit-Position: refs/heads/master@{#589412}(cherry picked from commit 521309feaeed915f42a14ce734dd6f0232062532) +Reviewed-on: https://chromium-review.googlesource.com/1216944 +Reviewed-by: Aaron Leventhal +Cr-Commit-Position: refs/branch-heads/3538@{#242} +Cr-Branched-From: 79f7c91a2b2a2932cd447fa6f865cb6662fa8fa6-refs/heads/master@{#587811} + +diff --git a/content/browser/accessibility/browser_accessibility_manager_win.cc b/content/browser/accessibility/browser_accessibility_manager_win.cc +index f6179284bb4b4e215105de5253bede04feff08bb..b45dc6f416048f387388c3fdbc9821f75648eee6 100644 +--- a/content/browser/accessibility/browser_accessibility_manager_win.cc ++++ b/content/browser/accessibility/browser_accessibility_manager_win.cc +@@ -179,10 +179,18 @@ void BrowserAccessibilityManagerWin::FireGeneratedEvent( + FireWinAccessibilityEvent(EVENT_OBJECT_REORDER, node); + break; + case Event::LIVE_REGION_CHANGED: +- // NVDA and JAWS are inconsistent about speaking this event in content. +- // Because of this, and because Firefox does not currently fire it, we +- // are avoiding this event for now. +- // FireWinAccessibilityEvent(EVENT_OBJECT_LIVEREGIONCHANGED, node); ++ // This event is redundant with the IA2_EVENT_TEXT_INSERTED events; ++ // however, JAWS 2018 and earlier do not process the text inserted ++ // events when "virtual cursor mode" is turned off (Insert+Z). ++ // Fortunately, firing the redudant event does not cause duplicate ++ // verbalizations in either screen reader. ++ // Future versions of JAWS may process the text inserted event when ++ // in focus mode, and so at some point the live region ++ // changed events may truly become redundant with the text inserted ++ // events. Note: Firefox does not fire this event, but JAWS processes ++ // Firefox live region events differently (utilizes MSAA's ++ // EVENT_OBJECT_SHOW). ++ FireWinAccessibilityEvent(EVENT_OBJECT_LIVEREGIONCHANGED, node); + break; + case Event::LOAD_COMPLETE: + FireWinAccessibilityEvent(IA2_EVENT_DOCUMENT_LOAD_COMPLETE, node); +diff --git a/content/test/data/accessibility/event/live-region-add-expected-win.txt b/content/test/data/accessibility/event/live-region-add-expected-win.txt +index a57cfad63ae0c7ef351fcb732f9903e59b207555..2768682f95a332d32fc3daa9dd9e3eaa0758eb24 100644 +--- a/content/test/data/accessibility/event/live-region-add-expected-win.txt ++++ b/content/test/data/accessibility/event/live-region-add-expected-win.txt +@@ -1,3 +1,4 @@ ++EVENT_OBJECT_LIVEREGIONCHANGED on role=DIV + EVENT_OBJECT_REORDER on role=DIV + EVENT_OBJECT_SHOW on

role=P + IA2_EVENT_TEXT_INSERTED on role=DIV new_text={'' start=6 end=7} +diff --git a/content/test/data/accessibility/event/live-region-change-expected-win.txt b/content/test/data/accessibility/event/live-region-change-expected-win.txt +index aa60a8459e98e22e954ff6169653a698328bc294..d85c9ec837c461baf90ff3cd2bfec0f8bb25c380 100644 +--- a/content/test/data/accessibility/event/live-region-change-expected-win.txt ++++ b/content/test/data/accessibility/event/live-region-change-expected-win.txt +@@ -1,2 +1,3 @@ ++EVENT_OBJECT_LIVEREGIONCHANGED on role=DIV + IA2_EVENT_TEXT_INSERTED on role=DIV new_text={'After' start=0 end=5} + IA2_EVENT_TEXT_REMOVED on role=DIV old_text={'Before' start=0 end=6} From 86714c0b6f0212b858c916afe4c9c0762cff9aaa Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Thu, 30 May 2019 11:02:43 -0500 Subject: [PATCH 07/94] fix: populate phase of WebMouseWheelEvents generated in webContents.sendInputEvent. (#18494) --- atom/browser/api/atom_api_web_contents.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 4eaaf97c8878a..bcb84de93dbfc 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -1688,6 +1688,19 @@ void WebContents::SendInputEvent(v8::Isolate* isolate, mouse_wheel_event); #endif } else { + // Chromium expects phase info in wheel events (and applies a + // DCHECK to verify it). See: https://crbug.com/756524. + mouse_wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan; + mouse_wheel_event.dispatch_type = blink::WebInputEvent::kBlocking; + rwh->ForwardWheelEvent(mouse_wheel_event); + + // Send a synthetic wheel event with phaseEnded to finish scrolling. + mouse_wheel_event.has_synthetic_phase = true; + mouse_wheel_event.delta_x = 0; + mouse_wheel_event.delta_y = 0; + mouse_wheel_event.phase = blink::WebMouseWheelEvent::kPhaseEnded; + mouse_wheel_event.dispatch_type = + blink::WebInputEvent::kEventNonBlocking; rwh->ForwardWheelEvent(mouse_wheel_event); } return; From 2dd3d9ad1bff25219dc631389a086a9012e5db37 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 30 May 2019 09:54:10 -0700 Subject: [PATCH 08/94] Bump v4.2.3 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 078bf8b7ddcbb..ec87108d821a5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.2 \ No newline at end of file +4.2.3 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index a9e2259ec8986..780b51afab054 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.2 + 4.2.3 CFBundleShortVersionString - 4.2.2 + 4.2.3 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index a85d7fffefa68..c25892947bc9a 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,2,0 - PRODUCTVERSION 4,2,2,0 + FILEVERSION 4,2,3,0 + PRODUCTVERSION 4,2,3,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.2" + VALUE "FileVersion", "4.2.3" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.2" + VALUE "ProductVersion", "4.2.3" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 614d5dcd82a4c..ea8400bf30864 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 2 +#define ATOM_PATCH_VERSION 3 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index 7a58f8f95ea9a..5fcbb9e096814 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.2", + "version": "4.2.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 999a8f322d5dc..f7c7d507bf9fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.2", + "version": "4.2.3", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 79d41f5f962a1a1802a52e91fd86e3d46d0d37ad Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 30 May 2019 15:12:34 -0700 Subject: [PATCH 09/94] Revert "Bump v4.2.3" This reverts commit 2dd3d9ad1bff25219dc631389a086a9012e5db37. --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index ec87108d821a5..078bf8b7ddcbb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.3 \ No newline at end of file +4.2.2 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 780b51afab054..a9e2259ec8986 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.3 + 4.2.2 CFBundleShortVersionString - 4.2.3 + 4.2.2 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index c25892947bc9a..a85d7fffefa68 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,3,0 - PRODUCTVERSION 4,2,3,0 + FILEVERSION 4,2,2,0 + PRODUCTVERSION 4,2,2,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.3" + VALUE "FileVersion", "4.2.2" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.3" + VALUE "ProductVersion", "4.2.2" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index ea8400bf30864..614d5dcd82a4c 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 3 +#define ATOM_PATCH_VERSION 2 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index 5fcbb9e096814..7a58f8f95ea9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.3", + "version": "4.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f7c7d507bf9fd..999a8f322d5dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.3", + "version": "4.2.2", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From c1b5a1cfc8a14a337540193daecfa5d0f50dd7bb Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 30 May 2019 15:14:00 -0700 Subject: [PATCH 10/94] Bump v4.2.3 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 9 ++++++--- package.json | 2 +- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/VERSION b/VERSION index 078bf8b7ddcbb..ec87108d821a5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.2 \ No newline at end of file +4.2.3 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index a9e2259ec8986..780b51afab054 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.2 + 4.2.3 CFBundleShortVersionString - 4.2.2 + 4.2.3 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index a85d7fffefa68..c25892947bc9a 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,2,0 - PRODUCTVERSION 4,2,2,0 + FILEVERSION 4,2,3,0 + PRODUCTVERSION 4,2,3,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.2" + VALUE "FileVersion", "4.2.3" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.2" + VALUE "ProductVersion", "4.2.3" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 614d5dcd82a4c..ea8400bf30864 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 2 +#define ATOM_PATCH_VERSION 3 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index 7a58f8f95ea9a..7d62b9e84dbb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.2", + "version": "4.2.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -244,6 +244,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -2142,7 +2143,8 @@ "version": "0.3.4", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==", - "dev": true + "dev": true, + "optional": true }, "cssstyle": { "version": "0.2.37", @@ -6600,7 +6602,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "longest-streak": { "version": "2.0.2", diff --git a/package.json b/package.json index 999a8f322d5dc..f7c7d507bf9fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.2", + "version": "4.2.3", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From a6117abf4c400f8e54cc247f3da7191c4f02af2e Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Thu, 30 May 2019 21:09:09 -0700 Subject: [PATCH 11/94] ci: add retries to downloads for arm testing (#18534) --- script/download-circleci-artifacts.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/script/download-circleci-artifacts.js b/script/download-circleci-artifacts.js index 484dc15b8fd5e..6ae6124a85bf8 100644 --- a/script/download-circleci-artifacts.js +++ b/script/download-circleci-artifacts.js @@ -49,9 +49,28 @@ async function downloadArtifact (name, buildNum, dest) { process.exit(1) } else { console.log(`Downloading ${artifactToDownload.url}.`) - await downloadFile(artifactToDownload.url, dest) - console.log(`Successfully downloaded ${name}.`) + let downloadError = false + await downloadWithRetry(artifactToDownload.url, dest).catch(err => { + console.log(`Error downnloading ${artifactToDownload.url} :`, err) + downloadError = true + }) + if (!downloadError) { + console.log(`Successfully downloaded ${name}.`) + } + } +} + +async function downloadWithRetry (url, directory) { + let lastError + for (let i = 0; i < 5; i++) { + console.log(`Attempting to download ${url} - attempt #${(i + 1)}`) + try { + return await downloadFile(url, directory) + } catch (err) { + lastError = err + } } + throw lastError } function downloadFile (url, directory) { From ec2418ad7d52ed1dad1ac2e465702e115207b5b9 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 3 Jun 2019 20:41:28 +0200 Subject: [PATCH 12/94] fix: [turbofan] Fix wrong typing of SpeculativeSafeIntegerSubtract. (#18564) --- patches/common/v8/.patches | 1 + ...ng_of_speculativesafeintegersubtract.patch | 78 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 patches/common/v8/turbofan_fix_wrong_typing_of_speculativesafeintegersubtract.patch diff --git a/patches/common/v8/.patches b/patches/common/v8/.patches index 9cebca405be11..97ddf47db3e6e 100644 --- a/patches/common/v8/.patches +++ b/patches/common/v8/.patches @@ -19,3 +19,4 @@ disable-warning-win.patch expose_mksnapshot.patch build-torque-with-x64-toolchain-on-arm.patch do_not_run_arm_arm64_mksnapshot_binaries.patch +turbofan_fix_wrong_typing_of_speculativesafeintegersubtract.patch diff --git a/patches/common/v8/turbofan_fix_wrong_typing_of_speculativesafeintegersubtract.patch b/patches/common/v8/turbofan_fix_wrong_typing_of_speculativesafeintegersubtract.patch new file mode 100644 index 0000000000000..ce5d8daa4871e --- /dev/null +++ b/patches/common/v8/turbofan_fix_wrong_typing_of_speculativesafeintegersubtract.patch @@ -0,0 +1,78 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benedikt Meurer +Date: Tue, 11 Dec 2018 07:58:19 +0100 +Subject: [turbofan] Fix wrong typing of SpeculativeSafeIntegerSubtract. + +The typing of SpeculativeSafeIntegerSubtract didn't include -0, and the +SimplifiedLowering rules for SpeculativeSafeIntegerSubtract didn't +properly handle the case of `-0 - 0`, but would always pass Word32 +truncations. + +Bug: chromium:913296 +Change-Id: I0e5a401f075db8b349a5579e1e294df97378ea49 +Reviewed-on: https://chromium-review.googlesource.com/c/1370042 +Reviewed-by: Tobias Tebbi +Commit-Queue: Benedikt Meurer +Cr-Commit-Position: refs/heads/master@{#58147} + +diff --git a/src/compiler/operation-typer.cc b/src/compiler/operation-typer.cc +index a9ae8c322aa6d1be31f52cef77f0915a1506cad9..31c4d75f8e88ece659fb13279247c56f43c28141 100644 +--- a/src/compiler/operation-typer.cc ++++ b/src/compiler/operation-typer.cc +@@ -664,7 +664,7 @@ Type OperationTyper::SpeculativeSafeIntegerSubtract(Type lhs, Type rhs) { + // In either case the result will be in the safe integer range, so we + // can bake in the type here. This needs to be in sync with + // SimplifiedLowering::VisitSpeculativeAdditiveOp. +- return result = Type::Intersect(result, cache_.kSafeInteger, zone()); ++ return Type::Intersect(result, cache_.kSafeIntegerOrMinusZero, zone()); + } + + Type OperationTyper::NumberMultiply(Type lhs, Type rhs) { +diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc +index 74bb7fcd6b5f00209a920a41ab117f232a0d0fca..65c7e73ddaa0c079392283e2c245061bb6deb950 100644 +--- a/src/compiler/simplified-lowering.cc ++++ b/src/compiler/simplified-lowering.cc +@@ -1305,7 +1305,6 @@ class RepresentationSelector { + + // Try to use type feedback. + NumberOperationHint hint = NumberOperationHintOf(node->op()); +- + DCHECK(hint == NumberOperationHint::kSignedSmall || + hint == NumberOperationHint::kSigned32); + +@@ -1313,8 +1312,14 @@ class RepresentationSelector { + Type right_feedback_type = TypeOf(node->InputAt(1)); + // Handle the case when no int32 checks on inputs are necessary (but + // an overflow check is needed on the output). Note that we do not +- // have to do any check if at most one side can be minus zero. +- if (left_upper.Is(Type::Signed32OrMinusZero()) && ++ // have to do any check if at most one side can be minus zero. For ++ // subtraction we need to handle the case of -0 - 0 properly, since ++ // that can produce -0. ++ Type left_constraint_type = ++ node->opcode() == IrOpcode::kSpeculativeSafeIntegerAdd ++ ? Type::Signed32OrMinusZero() ++ : Type::Signed32(); ++ if (left_upper.Is(left_constraint_type) && + right_upper.Is(Type::Signed32OrMinusZero()) && + (left_upper.Is(Type::Signed32()) || right_upper.Is(Type::Signed32()))) { + VisitBinop(node, UseInfo::TruncatingWord32(), +diff --git a/test/mjsunit/regress/regress-crbug-913296.js b/test/mjsunit/regress/regress-crbug-913296.js +new file mode 100644 +index 0000000000000000000000000000000000000000..3fab06607f51aeca4752afca9cde56cc42e567c9 +--- /dev/null ++++ b/test/mjsunit/regress/regress-crbug-913296.js +@@ -0,0 +1,13 @@ ++// Copyright 2018 the V8 project authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++// Flags: --allow-natives-syntax ++ ++function foo(trigger) { ++ return Object.is((trigger ? -0 : 0) - 0, -0); ++} ++ ++assertFalse(foo(false)); ++%OptimizeFunctionOnNextCall(foo); ++assertTrue(foo(true)); From 79764942d1998df214500dcc9d58c08e73e40faa Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 3 Jun 2019 20:54:12 +0200 Subject: [PATCH 13/94] fix: Issue 914497: QUIC proxying breaks end-to-end encryption (#17634) --- patches/common/chromium/.patches | 1 + .../enable_quic_proxies_for_https_urls.patch | 144 ++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 patches/common/chromium/enable_quic_proxies_for_https_urls.patch diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index 6bd488631d24e..18fd9221b558e 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -102,3 +102,4 @@ fix_re-entracy_problem_with_invalidateframesinkid.patch chore_expose_getcontentclient_to_embedders.patch tabbed_window_lagging.patch restore_live_region_changed_events_for_processing_by_jaws_focus_mode.patch +enable_quic_proxies_for_https_urls.patch diff --git a/patches/common/chromium/enable_quic_proxies_for_https_urls.patch b/patches/common/chromium/enable_quic_proxies_for_https_urls.patch new file mode 100644 index 0000000000000..ec9fc99380115 --- /dev/null +++ b/patches/common/chromium/enable_quic_proxies_for_https_urls.patch @@ -0,0 +1,144 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Milan Burda +Date: Sun, 31 Mar 2019 21:12:59 +0200 +Subject: =?UTF-8?q?Enable=20support=20for=20sending=20HTTPS=20URLs=20via?= + =?UTF-8?q?=20QUIC=20proxies=20only=20when=0Athe=20finch=20param=20enable?= + =?UTF-8?q?=5Fquic=5Fproxies=5Ffor=5Fhttps=5Furls=20is=20set.?= + +Backports: +- https://chromium-review.googlesource.com/c/chromium/src/+/1377709 +- https://chromium-review.googlesource.com/c/chromium/src/+/1375112 +- https://chromium-review.googlesource.com/c/chromium/src/+/1417356 + +diff --git a/components/network_session_configurator/browser/network_session_configurator.cc b/components/network_session_configurator/browser/network_session_configurator.cc +index 39fd430aafb358d465ba30120c30580672f95aa8..21d34cfab2c426ae367148433d21916fcd92c757 100644 +--- a/components/network_session_configurator/browser/network_session_configurator.cc ++++ b/components/network_session_configurator/browser/network_session_configurator.cc +@@ -143,6 +143,14 @@ bool ShouldEnableQuic(base::StringPiece quic_trial_group, + GetVariationParam(quic_trial_params, "enable_quic"), "true"); + } + ++bool ShouldEnableQuicProxiesForHttpsUrls( ++ const VariationParameters& quic_trial_params) { ++ return base::LowerCaseEqualsASCII( ++ GetVariationParam(quic_trial_params, ++ "enable_quic_proxies_for_https_urls"), ++ "true"); ++} ++ + bool ShouldMarkQuicBrokenWhenNetworkBlackholes( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( +@@ -367,6 +375,8 @@ void ConfigureQuicParams(base::StringPiece quic_trial_group, + ShouldSupportIetfFormatQuicAltSvc(quic_trial_params); + + if (params->enable_quic) { ++ params->enable_quic_proxies_for_https_urls = ++ ShouldEnableQuicProxiesForHttpsUrls(quic_trial_params); + params->quic_connection_options = + GetQuicConnectionOptions(quic_trial_params); + params->quic_client_connection_options = +diff --git a/components/network_session_configurator/browser/network_session_configurator_unittest.cc b/components/network_session_configurator/browser/network_session_configurator_unittest.cc +index 6235f7d927a82ebcc7a04792bc44e0675c8ced54..1e3f7b89c3c1ef5b3da2c89516acd13ac1ad283f 100644 +--- a/components/network_session_configurator/browser/network_session_configurator_unittest.cc ++++ b/components/network_session_configurator/browser/network_session_configurator_unittest.cc +@@ -67,6 +67,7 @@ TEST_F(NetworkSessionConfiguratorTest, Defaults) { + EXPECT_FALSE(params_.enable_websocket_over_http2); + + EXPECT_FALSE(params_.enable_quic); ++ EXPECT_FALSE(params_.enable_quic_proxies_for_https_urls); + EXPECT_EQ("Chrome/52.0.2709.0 Linux x86_64", params_.quic_user_agent_id); + EXPECT_EQ(0u, params_.origins_to_force_quic_on.size()); + } +@@ -146,6 +147,17 @@ TEST_F(NetworkSessionConfiguratorTest, EnableQuicForDataReductionProxy) { + EXPECT_TRUE(params_.enable_quic); + } + ++TEST_F(NetworkSessionConfiguratorTest, EnableQuicProxiesForHttpsUrls) { ++ std::map field_trial_params; ++ field_trial_params["enable_quic_proxies_for_https_urls"] = "true"; ++ variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params); ++ base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled"); ++ ++ ParseFieldTrials(); ++ ++ EXPECT_TRUE(params_.enable_quic_proxies_for_https_urls); ++} ++ + TEST_F(NetworkSessionConfiguratorTest, + MarkQuicBrokenWhenNetworkBlackholesFromFieldTrialParams) { + std::map field_trial_params; +diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc +index 3bcaca68145012fe11374044e4dddf2b4c3d0b5c..d997e092d56c43222b491b27740cecead2ec3947 100644 +--- a/net/http/http_network_session.cc ++++ b/net/http/http_network_session.cc +@@ -112,6 +112,7 @@ HttpNetworkSession::Params::Params() + enable_http2_alternative_service(false), + enable_websocket_over_http2(false), + enable_quic(false), ++ enable_quic_proxies_for_https_urls(false), + quic_max_packet_length(quic::kDefaultMaxPacketSize), + quic_max_server_configs_stored_in_properties(0u), + quic_enable_socket_recv_optimization(false), +diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h +index 3392c846d577da239466b74f9de6fd076bb2ea84..03fbf1c253b01c6d503c02f56c1854ea59ae69ab 100644 +--- a/net/http/http_network_session.h ++++ b/net/http/http_network_session.h +@@ -124,6 +124,9 @@ class NET_EXPORT HttpNetworkSession : public base::MemoryCoordinatorClient { + // Enables QUIC support. + bool enable_quic; + ++ // If true, HTTPS URLs can be sent to QUIC proxies. ++ bool enable_quic_proxies_for_https_urls; ++ + // QUIC runtime configuration options. + + // Versions of QUIC which may be used. +diff --git a/net/http/http_stream_factory_job.cc b/net/http/http_stream_factory_job.cc +index ab66394c2023e5db037897853d9d86b29c78d72d..3cfc627225e4f531c06c66d5de5f1f075187cf92 100644 +--- a/net/http/http_stream_factory_job.cc ++++ b/net/http/http_stream_factory_job.cc +@@ -221,6 +221,10 @@ HttpStreamFactory::Job::Job(Delegate* delegate, + stream_type_(HttpStreamRequest::BIDIRECTIONAL_STREAM), + init_connection_already_resumed_(false), + ptr_factory_(this) { ++ // QUIC can only be spoken to servers, never to proxies. ++ if (alternative_protocol == kProtoQUIC) ++ DCHECK(proxy_info_.is_direct()); ++ + // The Job is forced to use QUIC without a designated version, try the + // preferred QUIC version that is supported by default. + if (quic_version_ == quic::QUIC_VERSION_UNSUPPORTED && +@@ -769,6 +773,11 @@ int HttpStreamFactory::Job::DoStart() { + return ERR_UNSAFE_PORT; + } + ++ if (!session_->params().enable_quic_proxies_for_https_urls && ++ proxy_info_.is_quic() && !request_info_.url.SchemeIs(url::kHttpScheme)) { ++ return ERR_NOT_IMPLEMENTED; ++ } ++ + next_state_ = STATE_WAIT; + return OK; + } +diff --git a/net/http/http_stream_factory_job_controller.cc b/net/http/http_stream_factory_job_controller.cc +index d632aabbdc155c10e1bd04a091e816a8231ab30c..91d4ba7446c2fd63976887c075aad9ff7a8e42c8 100644 +--- a/net/http/http_stream_factory_job_controller.cc ++++ b/net/http/http_stream_factory_job_controller.cc +@@ -793,9 +793,13 @@ int HttpStreamFactory::JobController::DoCreateJobs() { + HostPortPair destination(HostPortPair::FromURL(request_info_.url)); + GURL origin_url = ApplyHostMappingRules(request_info_.url, &destination); + +- // Create an alternative job if alternative service is set up for this domain. +- alternative_service_info_ = +- GetAlternativeServiceInfoFor(request_info_, delegate_, stream_type_); ++ // Create an alternative job if alternative service is set up for this domain, ++ // but only if we'll be speaking directly to the server, since QUIC through ++ // proxies is not supported. ++ if (proxy_info_.is_direct()) { ++ alternative_service_info_ = ++ GetAlternativeServiceInfoFor(request_info_, delegate_, stream_type_); ++ } + quic::QuicTransportVersion quic_version = quic::QUIC_VERSION_UNSUPPORTED; + if (alternative_service_info_.protocol() == kProtoQUIC) { + quic_version = From e15672e13c8368f680c780a4cff7b8214d24c157 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Mon, 3 Jun 2019 17:21:41 -0400 Subject: [PATCH 14/94] build: install python-dbusmock via pip for a Docker container (#18598) * build: use python-dbusmock v0.18.1 on Linux To prevent timeout errors with some other python-dbusmock versions. * Don't use a fixed version of python-dbusmock Co-Authored-By: John Kleinschmidt --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7557d7b57dbe2..bae76aaf3cb7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ locales \ lsb-release \ nano \ - python-dbusmock \ + python-dbus \ python-pip \ python-setuptools \ sudo \ @@ -33,6 +33,9 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \ # crcmod is required by gsutil, which is used for filling the gclient git cache RUN pip install -U crcmod +# dbusmock is needed for Electron tests +RUN pip install python-dbusmock + RUN mkdir /tmp/workspace RUN chown builduser:builduser /tmp/workspace From 93ce710f28b3b0981d4720348f1a7ccecb1675b6 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 3 Jun 2019 23:24:35 +0200 Subject: [PATCH 15/94] build: remove Vulkan mock ICD (#18594) --- build/zip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/zip.py b/build/zip.py index 5518322e0159f..ce7ae9722e0c7 100644 --- a/build/zip.py +++ b/build/zip.py @@ -10,8 +10,8 @@ PATHS_TO_SKIP = [ 'angledata', #Skipping because it is an output of //ui/gl that we don't need - './libVkLayer_', #Skipping because these are outputs that we don't need - './VkLayerLayer_', #Skipping because these are outputs that we don't need + './libVkICD_mock_', #Skipping because these are outputs that we don't need + './VkICD_mock_', #Skipping because these are outputs that we don't need # //chrome/browser:resources depends on this via # //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to From 64f32a18f56da4269e437a1fe349541f7563be38 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Mon, 3 Jun 2019 14:33:10 -0700 Subject: [PATCH 16/94] build: strip swiftshader binaries (#18602) --- script/strip-binaries.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/strip-binaries.py b/script/strip-binaries.py index 76a76a3ea2109..0ecb1229d7c88 100755 --- a/script/strip-binaries.py +++ b/script/strip-binaries.py @@ -9,7 +9,9 @@ 'electron', 'libffmpeg.so', 'libGLESv2.so', - 'libEGL.so' + 'libEGL.so', + 'swiftshader/libGLESv2.so', + 'swiftshader/libEGL.so' ] def strip_binaries(directory, target_cpu): From 7d164b3bcdb05ce96258ab79434a19cddea9a7af Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 4 Jun 2019 10:56:35 +0200 Subject: [PATCH 17/94] fix: SVG crash for v0 distribution into foreignObject. (#18561) --- patches/common/chromium/.patches | 1 + ...r_v0_distribution_into_foreignobject.patch | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 patches/common/chromium/fix_svg_crash_for_v0_distribution_into_foreignobject.patch diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index 18fd9221b558e..7423618cacc4b 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -103,3 +103,4 @@ chore_expose_getcontentclient_to_embedders.patch tabbed_window_lagging.patch restore_live_region_changed_events_for_processing_by_jaws_focus_mode.patch enable_quic_proxies_for_https_urls.patch +fix_svg_crash_for_v0_distribution_into_foreignobject.patch diff --git a/patches/common/chromium/fix_svg_crash_for_v0_distribution_into_foreignobject.patch b/patches/common/chromium/fix_svg_crash_for_v0_distribution_into_foreignobject.patch new file mode 100644 index 0000000000000..beb9ad65dde41 --- /dev/null +++ b/patches/common/chromium/fix_svg_crash_for_v0_distribution_into_foreignobject.patch @@ -0,0 +1,63 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Rune Lillesveen +Date: Tue, 18 Dec 2018 14:45:19 +0000 +Subject: Fix SVG crash for v0 distribution into foreignObject. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We require a parent element to be an SVG element for non-svg-root +elements in order to create a LayoutObject for them. However, we checked +the light tree parent element, not the flat tree one which is the parent +for the layout tree construction. Note that this is just an issue in +Shadow DOM v0 since v1 does not allow shadow roots on SVG elements. + +Bug: 915469 +Change-Id: Id81843abad08814fae747b5bc81c09666583f130 +Reviewed-on: https://chromium-review.googlesource.com/c/1382494 +Reviewed-by: Fredrik Söderquist +Commit-Queue: Rune Lillesveen +Cr-Commit-Position: refs/heads/master@{#617487} + +diff --git a/third_party/WebKit/LayoutTests/svg/foreignObject/shadow-dom-v0-crash.html b/third_party/WebKit/LayoutTests/svg/foreignObject/shadow-dom-v0-crash.html +new file mode 100644 +index 0000000000000000000000000000000000000000..44ac3b0540b8f5a816a67b5be382b179623bd0cd +--- /dev/null ++++ b/third_party/WebKit/LayoutTests/svg/foreignObject/shadow-dom-v0-crash.html +@@ -0,0 +1,11 @@ ++ ++ ++ ++

PASS if no crash or DCHECK failure.

++ ++ +diff --git a/third_party/blink/renderer/core/svg/svg_element.cc b/third_party/blink/renderer/core/svg/svg_element.cc +index e9a1fd9dd0ef6975cbc3e0967e8b0e9c8362b7a1..6af7df47e3502903346c4509c6fd080ef6d071ef 100644 +--- a/third_party/blink/renderer/core/svg/svg_element.cc ++++ b/third_party/blink/renderer/core/svg/svg_element.cc +@@ -37,6 +37,7 @@ + #include "third_party/blink/renderer/core/dom/document.h" + #include "third_party/blink/renderer/core/dom/element_traversal.h" + #include "third_party/blink/renderer/core/dom/events/event.h" ++#include "third_party/blink/renderer/core/dom/flat_tree_traversal.h" + #include "third_party/blink/renderer/core/dom/node_computed_style.h" + #include "third_party/blink/renderer/core/dom/shadow_root.h" + #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" +@@ -1047,10 +1048,8 @@ bool SVGElement::LayoutObjectIsNeeded(const ComputedStyle& style) const { + } + + bool SVGElement::HasSVGParent() const { +- // Should we use the flat tree parent instead? If so, we should probably fix a +- // few other checks. +- return ParentOrShadowHostElement() && +- ParentOrShadowHostElement()->IsSVGElement(); ++ Element* parent = FlatTreeTraversal::ParentElement(*this); ++ return parent && parent->IsSVGElement(); + } + + MutableCSSPropertyValueSet* SVGElement::AnimatedSMILStyleProperties() const { From 3d3d97920eafa1e070065e31abd780b3c38cc32c Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 4 Jun 2019 10:57:22 +0200 Subject: [PATCH 18/94] fix: [turbofan] Restrict redundancy elimination from widening types (#18569) --- patches/common/v8/.patches | 1 + ...ancy_elimination_from_widening_types.patch | 70 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 patches/common/v8/turbofan_restrict_redundancy_elimination_from_widening_types.patch diff --git a/patches/common/v8/.patches b/patches/common/v8/.patches index 97ddf47db3e6e..7c1edbb4071e4 100644 --- a/patches/common/v8/.patches +++ b/patches/common/v8/.patches @@ -20,3 +20,4 @@ expose_mksnapshot.patch build-torque-with-x64-toolchain-on-arm.patch do_not_run_arm_arm64_mksnapshot_binaries.patch turbofan_fix_wrong_typing_of_speculativesafeintegersubtract.patch +turbofan_restrict_redundancy_elimination_from_widening_types.patch diff --git a/patches/common/v8/turbofan_restrict_redundancy_elimination_from_widening_types.patch b/patches/common/v8/turbofan_restrict_redundancy_elimination_from_widening_types.patch new file mode 100644 index 0000000000000..9a3206d06a132 --- /dev/null +++ b/patches/common/v8/turbofan_restrict_redundancy_elimination_from_widening_types.patch @@ -0,0 +1,70 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sigurd Schneider +Date: Mon, 7 Jan 2019 15:11:31 +0100 +Subject: [turbofan] Restrict redundancy elimination from widening types + +This CL prevents redundancy elimination from widening types, which +can cause problems if the input of a DeadValue (which has type None) +is replaced by an equivalent node that does not have type None. This +can happen because load elimination does not re-type nodes, for +example. + +Bug: chromium:919340 +Change-Id: I89e872412edbcdc610e70ae160cde56cd045006c +Reviewed-on: https://chromium-review.googlesource.com/c/1397709 +Reviewed-by: Tobias Tebbi +Reviewed-by: Jaroslav Sevcik +Commit-Queue: Sigurd Schneider +Cr-Commit-Position: refs/heads/master@{#58617} + +diff --git a/src/compiler/redundancy-elimination.cc b/src/compiler/redundancy-elimination.cc +index 5ecef0408be4c849cccd695ccb8329ec7f27055e..8cc0501a22132e3c226294c53b047a473a8f9005 100644 +--- a/src/compiler/redundancy-elimination.cc ++++ b/src/compiler/redundancy-elimination.cc +@@ -179,11 +179,22 @@ bool CheckSubsumes(Node const* a, Node const* b) { + return true; + } + ++bool TypeSubsumes(Node* node, Node* replacement) { ++ if (!NodeProperties::IsTyped(node) || !NodeProperties::IsTyped(replacement)) { ++ // If either node is untyped, we are running during an untyped optimization ++ // phase, and replacement is OK. ++ return true; ++ } ++ Type node_type = NodeProperties::GetType(node); ++ Type replacement_type = NodeProperties::GetType(replacement); ++ return replacement_type.Is(node_type); ++} ++ + } // namespace + + Node* RedundancyElimination::EffectPathChecks::LookupCheck(Node* node) const { + for (Check const* check = head_; check != nullptr; check = check->next) { +- if (CheckSubsumes(check->node, node)) { ++ if (CheckSubsumes(check->node, node) && TypeSubsumes(node, check->node)) { + DCHECK(!check->node->IsDead()); + return check->node; + } +diff --git a/test/mjsunit/regress/regress-919340.js b/test/mjsunit/regress/regress-919340.js +new file mode 100644 +index 0000000000000000000000000000000000000000..900bf6fde2f56bc328a17995c18a2fabd3f1023b +--- /dev/null ++++ b/test/mjsunit/regress/regress-919340.js +@@ -0,0 +1,17 @@ ++// Copyright 2019 the V8 project authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++// Flags: --allow-natives-syntax --opt ++ ++var E = 'Σ'; ++var PI = 123; ++function f() { ++ print(E = 2, /b/.test(E) || /b/.test(E = 2)); ++ ((E = 3) * PI); ++} ++ ++f(); ++f(); ++%OptimizeFunctionOnNextCall(f); ++f(); From bbeedafc6ecdd3592e7ea7e71e7a2683991f352d Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 4 Jun 2019 10:58:08 +0200 Subject: [PATCH 19/94] fix: Prevent glDeleteQueries from deleting a live Query (#18566) --- patches/common/config.json | 2 + patches/common/swiftshader/.patches | 1 + ...tequeries_from_deleting_a_live_query.patch | 161 ++++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 patches/common/swiftshader/.patches create mode 100644 patches/common/swiftshader/prevent_gldeletequeries_from_deleting_a_live_query.patch diff --git a/patches/common/config.json b/patches/common/config.json index 088dba42bcb12..e04c4bc0f0357 100644 --- a/patches/common/config.json +++ b/patches/common/config.json @@ -9,6 +9,8 @@ "src/electron/patches/common/skia": "src/third_party/skia", + "src/electron/patches/common/swiftshader": "src/third_party/swiftshader", + "src/electron/patches/common/webrtc": "src/third_party/webrtc", "src/electron/patches/common/v8": "src/v8" diff --git a/patches/common/swiftshader/.patches b/patches/common/swiftshader/.patches new file mode 100644 index 0000000000000..f518ba48ec8e9 --- /dev/null +++ b/patches/common/swiftshader/.patches @@ -0,0 +1 @@ +prevent_gldeletequeries_from_deleting_a_live_query.patch diff --git a/patches/common/swiftshader/prevent_gldeletequeries_from_deleting_a_live_query.patch b/patches/common/swiftshader/prevent_gldeletequeries_from_deleting_a_live_query.patch new file mode 100644 index 0000000000000..e4a92f2ea89b2 --- /dev/null +++ b/patches/common/swiftshader/prevent_gldeletequeries_from_deleting_a_live_query.patch @@ -0,0 +1,161 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alexis Hetu +Date: Wed, 14 Nov 2018 10:54:53 -0500 +Subject: Prevent glDeleteQueries from deleting a live Query +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +glDeleteQueries() instantly deletes all the es2::Query objects +passed as arguments to this function. If some of these queries +are still being used by the renderer, this will result in a use +after free error. To solve this issue, sw::Query is now a also +ref counted object. + +Bug chromium:904714 + +Change-Id: Ic1d5781bbf1724d8d07936fd49c8a172dc3d9fd4 +Reviewed-on: https://swiftshader-review.googlesource.com/c/22548 +Tested-by: Alexis Hétu +Reviewed-by: Nicolas Capens + +diff --git a/src/D3D9/Direct3DQuery9.cpp b/src/D3D9/Direct3DQuery9.cpp +index 31d249e7897869b8a97c1b8a4e449b1a71500f80..b6a3b2d60a8fa14016007d00be753e1642c75cbc 100644 +--- a/src/D3D9/Direct3DQuery9.cpp ++++ b/src/D3D9/Direct3DQuery9.cpp +@@ -41,7 +41,7 @@ namespace D3D9 + { + device->removeQuery(query); + +- delete query; ++ query->release(); + } + } + +@@ -202,7 +202,7 @@ namespace D3D9 + return INVALIDCALL(); + } + +- bool signaled = !query || query->reference == 0; ++ bool signaled = !query || query->isReady(); + + if(size && signaled) + { +diff --git a/src/OpenGL/libGLESv2/Query.cpp b/src/OpenGL/libGLESv2/Query.cpp +index 027f8abcae73d0caae9cdfb610c4873229e93e40..87286210f2c4e4b6e984c5b28049afe3587eb1ca 100644 +--- a/src/OpenGL/libGLESv2/Query.cpp ++++ b/src/OpenGL/libGLESv2/Query.cpp +@@ -32,7 +32,7 @@ Query::Query(GLuint name, GLenum type) : NamedObject(name) + + Query::~Query() + { +- delete mQuery; ++ mQuery->release(); + } + + void Query::begin() +@@ -140,7 +140,7 @@ GLboolean Query::testQuery() + { + if(mQuery != nullptr && mStatus != GL_TRUE) + { +- if(!mQuery->building && mQuery->reference == 0) ++ if(!mQuery->building && mQuery->isReady()) + { + unsigned int resultSum = mQuery->data; + mStatus = GL_TRUE; +diff --git a/src/Renderer/Renderer.cpp b/src/Renderer/Renderer.cpp +index b560f4171ea649055572e4c535560d8664e1fa7e..e4a4e06660bf8a4731974f7615b8d68dd39e6b30 100644 +--- a/src/Renderer/Renderer.cpp ++++ b/src/Renderer/Renderer.cpp +@@ -78,6 +78,27 @@ namespace sw + int threadIndex; + }; + ++ Query::Query(Type type) : building(false), data(0), type(type), reference(1) ++ { ++ } ++ ++ void Query::addRef() ++ { ++ ++reference; // Atomic ++ } ++ ++ void Query::release() ++ { ++ int ref = reference--; // Atomic ++ ++ ASSERT(ref >= 0); ++ ++ if(ref == 0) ++ { ++ delete this; ++ } ++ } ++ + DrawCall::DrawCall() + { + queries = 0; +@@ -314,7 +335,7 @@ namespace sw + { + if(includePrimitivesWrittenQueries || (query->type != Query::TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN)) + { +- ++query->reference; // Atomic ++ query->addRef(); + draw->queries->push_back(query); + } + } +@@ -1002,7 +1023,7 @@ namespace sw + break; + } + +- --query->reference; // Atomic ++ query->release(); + } + + delete draw.queries; +diff --git a/src/Renderer/Renderer.hpp b/src/Renderer/Renderer.hpp +index ce22866d7224036d4d32294d93f6a53c9da7d48d..0846a27b7b83b70206df6f594af0f59fb9e74fb5 100644 +--- a/src/Renderer/Renderer.hpp ++++ b/src/Renderer/Renderer.hpp +@@ -89,26 +89,35 @@ namespace sw + { + enum Type { FRAGMENTS_PASSED, TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN }; + +- Query(Type type) : building(false), reference(0), data(0), type(type) +- { +- } ++ Query(Type type); ++ ++ void addRef(); ++ void release(); + +- void begin() ++ inline void begin() + { + building = true; + data = 0; + } + +- void end() ++ inline void end() + { + building = false; + } + ++ inline bool isReady() const ++ { ++ return (reference == 1); ++ } ++ + bool building; +- AtomicInt reference; + AtomicInt data; + + const Type type; ++ private: ++ ~Query() {} // Only delete a query within the release() function ++ ++ AtomicInt reference; + }; + + struct DrawData From 0049cee96c4b92b8cd7b018919e9067c755c90be Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Tue, 4 Jun 2019 10:28:55 -0400 Subject: [PATCH 20/94] build: move Windows release builds to AppVeyor cloud (#18605) * build: move Windows release builds to AppVeyor cloud * Use new env variable for AppVeyor cloud server --- .env.example | 2 +- script/ci-release-build.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index cd15610276869..eb3df4b6bdf9c 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ # These env vars are only necessary for creating Electron releases. # See docs/development/releasing.md -APPVEYOR_TOKEN= +APPVEYOR_CLOUD_TOKEN= CIRCLE_TOKEN= ELECTRON_GITHUB_TOKEN= VSTS_TOKEN= \ No newline at end of file diff --git a/script/ci-release-build.js b/script/ci-release-build.js index eae38308a3185..c156358c09779 100644 --- a/script/ci-release-build.js +++ b/script/ci-release-build.js @@ -2,12 +2,12 @@ if (!process.env.CI) require('dotenv-safe').load() const assert = require('assert') const request = require('request') -const buildAppVeyorURL = 'https://windows-ci.electronjs.org/api/builds' +const buildAppVeyorURL = 'https://ci.appveyor.com/api/builds' const vstsURL = 'https://github.visualstudio.com/electron/_apis/build' const appVeyorJobs = { - 'electron-x64': 'electron', - 'electron-ia32': 'electron-39ng6' + 'electron-x64': 'electron-x64-release', + 'electron-ia32': 'electron-ia32-release' } const circleCIJobs = [ @@ -100,13 +100,13 @@ async function callAppVeyor (targetBranch, job, options) { const requestOpts = { url: buildAppVeyorURL, auth: { - bearer: process.env.APPVEYOR_TOKEN + bearer: process.env.APPVEYOR_CLOUD_TOKEN }, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ - accountName: 'AppVeyor', + accountName: 'electron-bot', projectSlug: appVeyorJobs[job], branch: targetBranch, environmentVariables @@ -116,7 +116,7 @@ async function callAppVeyor (targetBranch, job, options) { const appVeyorResponse = await makeRequest(requestOpts, true).catch(err => { console.log('Error calling AppVeyor:', err) }) - const buildUrl = `https://windows-ci.electronjs.org/project/AppVeyor/${appVeyorJobs[job]}/build/${appVeyorResponse.version}` + const buildUrl = `https://ci.appveyor.com/project/electron-bot/${appVeyorJobs[job]}/build/${appVeyorResponse.version}` console.log(`AppVeyor release build request for ${job} successful. Check build status at ${buildUrl}`) } From 49dc15469d90d5282f07be8fb7145b069d428b35 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 4 Jun 2019 17:09:20 +0200 Subject: [PATCH 21/94] fix: don't export private V8 symbols that can cause native node modules to crash (#18281) (#18621) --- patches/common/v8/.patches | 1 + ...export_private_v8_symbols_on_windows.patch | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 patches/common/v8/do_not_export_private_v8_symbols_on_windows.patch diff --git a/patches/common/v8/.patches b/patches/common/v8/.patches index 7c1edbb4071e4..3ac7b1da11d33 100644 --- a/patches/common/v8/.patches +++ b/patches/common/v8/.patches @@ -19,5 +19,6 @@ disable-warning-win.patch expose_mksnapshot.patch build-torque-with-x64-toolchain-on-arm.patch do_not_run_arm_arm64_mksnapshot_binaries.patch +do_not_export_private_v8_symbols_on_windows.patch turbofan_fix_wrong_typing_of_speculativesafeintegersubtract.patch turbofan_restrict_redundancy_elimination_from_widening_types.patch diff --git a/patches/common/v8/do_not_export_private_v8_symbols_on_windows.patch b/patches/common/v8/do_not_export_private_v8_symbols_on_windows.patch new file mode 100644 index 0000000000000..242e0fb4bcd48 --- /dev/null +++ b/patches/common/v8/do_not_export_private_v8_symbols_on_windows.patch @@ -0,0 +1,52 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tomas Rycl +Date: Mon, 13 May 2019 15:48:48 +0200 +Subject: Do not export private V8 symbols on Windows + +This change stops private V8 symbols and internal crt methods being exported. +It fixes an issue where native node modules can import +incorrect CRT methods and crash on Windows. +It also reduces size of node.lib by 75%. + +This patch can be safely removed if, when it is removed, `node.lib` does not +contain any standard C++ library exports (e.g. `std::ostringstream`). + +diff --git a/BUILD.gn b/BUILD.gn +index f43c42a62e1a2d273ece56377c328addb8b99d66..fcf110e673b92070cc1931b376f8a26d38b188e4 100644 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -212,6 +212,10 @@ config("internal_config") { + + defines = [] + ++ if (!is_component_build && is_electron_build) { ++ defines += [ "HIDE_PRIVATE_SYMBOLS" ] ++ } ++ + if (is_component_build || is_electron_build) { + defines += [ "BUILDING_V8_SHARED" ] + } +diff --git a/src/globals.h b/src/globals.h +index 6edc5d01b4ff503d05d70a7e40959fbc7f972628..d442f691729bd661488018c55e621169cc52ee5e 100644 +--- a/src/globals.h ++++ b/src/globals.h +@@ -20,13 +20,17 @@ + #ifdef V8_OS_WIN + + // Setup for Windows shared library export. ++#if defined(HIDE_PRIVATE_SYMBOLS) ++#define V8_EXPORT_PRIVATE ++#else //if !defined(HIDE_PRIVATE_SYMBOLS) + #ifdef BUILDING_V8_SHARED + #define V8_EXPORT_PRIVATE __declspec(dllexport) + #elif USING_V8_SHARED + #define V8_EXPORT_PRIVATE __declspec(dllimport) +-#else ++#else //!(BUILDING_V8_SHARED || USING_V8_SHARED) + #define V8_EXPORT_PRIVATE +-#endif // BUILDING_V8_SHARED ++#endif ++#endif + + #else // V8_OS_WIN + From df60a800b9c4b157b906a0ee029ef078fb2b9f72 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 4 Jun 2019 18:09:42 +0200 Subject: [PATCH 22/94] fix: [parser] LiteralBuffer::ExpandBuffer always grows (#18568) --- patches/common/v8/.patches | 1 + ...eralbuffer_expandbuffer_always_grows.patch | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 patches/common/v8/parser_literalbuffer_expandbuffer_always_grows.patch diff --git a/patches/common/v8/.patches b/patches/common/v8/.patches index 3ac7b1da11d33..fbbbb0f44902a 100644 --- a/patches/common/v8/.patches +++ b/patches/common/v8/.patches @@ -22,3 +22,4 @@ do_not_run_arm_arm64_mksnapshot_binaries.patch do_not_export_private_v8_symbols_on_windows.patch turbofan_fix_wrong_typing_of_speculativesafeintegersubtract.patch turbofan_restrict_redundancy_elimination_from_widening_types.patch +parser_literalbuffer_expandbuffer_always_grows.patch diff --git a/patches/common/v8/parser_literalbuffer_expandbuffer_always_grows.patch b/patches/common/v8/parser_literalbuffer_expandbuffer_always_grows.patch new file mode 100644 index 0000000000000..9fd0b7123321a --- /dev/null +++ b/patches/common/v8/parser_literalbuffer_expandbuffer_always_grows.patch @@ -0,0 +1,49 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Toon Verwaest +Date: Fri, 11 Jan 2019 11:27:18 +0100 +Subject: [parser] LiteralBuffer::ExpandBuffer always grows + +Bug: chromium:914736 +Change-Id: Id02715b69361d15df23c70f85f3250526369547f +Reviewed-on: https://chromium-review.googlesource.com/c/1405859 +Reviewed-by: Leszek Swirski +Commit-Queue: Toon Verwaest +Cr-Commit-Position: refs/heads/master@{#58734} + +diff --git a/src/parsing/scanner.cc b/src/parsing/scanner.cc +index 852b5e400b3ffe84e464a2d63c943a30b497ac69..267b38fd7fed38421b9b6e315b02771dbab9381f 100644 +--- a/src/parsing/scanner.cc ++++ b/src/parsing/scanner.cc +@@ -67,13 +67,14 @@ Handle Scanner::LiteralBuffer::Internalize(Isolate* isolate) const { + } + + int Scanner::LiteralBuffer::NewCapacity(int min_capacity) { +- int capacity = Max(min_capacity, backing_store_.length()); +- int new_capacity = Min(capacity * kGrowthFactory, capacity + kMaxGrowth); +- return new_capacity; ++ return min_capacity < (kMaxGrowth / (kGrowthFactor - 1)) ++ ? min_capacity * kGrowthFactor ++ : min_capacity + kMaxGrowth; + } + + void Scanner::LiteralBuffer::ExpandBuffer() { +- Vector new_store = Vector::New(NewCapacity(kInitialCapacity)); ++ int min_capacity = Max(kInitialCapacity, backing_store_.length()); ++ Vector new_store = Vector::New(NewCapacity(min_capacity)); + MemCopy(new_store.start(), backing_store_.start(), position_); + backing_store_.Dispose(); + backing_store_ = new_store; +diff --git a/src/parsing/scanner.h b/src/parsing/scanner.h +index 34da5fafbf733fd326e91baeeac26bf4517c9fcf..d779317c55567311dc266af101815d2740d28e0b 100644 +--- a/src/parsing/scanner.h ++++ b/src/parsing/scanner.h +@@ -453,8 +453,7 @@ class Scanner { + + private: + static const int kInitialCapacity = 16; +- static const int kGrowthFactory = 4; +- static const int kMinConversionSlack = 256; ++ static const int kGrowthFactor = 4; + static const int kMaxGrowth = 1 * MB; + + inline bool IsValidAscii(char code_unit) { From a6f9b6f72b0135ffe98bc29d63117f48b1603e0b Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 4 Jun 2019 18:23:30 +0200 Subject: [PATCH 23/94] fix: [FileSystem] Harden against overflows of OperationID a bit better (#18572) --- patches/common/chromium/.patches | 1 + ...verflows_of_operationid_a_bit_better.patch | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index 7423618cacc4b..e18d46f0b274c 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -104,3 +104,4 @@ tabbed_window_lagging.patch restore_live_region_changed_events_for_processing_by_jaws_focus_mode.patch enable_quic_proxies_for_https_urls.patch fix_svg_crash_for_v0_distribution_into_foreignobject.patch +filesystem_harden_against_overflows_of_operationid_a_bit_better.patch diff --git a/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch b/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch new file mode 100644 index 0000000000000..789949d398a7e --- /dev/null +++ b/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Marijn Kruisselbrink +Date: Tue, 29 Jan 2019 19:51:07 +0000 +Subject: [FileSystem] Harden against overflows of OperationID a bit better. + +Rather than having a UAF when OperationID overflows instead overwrite +the old operation with the new one. Can still cause weirdness, but at +least won't result in UAF. Also update OperationID to uint64_t to +make sure we don't overflow to begin with. + +Bug: 925864 +Change-Id: Ifdf3fa0935ab5ea8802d91bba39601f02b0dbdc9 +Reviewed-on: https://chromium-review.googlesource.com/c/1441498 +Commit-Queue: Marijn Kruisselbrink +Reviewed-by: Victor Costan +Cr-Commit-Position: refs/heads/master@{#627115} + +diff --git a/storage/browser/fileapi/file_system_operation_runner.cc b/storage/browser/fileapi/file_system_operation_runner.cc +index fbda72b3cdf851947aa697776e54e0b5092e729b..09af7c0c8c9099489286152009f05ad49d968174 100644 +--- a/storage/browser/fileapi/file_system_operation_runner.cc ++++ b/storage/browser/fileapi/file_system_operation_runner.cc +@@ -701,7 +701,7 @@ FileSystemOperationRunner::BeginOperation( + base::WeakPtr scope) { + OperationHandle handle; + handle.id = next_operation_id_++; +- operations_.emplace(handle.id, std::move(operation)); ++ operations_[handle.id] = std::move(operation); + handle.scope = scope; + return handle; + } +diff --git a/storage/browser/fileapi/file_system_operation_runner.h b/storage/browser/fileapi/file_system_operation_runner.h +index a330f4802d5d5c721d8bba460f25edc2f8e1340a..97f9e0d81163d08644f0cee5b9da21ac24b300af 100644 +--- a/storage/browser/fileapi/file_system_operation_runner.h ++++ b/storage/browser/fileapi/file_system_operation_runner.h +@@ -53,7 +53,7 @@ class STORAGE_EXPORT FileSystemOperationRunner + using CopyOrMoveOption = FileSystemOperation::CopyOrMoveOption; + using GetMetadataField = FileSystemOperation::GetMetadataField; + +- using OperationID = int; ++ using OperationID = uint64_t; + + virtual ~FileSystemOperationRunner(); + From cbc0e466173a21f4dcefdebcdfa0e0f586d7992f Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Tue, 4 Jun 2019 09:28:12 -0700 Subject: [PATCH 24/94] Bump v4.2.4 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index ec87108d821a5..74ecad8a34195 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.3 \ No newline at end of file +4.2.4 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 780b51afab054..5a68987ba7d9d 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.3 + 4.2.4 CFBundleShortVersionString - 4.2.3 + 4.2.4 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index c25892947bc9a..f9ecc0b890de0 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,3,0 - PRODUCTVERSION 4,2,3,0 + FILEVERSION 4,2,4,0 + PRODUCTVERSION 4,2,4,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.3" + VALUE "FileVersion", "4.2.4" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.3" + VALUE "ProductVersion", "4.2.4" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index ea8400bf30864..dbf5f4a208319 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 3 +#define ATOM_PATCH_VERSION 4 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index 7d62b9e84dbb3..8efe856191c47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.3", + "version": "4.2.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f7c7d507bf9fd..aafd0eaa34579 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.3", + "version": "4.2.4", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From b35e35f3ecc9998701a78966714d8a51623202f2 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 4 Jun 2019 20:22:33 +0200 Subject: [PATCH 25/94] fix: UAP in ImageBitmapLoader/FileReaderLoader (#18563) --- patches/common/chromium/.patches | 1 + ...n_imagebitmaploader_filereaderloader.patch | 134 ++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 patches/common/chromium/fix_uap_in_imagebitmaploader_filereaderloader.patch diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index e18d46f0b274c..b5664d459ace1 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -105,3 +105,4 @@ restore_live_region_changed_events_for_processing_by_jaws_focus_mode.patch enable_quic_proxies_for_https_urls.patch fix_svg_crash_for_v0_distribution_into_foreignobject.patch filesystem_harden_against_overflows_of_operationid_a_bit_better.patch +fix_uap_in_imagebitmaploader_filereaderloader.patch diff --git a/patches/common/chromium/fix_uap_in_imagebitmaploader_filereaderloader.patch b/patches/common/chromium/fix_uap_in_imagebitmaploader_filereaderloader.patch new file mode 100644 index 0000000000000..005022990975a --- /dev/null +++ b/patches/common/chromium/fix_uap_in_imagebitmaploader_filereaderloader.patch @@ -0,0 +1,134 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Marijn Kruisselbrink +Date: Thu, 13 Dec 2018 17:09:55 +0000 +Subject: Fix UAP in ImageBitmapLoader/FileReaderLoader + +FileReaderLoader stores its client as a raw pointer, so in cases like +ImageBitmapLoader where the FileReaderLoaderClient really is garbage +collected we have to make sure to destroy the FileReaderLoader when +the ExecutionContext that owns it is destroyed. + +Bug: 913970 +Change-Id: I40b02115367cf7bf5bbbbb8e9b57874d2510f861 +Reviewed-on: https://chromium-review.googlesource.com/c/1374511 +Reviewed-by: Jeremy Roman +Commit-Queue: Marijn Kruisselbrink +Cr-Commit-Position: refs/heads/master@{#616342} + +diff --git a/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc b/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc +index 076b9beeaa6675c5e858a1c7f5a321ab57c606fb..40898b704891c3723574d3afa4aebf72f5cdce5c 100644 +--- a/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc ++++ b/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.cc +@@ -238,27 +238,31 @@ void ImageBitmapFactories::DidFinishLoading(ImageBitmapLoader* loader) { + pending_loaders_.erase(loader); + } + ++void ImageBitmapFactories::Trace(blink::Visitor* visitor) { ++ visitor->Trace(pending_loaders_); ++ Supplement::Trace(visitor); ++ Supplement::Trace(visitor); ++} ++ + ImageBitmapFactories::ImageBitmapLoader::ImageBitmapLoader( + ImageBitmapFactories& factory, + base::Optional crop_rect, + ScriptState* script_state, + const ImageBitmapOptions& options) +- : loader_( ++ : ContextLifecycleObserver(ExecutionContext::From(script_state)), ++ loader_( + FileReaderLoader::Create(FileReaderLoader::kReadAsArrayBuffer, this)), + factory_(&factory), + resolver_(ScriptPromiseResolver::Create(script_state)), + crop_rect_(crop_rect), + options_(options) {} + +-void ImageBitmapFactories::ImageBitmapLoader::LoadBlobAsync( +- Blob* blob) { ++void ImageBitmapFactories::ImageBitmapLoader::LoadBlobAsync(Blob* blob) { + loader_->Start(blob->GetBlobDataHandle()); + } + +-void ImageBitmapFactories::Trace(blink::Visitor* visitor) { +- visitor->Trace(pending_loaders_); +- Supplement::Trace(visitor); +- Supplement::Trace(visitor); ++ImageBitmapFactories::ImageBitmapLoader::~ImageBitmapLoader() { ++ DCHECK(!loader_); + } + + void ImageBitmapFactories::ImageBitmapLoader::RejectPromise( +@@ -277,11 +281,20 @@ void ImageBitmapFactories::ImageBitmapLoader::RejectPromise( + default: + NOTREACHED(); + } ++ loader_.reset(); + factory_->DidFinishLoading(this); + } + ++void ImageBitmapFactories::ImageBitmapLoader::ContextDestroyed( ++ ExecutionContext*) { ++ if (loader_) ++ factory_->DidFinishLoading(this); ++ loader_.reset(); ++} ++ + void ImageBitmapFactories::ImageBitmapLoader::DidFinishLoading() { + DOMArrayBuffer* array_buffer = loader_->ArrayBufferResult(); ++ loader_.reset(); + if (!array_buffer) { + RejectPromise(kAllocationFailureImageBitmapRejectionReason); + return; +@@ -359,6 +372,7 @@ void ImageBitmapFactories::ImageBitmapLoader::ResolvePromiseOnOriginalThread( + } + + void ImageBitmapFactories::ImageBitmapLoader::Trace(blink::Visitor* visitor) { ++ ContextLifecycleObserver::Trace(visitor); + visitor->Trace(factory_); + visitor->Trace(resolver_); + } +diff --git a/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.h b/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.h +index 25bdf1ffd1e85a05ab4ee46aaa81c61294fd7d1a..726012a20f7250ea1166ec03875ebaa10f352a49 100644 +--- a/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.h ++++ b/third_party/blink/renderer/core/imagebitmap/image_bitmap_factories.h +@@ -36,6 +36,7 @@ + #include "third_party/blink/renderer/bindings/core/v8/image_bitmap_source.h" + #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" + #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" ++#include "third_party/blink/renderer/core/dom/context_lifecycle_observer.h" + #include "third_party/blink/renderer/core/fileapi/file_reader_loader.h" + #include "third_party/blink/renderer/core/fileapi/file_reader_loader_client.h" + #include "third_party/blink/renderer/core/frame/local_dom_window.h" +@@ -103,7 +104,10 @@ class ImageBitmapFactories final + private: + class ImageBitmapLoader final + : public GarbageCollectedFinalized, ++ public ContextLifecycleObserver, + public FileReaderLoaderClient { ++ USING_GARBAGE_COLLECTED_MIXIN(ImageBitmapLoader); ++ + public: + static ImageBitmapLoader* Create(ImageBitmapFactories& factory, + base::Optional crop_rect, +@@ -115,9 +119,9 @@ class ImageBitmapFactories final + void LoadBlobAsync(Blob*); + ScriptPromise Promise() { return resolver_->Promise(); } + +- void Trace(blink::Visitor*); ++ void Trace(blink::Visitor*) override; + +- ~ImageBitmapLoader() override = default; ++ ~ImageBitmapLoader() override; + + private: + ImageBitmapLoader(ImageBitmapFactories&, +@@ -140,6 +144,9 @@ class ImageBitmapFactories final + const String& color_space_conversion_option); + void ResolvePromiseOnOriginalThread(sk_sp); + ++ // ContextLifecycleObserver ++ void ContextDestroyed(ExecutionContext*) override; ++ + // FileReaderLoaderClient + void DidStartLoading() override {} + void DidReceiveData() override {} From ee6c91d49166cde568e3b5e5093a51beb11fcad1 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 4 Jun 2019 20:22:58 +0200 Subject: [PATCH 26/94] fix: ValueSerializer: Report if buffer expansion fails during WriteHostObject (#18562) --- patches/common/v8/.patches | 1 + ...ort_if_buffer_expansion_fails_during.patch | 164 ++++++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 patches/common/v8/valueserializer_report_if_buffer_expansion_fails_during.patch diff --git a/patches/common/v8/.patches b/patches/common/v8/.patches index fbbbb0f44902a..501eac1c609b0 100644 --- a/patches/common/v8/.patches +++ b/patches/common/v8/.patches @@ -23,3 +23,4 @@ do_not_export_private_v8_symbols_on_windows.patch turbofan_fix_wrong_typing_of_speculativesafeintegersubtract.patch turbofan_restrict_redundancy_elimination_from_widening_types.patch parser_literalbuffer_expandbuffer_always_grows.patch +valueserializer_report_if_buffer_expansion_fails_during.patch diff --git a/patches/common/v8/valueserializer_report_if_buffer_expansion_fails_during.patch b/patches/common/v8/valueserializer_report_if_buffer_expansion_fails_during.patch new file mode 100644 index 0000000000000..d7db992c952a6 --- /dev/null +++ b/patches/common/v8/valueserializer_report_if_buffer_expansion_fails_during.patch @@ -0,0 +1,164 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jeremy Roman +Date: Thu, 13 Dec 2018 18:43:00 -0500 +Subject: ValueSerializer: Report if buffer expansion fails during + WriteHostObject. + +Also fail early if we detect that we've previously run out of memory and thus +corrupted the buffer. + +Add a unit test for this kind of case. + +Bug: chromium:914731 +Change-Id: Iaaf3927209bffeab6fe8ba462d9dd9dad8cbbe2f +Reviewed-on: https://chromium-review.googlesource.com/c/1377449 +Reviewed-by: Yang Guo +Commit-Queue: Jeremy Roman +Cr-Commit-Position: refs/heads/master@{#58248} + +diff --git a/src/value-serializer.cc b/src/value-serializer.cc +index 4c9c9a9aa2d9ce6017bb02448fa474478c9f6308..8c85bd9f5466612937a71f8bfdcb82120f7fb9c7 100644 +--- a/src/value-serializer.cc ++++ b/src/value-serializer.cc +@@ -344,7 +344,11 @@ void ValueSerializer::TransferArrayBuffer(uint32_t transfer_id, + } + + Maybe ValueSerializer::WriteObject(Handle object) { +- out_of_memory_ = false; ++ // There is no sense in trying to proceed if we've previously run out of ++ // memory. Bail immediately, as this likely implies that some write has ++ // previously failed and so the buffer is corrupt. ++ if (V8_UNLIKELY(out_of_memory_)) return ThrowIfOutOfMemory(); ++ + if (object->IsSmi()) { + WriteSmi(Smi::cast(*object)); + return ThrowIfOutOfMemory(); +@@ -930,8 +934,10 @@ Maybe ValueSerializer::WriteHostObject(Handle object) { + Maybe result = + delegate_->WriteHostObject(v8_isolate, Utils::ToLocal(object)); + RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate_, Nothing()); ++ USE(result); + DCHECK(!result.IsNothing()); +- return result; ++ DCHECK(result.ToChecked()); ++ return ThrowIfOutOfMemory(); + } + + Maybe ValueSerializer::WriteJSObjectPropertiesSlow( +diff --git a/test/unittests/value-serializer-unittest.cc b/test/unittests/value-serializer-unittest.cc +index 92603b588ad13480460a166b556be18e57fc8ad6..bc738c84fc8b15bdfcdb0cc995f8002362292a4c 100644 +--- a/test/unittests/value-serializer-unittest.cc ++++ b/test/unittests/value-serializer-unittest.cc +@@ -119,7 +119,10 @@ class ValueSerializerTest : public TestWithIsolate { + } + std::pair buffer = serializer.Release(); + std::vector result(buffer.first, buffer.first + buffer.second); +- free(buffer.first); ++ if (auto* delegate = GetSerializerDelegate()) ++ delegate->FreeBufferMemory(buffer.first); ++ else ++ free(buffer.first); + return Just(std::move(result)); + } + +@@ -138,6 +141,10 @@ class ValueSerializerTest : public TestWithIsolate { + return buffer; + } + ++ std::vector EncodeTest(const char* source) { ++ return EncodeTest(EvaluateScriptForInput(source)); ++ } ++ + v8::Local InvalidEncodeTest(Local input_value) { + Context::Scope scope(serialization_context()); + TryCatch try_catch(isolate()); +@@ -2698,5 +2705,89 @@ TEST_F(ValueSerializerTestWithWasm, DecodeWasmModuleWithInvalidDataLength) { + InvalidDecodeTest({0xFF, 0x09, 0x3F, 0x00, 0x57, 0x79, 0x00, 0x7F}); + } + ++class ValueSerializerTestWithLimitedMemory : public ValueSerializerTest { ++ protected: ++// GMock doesn't use the "override" keyword. ++#if __clang__ ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Winconsistent-missing-override" ++#endif ++ ++ class SerializerDelegate : public ValueSerializer::Delegate { ++ public: ++ explicit SerializerDelegate(ValueSerializerTestWithLimitedMemory* test) ++ : test_(test) {} ++ ++ ~SerializerDelegate() { EXPECT_EQ(nullptr, last_buffer_); } ++ ++ void SetMemoryLimit(size_t limit) { memory_limit_ = limit; } ++ ++ void* ReallocateBufferMemory(void* old_buffer, size_t size, ++ size_t* actual_size) override { ++ EXPECT_EQ(old_buffer, last_buffer_); ++ if (size > memory_limit_) return nullptr; ++ *actual_size = size; ++ last_buffer_ = realloc(old_buffer, size); ++ return last_buffer_; ++ } ++ ++ void FreeBufferMemory(void* buffer) override { ++ EXPECT_EQ(buffer, last_buffer_); ++ last_buffer_ = nullptr; ++ free(buffer); ++ } ++ ++ void ThrowDataCloneError(Local message) override { ++ test_->isolate()->ThrowException(Exception::Error(message)); ++ } ++ ++ MOCK_METHOD2(WriteHostObject, ++ Maybe(Isolate* isolate, Local object)); ++ ++ private: ++ ValueSerializerTestWithLimitedMemory* test_; ++ void* last_buffer_ = nullptr; ++ size_t memory_limit_ = 0; ++ }; ++ ++#if __clang__ ++#pragma clang diagnostic pop ++#endif ++ ++ ValueSerializer::Delegate* GetSerializerDelegate() override { ++ return &serializer_delegate_; ++ } ++ ++ void BeforeEncode(ValueSerializer* serializer) override { ++ serializer_ = serializer; ++ } ++ ++ SerializerDelegate serializer_delegate_{this}; ++ ValueSerializer* serializer_ = nullptr; ++}; ++ ++TEST_F(ValueSerializerTestWithLimitedMemory, FailIfNoMemoryInWriteHostObject) { ++ EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _)) ++ .WillRepeatedly(Invoke([this](Isolate*, Local) { ++ static const char kDummyData[1024] = {}; ++ serializer_->WriteRawBytes(&kDummyData, sizeof(kDummyData)); ++ return Just(true); ++ })); ++ ++ // If there is enough memory, things work. ++ serializer_delegate_.SetMemoryLimit(2048); ++ EncodeTest("new ExampleHostObject()"); ++ ++ // If not, we get a graceful failure, rather than silent misbehavior. ++ serializer_delegate_.SetMemoryLimit(1024); ++ InvalidEncodeTest("new ExampleHostObject()"); ++ ++ // And we definitely don't continue to serialize other things. ++ serializer_delegate_.SetMemoryLimit(1024); ++ EvaluateScriptForInput("gotA = false"); ++ InvalidEncodeTest("[new ExampleHostObject, {get a() { gotA = true; }}]"); ++ EXPECT_TRUE(EvaluateScriptForInput("gotA")->IsFalse()); ++} ++ + } // namespace + } // namespace v8 From c9b9a0cd9a1ed4256a2d31884407830b4f0c5ab4 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 6 Jun 2019 12:06:53 +0200 Subject: [PATCH 27/94] fix: Check array element length in ValueDeserializer (#18565) --- patches/common/v8/.patches | 1 + ..._element_length_in_valuedeserializer.patch | 112 ++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 patches/common/v8/check_array_element_length_in_valuedeserializer.patch diff --git a/patches/common/v8/.patches b/patches/common/v8/.patches index 501eac1c609b0..ebc35b896bd9e 100644 --- a/patches/common/v8/.patches +++ b/patches/common/v8/.patches @@ -24,3 +24,4 @@ turbofan_fix_wrong_typing_of_speculativesafeintegersubtract.patch turbofan_restrict_redundancy_elimination_from_widening_types.patch parser_literalbuffer_expandbuffer_always_grows.patch valueserializer_report_if_buffer_expansion_fails_during.patch +check_array_element_length_in_valuedeserializer.patch diff --git a/patches/common/v8/check_array_element_length_in_valuedeserializer.patch b/patches/common/v8/check_array_element_length_in_valuedeserializer.patch new file mode 100644 index 0000000000000..45aa18ffecd8a --- /dev/null +++ b/patches/common/v8/check_array_element_length_in_valuedeserializer.patch @@ -0,0 +1,112 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Milan Burda +Date: Sat, 1 Jun 2019 23:36:46 +0200 +Subject: Check array element length in ValueDeserializer + +Backports: +- https://chromium-review.googlesource.com/c/v8/v8/+/1339699 +- https://chromium-review.googlesource.com/c/v8/v8/+/1340283 +- https://chromium-review.googlesource.com/c/v8/v8/+/1362046 + +diff --git a/src/value-serializer.cc b/src/value-serializer.cc +index 8c85bd9f5466612937a71f8bfdcb82120f7fb9c7..e624641c315f0d2c3423462928d8e1e900027031 100644 +--- a/src/value-serializer.cc ++++ b/src/value-serializer.cc +@@ -1150,6 +1150,7 @@ void ValueDeserializer::TransferArrayBuffer( + } + + MaybeHandle ValueDeserializer::ReadObject() { ++ DisallowJavascriptExecution no_js(isolate_); + MaybeHandle result = ReadObjectInternal(); + + // ArrayBufferView is special in that it consumes the value before it, even +@@ -1474,6 +1475,11 @@ MaybeHandle ValueDeserializer::ReadDenseJSArray() { + // hole. Past version 11, undefined means undefined. + if (version_ < 11 && element->IsUndefined(isolate_)) continue; + ++ // Safety check. ++ if (i >= static_cast(elements->length())) { ++ return MaybeHandle(); ++ } ++ + elements->set(i, *element); + } + +@@ -1595,8 +1601,12 @@ MaybeHandle ValueDeserializer::ReadJSMap() { + } + + Handle argv[2]; +- if (!ReadObject().ToHandle(&argv[0]) || !ReadObject().ToHandle(&argv[1]) || +- Execution::Call(isolate_, map_set, map, arraysize(argv), argv) ++ if (!ReadObject().ToHandle(&argv[0]) || !ReadObject().ToHandle(&argv[1])) { ++ return MaybeHandle(); ++ } ++ ++ AllowJavascriptExecution allow_js(isolate_); ++ if (Execution::Call(isolate_, map_set, map, arraysize(argv), argv) + .is_null()) { + return MaybeHandle(); + } +@@ -1631,8 +1641,10 @@ MaybeHandle ValueDeserializer::ReadJSSet() { + } + + Handle argv[1]; +- if (!ReadObject().ToHandle(&argv[0]) || +- Execution::Call(isolate_, set_add, set, arraysize(argv), argv) ++ if (!ReadObject().ToHandle(&argv[0])) return MaybeHandle(); ++ ++ AllowJavascriptExecution allow_js(isolate_); ++ if (Execution::Call(isolate_, set_add, set, arraysize(argv), argv) + .is_null()) { + return MaybeHandle(); + } +@@ -1981,7 +1993,7 @@ Maybe ValueDeserializer::ReadJSObjectProperties( + bool success; + LookupIterator it = LookupIterator::PropertyOrElement( + isolate_, object, key, &success, LookupIterator::OWN); +- if (!success || ++ if (!success || it.state() != LookupIterator::NOT_FOUND || + JSObject::DefineOwnPropertyIgnoreAttributes(&it, value, NONE) + .is_null()) { + return Nothing(); +@@ -2015,7 +2027,7 @@ Maybe ValueDeserializer::ReadJSObjectProperties( + bool success; + LookupIterator it = LookupIterator::PropertyOrElement( + isolate_, object, key, &success, LookupIterator::OWN); +- if (!success || ++ if (!success || it.state() != LookupIterator::NOT_FOUND || + JSObject::DefineOwnPropertyIgnoreAttributes(&it, value, NONE) + .is_null()) { + return Nothing(); +@@ -2062,7 +2074,7 @@ static Maybe SetPropertiesFromKeyValuePairs(Isolate* isolate, + bool success; + LookupIterator it = LookupIterator::PropertyOrElement( + isolate, object, key, &success, LookupIterator::OWN); +- if (!success || ++ if (!success || it.state() != LookupIterator::NOT_FOUND || + JSObject::DefineOwnPropertyIgnoreAttributes(&it, value, NONE) + .is_null()) { + return Nothing(); +diff --git a/test/unittests/value-serializer-unittest.cc b/test/unittests/value-serializer-unittest.cc +index bc738c84fc8b15bdfcdb0cc995f8002362292a4c..d81a4d2cc590e265221804bfa23a7a5967a3d042 100644 +--- a/test/unittests/value-serializer-unittest.cc ++++ b/test/unittests/value-serializer-unittest.cc +@@ -1877,6 +1877,18 @@ TEST_F(ValueSerializerTest, DecodeDataView) { + ExpectScriptTrue("Object.getPrototypeOf(result) === DataView.prototype"); + } + ++TEST_F(ValueSerializerTest, DecodeArrayWithLengthProperty1) { ++ InvalidDecodeTest({0xff, 0x0d, 0x41, 0x03, 0x49, 0x02, 0x49, 0x04, ++ 0x49, 0x06, 0x22, 0x06, 0x6c, 0x65, 0x6e, 0x67, ++ 0x74, 0x68, 0x49, 0x02, 0x24, 0x01, 0x03}); ++} ++ ++TEST_F(ValueSerializerTest, DecodeArrayWithLengthProperty2) { ++ InvalidDecodeTest({0xff, 0x0d, 0x41, 0x03, 0x49, 0x02, 0x49, 0x04, ++ 0x49, 0x06, 0x22, 0x06, 0x6c, 0x65, 0x6e, 0x67, ++ 0x74, 0x68, 0x6f, 0x7b, 0x00, 0x24, 0x01, 0x03}); ++} ++ + TEST_F(ValueSerializerTest, DecodeInvalidDataView) { + // Byte offset out of range. + InvalidDecodeTest( From b7c49f7940fa2aab8f92dea821656d1f860b54f9 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 6 Jun 2019 17:29:39 +0200 Subject: [PATCH 28/94] fix: [Liftoff] Correctly unuse Labels (#18530) --- patches/common/v8/.patches | 1 + .../v8/liftoff-correctly-unuse-labels.patch | 104 ++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 patches/common/v8/liftoff-correctly-unuse-labels.patch diff --git a/patches/common/v8/.patches b/patches/common/v8/.patches index ebc35b896bd9e..8a03dbe2392e5 100644 --- a/patches/common/v8/.patches +++ b/patches/common/v8/.patches @@ -25,3 +25,4 @@ turbofan_restrict_redundancy_elimination_from_widening_types.patch parser_literalbuffer_expandbuffer_always_grows.patch valueserializer_report_if_buffer_expansion_fails_during.patch check_array_element_length_in_valuedeserializer.patch +liftoff-correctly-unuse-labels.patch diff --git a/patches/common/v8/liftoff-correctly-unuse-labels.patch b/patches/common/v8/liftoff-correctly-unuse-labels.patch new file mode 100644 index 0000000000000..b0de3fbaad445 --- /dev/null +++ b/patches/common/v8/liftoff-correctly-unuse-labels.patch @@ -0,0 +1,104 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Clemens Hammacher +Date: Tue, 29 Jan 2019 15:04:04 +0100 +Subject: [Liftoff] Correctly unuse Labels + +On Liftoff bailout, instead of binding all unbound labels (to avoid +triggering DCHECKS in their destructor), just Unuse them. + +R=mstarzinger@chromium.org + +Bug: chromium:924843 +Change-Id: Icf581bca06eaa7369ab2bbd5d805112289d6a801 +Reviewed-on: https://chromium-review.googlesource.com/c/1442645 +Reviewed-by: Michael Starzinger +Commit-Queue: Clemens Hammacher +Cr-Commit-Position: refs/heads/master@{#59172} + +diff --git a/src/wasm/baseline/liftoff-compiler.cc b/src/wasm/baseline/liftoff-compiler.cc +index 1130cf0cdd5f1e5a83ebc99433d4269952a3aac3..dd16a0762c9fefd8ba4e7287a50b84f580e0d60b 100644 +--- a/src/wasm/baseline/liftoff-compiler.cc ++++ b/src/wasm/baseline/liftoff-compiler.cc +@@ -145,7 +145,7 @@ class LiftoffCompiler { + compilation_zone_(compilation_zone), + safepoint_table_builder_(compilation_zone_) {} + +- ~LiftoffCompiler() { BindUnboundLabels(nullptr); } ++ ~LiftoffCompiler() { UnuseLabels(nullptr); } + + bool ok() const { return ok_; } + +@@ -169,7 +169,7 @@ class LiftoffCompiler { + ok_ = false; + TRACE("unsupported: %s\n", reason); + decoder->errorf(decoder->pc(), "unsupported liftoff operation: %s", reason); +- BindUnboundLabels(decoder); ++ UnuseLabels(decoder); + } + + bool DidAssemblerBailout(Decoder* decoder) { +@@ -195,23 +195,21 @@ class LiftoffCompiler { + return safepoint_table_builder_.GetCodeOffset(); + } + +- void BindUnboundLabels(Decoder* decoder) { ++ void UnuseLabels(Decoder* decoder) { + #ifdef DEBUG +- // Bind all labels now, otherwise their destructor will fire a DCHECK error ++ auto Unuse = [](Label* label) { ++ label->Unuse(); ++ label->UnuseNear(); ++ }; ++ // Unuse all labels now, otherwise their destructor will fire a DCHECK error + // if they where referenced before. + uint32_t control_depth = decoder ? decoder->control_depth() : 0; + for (uint32_t i = 0; i < control_depth; ++i) { + Control* c = decoder->control_at(i); +- Label* label = c->label.get(); +- if (!label->is_bound()) __ bind(label); +- if (c->else_state) { +- Label* else_label = c->else_state->label.get(); +- if (!else_label->is_bound()) __ bind(else_label); +- } +- } +- for (auto& ool : out_of_line_code_) { +- if (!ool.label.get()->is_bound()) __ bind(ool.label.get()); ++ Unuse(c->label.get()); ++ if (c->else_state) Unuse(c->else_state->label.get()); + } ++ for (auto& ool : out_of_line_code_) Unuse(ool.label.get()); + #endif + } + +@@ -437,7 +435,7 @@ class LiftoffCompiler { + + void OnFirstError(Decoder* decoder) { + ok_ = false; +- BindUnboundLabels(decoder); ++ UnuseLabels(decoder); + asm_.AbortCompilation(); + } + +diff --git a/test/mjsunit/regress/wasm/regress-924843.js b/test/mjsunit/regress/wasm/regress-924843.js +new file mode 100644 +index 0000000000000000000000000000000000000000..b59548540ccbd514eb65da4619698f87d2b48c70 +--- /dev/null ++++ b/test/mjsunit/regress/wasm/regress-924843.js +@@ -0,0 +1,17 @@ ++// Copyright 2019 the V8 project authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++load('test/mjsunit/wasm/wasm-constants.js'); ++load('test/mjsunit/wasm/wasm-module-builder.js'); ++ ++const builder = new WasmModuleBuilder(); ++const sig = builder.addType(makeSig([kWasmI32, kWasmI32, kWasmI32], [kWasmI32])); ++builder.addFunction(undefined, sig) ++ .addBody([ ++ kExprGetLocal, 2, ++ kExprIf, kWasmStmt, ++ kExprBlock, kWasmStmt ++ ]); ++builder.addExport('main', 0); ++assertThrows(() => builder.instantiate(), WebAssembly.CompileError); From 3f4f58130e65b668de25401fe483369a45d6aac9 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Thu, 6 Jun 2019 08:31:53 -0700 Subject: [PATCH 29/94] ci: fix issues downloading from CircleCI (#18656) Make sure we pass along token to download from CircleCI Also, add back off period for retries on downloads. --- script/download-circleci-artifacts.js | 37 ++++++++++++++++++--------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/script/download-circleci-artifacts.js b/script/download-circleci-artifacts.js index 6ae6124a85bf8..8fb63030cbb61 100644 --- a/script/download-circleci-artifacts.js +++ b/script/download-circleci-artifacts.js @@ -13,15 +13,17 @@ async function makeRequest (requestOptions, parseResponse) { resolve(body) } } else { - console.error('Error occurred while requesting:', requestOptions.url) - if (parseResponse) { - try { - console.log('Error: ', `(status ${res.statusCode})`, err || JSON.parse(res.body), requestOptions) - } catch (err) { + if (args.verbose) { + console.error('Error occurred while requesting:', requestOptions.url) + if (parseResponse) { + try { + console.log('Error: ', `(status ${res.statusCode})`, err || JSON.parse(res.body), requestOptions) + } catch (err) { + console.log('Error: ', `(status ${res.statusCode})`, err || res.body, requestOptions) + } + } else { console.log('Error: ', `(status ${res.statusCode})`, err || res.body, requestOptions) } - } else { - console.log('Error: ', `(status ${res.statusCode})`, err || res.body, requestOptions) } reject(err) } @@ -39,7 +41,11 @@ async function downloadArtifact (name, buildNum, dest) { 'Accept': 'application/json' } }, true).catch(err => { - console.log('Error calling CircleCI:', err) + if (args.verbose) { + console.log('Error calling CircleCI:', err) + } else { + console.error('Error calling CircleCI to get artifact details') + } }) const artifactToDownload = artifacts.find(artifact => { return (artifact.path === name) @@ -51,7 +57,11 @@ async function downloadArtifact (name, buildNum, dest) { console.log(`Downloading ${artifactToDownload.url}.`) let downloadError = false await downloadWithRetry(artifactToDownload.url, dest).catch(err => { - console.log(`Error downnloading ${artifactToDownload.url} :`, err) + if (args.verbose) { + console.log(`${artifactToDownload.url} could not be successfully downloaded. Error was:`, err) + } else { + console.log(`${artifactToDownload.url} could not be successfully downloaded.`) + } downloadError = true }) if (!downloadError) { @@ -62,12 +72,14 @@ async function downloadArtifact (name, buildNum, dest) { async function downloadWithRetry (url, directory) { let lastError + const downloadURL = `${url}?circle-token=${process.env.CIRCLE_TOKEN}` for (let i = 0; i < 5; i++) { console.log(`Attempting to download ${url} - attempt #${(i + 1)}`) try { - return await downloadFile(url, directory) + return await downloadFile(downloadURL, directory) } catch (err) { lastError = err + await new Promise((resolve, reject) => setTimeout(resolve, 30000)) } } throw lastError @@ -76,7 +88,8 @@ async function downloadWithRetry (url, directory) { function downloadFile (url, directory) { return new Promise((resolve, reject) => { const nuggetOpts = { - dir: directory + dir: directory, + quiet: args.verbose } nugget(url, nuggetOpts, (err) => { if (err) { @@ -90,7 +103,7 @@ function downloadFile (url, directory) { if (!args.name || !args.buildNum || !args.dest) { console.log(`Download CircleCI artifacts. - Usage: download-circleci-artifacts.js [--buildNum=CIRCLE_BUILD_NUMBER] [--name=artifactName] [--dest]`) + Usage: download-circleci-artifacts.js [--buildNum=CIRCLE_BUILD_NUMBER] [--name=artifactName] [--dest] [--verbose]`) process.exit(0) } else { downloadArtifact(args.name, args.buildNum, args.dest) From 87c0b54788c4f1c2dec84e6f2bbc7e5d8286bf7e Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Fri, 7 Jun 2019 04:44:09 +0200 Subject: [PATCH 30/94] fix: Fixed all OOB accesses in VertexProgram and PixelProgram (#18567) --- patches/common/swiftshader/.patches | 2 + .../fix_undefined_behavior_in_offset.patch | 36 ++ ...es_in_vertexprogram_and_pixelprogram.patch | 508 ++++++++++++++++++ 3 files changed, 546 insertions(+) create mode 100644 patches/common/swiftshader/fix_undefined_behavior_in_offset.patch create mode 100644 patches/common/swiftshader/fixed_all_oob_accesses_in_vertexprogram_and_pixelprogram.patch diff --git a/patches/common/swiftshader/.patches b/patches/common/swiftshader/.patches index f518ba48ec8e9..f6f42b7387552 100644 --- a/patches/common/swiftshader/.patches +++ b/patches/common/swiftshader/.patches @@ -1 +1,3 @@ prevent_gldeletequeries_from_deleting_a_live_query.patch +fix_undefined_behavior_in_offset.patch +fixed_all_oob_accesses_in_vertexprogram_and_pixelprogram.patch diff --git a/patches/common/swiftshader/fix_undefined_behavior_in_offset.patch b/patches/common/swiftshader/fix_undefined_behavior_in_offset.patch new file mode 100644 index 0000000000000..ce375d1ac0cde --- /dev/null +++ b/patches/common/swiftshader/fix_undefined_behavior_in_offset.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nicolas Capens +Date: Thu, 22 Nov 2018 10:32:35 -0500 +Subject: Fix undefined behavior in OFFSET(). +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Accessing members of a null pointer is undefined behavior, even when +only used to obtain the address again. So use a non-zero value as the +base pointer address instead. 32 was chosen to provide sufficient +alignment guarantees. + +Bug b/119823623 + +Change-Id: Ia6d24dd6c2740261948860c45eb35cc489a3a827 +Reviewed-on: https://swiftshader-review.googlesource.com/c/22788 +Tested-by: Nicolas Capens +Reviewed-by: Alexis Hétu + +diff --git a/src/Common/Types.hpp b/src/Common/Types.hpp +index cd08ed5704caa7f6454a619fd4ccbb9e2ddcee2c..837df461ab0676d94e6ee1276d75d289f06851ef 100644 +--- a/src/Common/Types.hpp ++++ b/src/Common/Types.hpp +@@ -151,7 +151,10 @@ namespace sw + return v; + } + +- #define OFFSET(s,m) (int)(size_t)&reinterpret_cast((((s*)0)->m)) ++ // The OFFSET macro is a generalization of the offsetof() macro defined in . ++ // It allows e.g. getting the offset of array elements, even when indexed dynamically. ++ // We cast the address '32' and subtract it again, because null-dereference is undefined behavior. ++ #define OFFSET(s,m) ((int)(size_t)&reinterpret_cast((((s*)32)->m)) - 32) + } + + #endif // sw_Types_hpp diff --git a/patches/common/swiftshader/fixed_all_oob_accesses_in_vertexprogram_and_pixelprogram.patch b/patches/common/swiftshader/fixed_all_oob_accesses_in_vertexprogram_and_pixelprogram.patch new file mode 100644 index 0000000000000..d2003cf63dab1 --- /dev/null +++ b/patches/common/swiftshader/fixed_all_oob_accesses_in_vertexprogram_and_pixelprogram.patch @@ -0,0 +1,508 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alexis Hetu +Date: Thu, 10 Jan 2019 14:04:26 -0500 +Subject: Fixed all OOB accesses in VertexProgram and PixelProgram +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +A lot of arrays in VertexProgram and PixelProgram have fixed sizes, +so programs that have more nested loops or ifs or deeper call stacks +can cause OOB accesses, which causes security issues in Chromium. + +Index clamping was added to prevent any OOB memory accesses here. + +This could eventually be fixed properly by first verifying these sizes +and giving shader compile errors when these limits are exceeded. + +Bug chromium:915197 chromium:915206 chromium:915218 b/116373662 + +Change-Id: I2d0710ed0ce6585f139cba49d5b5d8c909ae6391 +Reviewed-on: https://swiftshader-review.googlesource.com/c/23568 +Tested-by: Alexis Hétu +Reviewed-by: Corentin Wallez + +diff --git a/src/Common/Types.hpp b/src/Common/Types.hpp +index 837df461ab0676d94e6ee1276d75d289f06851ef..fac6d362891cf0b2a19f8faee0a1dbbdddbc3a88 100644 +--- a/src/Common/Types.hpp ++++ b/src/Common/Types.hpp +@@ -15,6 +15,7 @@ + #ifndef sw_Types_hpp + #define sw_Types_hpp + ++#include + #include + #include + +@@ -151,6 +152,46 @@ namespace sw + return v; + } + ++ template class BoundedIndex ++ { ++ public: ++ BoundedIndex(int index) : index(index) {} ++ ++ inline int operator++(int) { return index++; } ++ inline int operator--(int) { return index--; } ++ inline void operator=(int i) { index = i; } ++ ++ inline bool operator==(int i) { return index == i; } ++ inline bool operator!=(int i) { return index != i; } ++ inline bool operator<(int i) { return index < i; } ++ inline bool operator>(int i) { return index > i; } ++ inline bool operator<=(int i) { return index <= i; } ++ inline bool operator>=(int i) { return index >= i; } ++ ++ inline operator int() ++ { ++ if(index < 0) ++ { ++#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) ++ assert(false); ++#endif ++ return 0; ++ } ++ else if(index >= limit) ++ { ++#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) ++ assert(false); ++#endif ++ return limit - 1; ++ } ++ ++ return index; ++ } ++ ++ private: ++ int index = 0; ++ }; ++ + // The OFFSET macro is a generalization of the offsetof() macro defined in . + // It allows e.g. getting the offset of array elements, even when indexed dynamically. + // We cast the address '32' and subtract it again, because null-dereference is undefined behavior. +diff --git a/src/Main/Config.hpp b/src/Main/Config.hpp +index 764bfed1e7a159715f5d269e88d0d9ab578b778f..f875085452d0255d78b60ad9313e035d4ab3691f 100644 +--- a/src/Main/Config.hpp ++++ b/src/Main/Config.hpp +@@ -97,6 +97,11 @@ namespace sw + MAX_TEXTURE_LOD = MIPMAP_LEVELS - 2, // Trilinear accesses lod+1 + RENDERTARGETS = 8, + NUM_TEMPORARY_REGISTERS = 4096, ++ MAX_SHADER_CALL_SITES = 2048, ++ MAX_SHADER_NESTED_LOOPS = 4, ++ MAX_SHADER_NESTED_IFS = 24 + 24, ++ MAX_SHADER_CALL_STACK_SIZE = 16, ++ MAX_SHADER_ENABLE_STACK_SIZE = 1 + 24, + }; + } + +diff --git a/src/Shader/PixelProgram.cpp b/src/Shader/PixelProgram.cpp +index 3cedbce8debcc7a1f8d22a7e687ea5673f33d01f..f8637209323b7dfe52b1736a9b15f0285f987331 100644 +--- a/src/Shader/PixelProgram.cpp ++++ b/src/Shader/PixelProgram.cpp +@@ -828,7 +828,7 @@ namespace sw + + Int4 PixelProgram::enableMask(const Shader::Instruction *instruction) + { +- Int4 enable = instruction->analysisBranch ? Int4(enableStack[enableIndex]) : Int4(0xFFFFFFFF); ++ Int4 enable = instruction->analysisBranch ? Int4(enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]) : Int4(0xFFFFFFFF); + + if(!whileTest) + { +@@ -1343,7 +1343,7 @@ namespace sw + + void PixelProgram::BREAK() + { +- enableBreak = enableBreak & ~enableStack[enableIndex]; ++ enableBreak = enableBreak & ~enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + } + + void PixelProgram::BREAKC(Vector4f &src0, Vector4f &src1, Control control) +@@ -1379,14 +1379,14 @@ namespace sw + + void PixelProgram::BREAK(Int4 &condition) + { +- condition &= enableStack[enableIndex]; ++ condition &= enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + + enableBreak = enableBreak & ~condition; + } + + void PixelProgram::CONTINUE() + { +- enableContinue = enableContinue & ~enableStack[enableIndex]; ++ enableContinue = enableContinue & ~enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + } + + void PixelProgram::TEST() +@@ -1403,7 +1403,7 @@ namespace sw + + if(callRetBlock[labelIndex].size() > 1) + { +- callStack[stackIndex++] = UInt(callSiteIndex); ++ callStack[Min(stackIndex++, Int(MAX_SHADER_CALL_STACK_SIZE))] = UInt(callSiteIndex); + } + + Int4 restoreLeave = enableLeave; +@@ -1443,7 +1443,7 @@ namespace sw + + if(callRetBlock[labelIndex].size() > 1) + { +- callStack[stackIndex++] = UInt(callSiteIndex); ++ callStack[Min(stackIndex++, Int(MAX_SHADER_CALL_STACK_SIZE))] = UInt(callSiteIndex); + } + + Int4 restoreLeave = enableLeave; +@@ -1463,7 +1463,7 @@ namespace sw + condition = ~condition; + } + +- condition &= enableStack[enableIndex]; ++ condition &= enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + + if(!labelBlock[labelIndex]) + { +@@ -1472,11 +1472,11 @@ namespace sw + + if(callRetBlock[labelIndex].size() > 1) + { +- callStack[stackIndex++] = UInt(callSiteIndex); ++ callStack[Min(stackIndex++, Int(MAX_SHADER_CALL_STACK_SIZE))] = UInt(callSiteIndex); + } + + enableIndex++; +- enableStack[enableIndex] = condition; ++ enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] = condition; + Int4 restoreLeave = enableLeave; + + Bool notAllFalse = SignMask(condition) != 0; +@@ -1496,12 +1496,12 @@ namespace sw + + if(isConditionalIf[ifDepth]) + { +- Int4 condition = ~enableStack[enableIndex] & enableStack[enableIndex - 1]; ++ Int4 condition = ~enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] & enableStack[Min(enableIndex - 1, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + Bool notAllFalse = SignMask(condition) != 0; + + branch(notAllFalse, falseBlock, endBlock); + +- enableStack[enableIndex] = ~enableStack[enableIndex] & enableStack[enableIndex - 1]; ++ enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] = ~enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] & enableStack[Min(enableIndex - 1, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + } + else + { +@@ -1655,10 +1655,10 @@ namespace sw + + void PixelProgram::IF(Int4 &condition) + { +- condition &= enableStack[enableIndex]; ++ condition &= enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + + enableIndex++; +- enableStack[enableIndex] = condition; ++ enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] = condition; + + BasicBlock *trueBlock = Nucleus::createBasicBlock(); + BasicBlock *falseBlock = Nucleus::createBasicBlock(); +@@ -1763,10 +1763,10 @@ namespace sw + + const Vector4f &src = fetchRegister(temporaryRegister); + Int4 condition = As(src.x); +- condition &= enableStack[enableIndex - 1]; ++ condition &= enableStack[Min(enableIndex - 1, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + if(shader->containsLeaveInstruction()) condition &= enableLeave; + if(shader->containsBreakInstruction()) condition &= enableBreak; +- enableStack[enableIndex] = condition; ++ enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] = condition; + + Bool notAllFalse = SignMask(condition) != 0; + branch(notAllFalse, loopBlock, endBlock); +@@ -1838,7 +1838,7 @@ namespace sw + + void PixelProgram::LEAVE() + { +- enableLeave = enableLeave & ~enableStack[enableIndex]; ++ enableLeave = enableLeave & ~enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + + // FIXME: Return from function if all instances left + // FIXME: Use enableLeave in other control-flow constructs +diff --git a/src/Shader/PixelProgram.hpp b/src/Shader/PixelProgram.hpp +index 240938dd15820601ce2bf5e4ff6eb242ddd196e7..4ed3eef7545e27b56ceffa5a7cf33ebe9b7c287f 100644 +--- a/src/Shader/PixelProgram.hpp ++++ b/src/Shader/PixelProgram.hpp +@@ -27,7 +27,7 @@ namespace sw + PixelRoutine(state, shader), r(shader->indirectAddressableTemporaries), + loopDepth(-1), ifDepth(0), loopRepDepth(0), currentLabel(-1), whileTest(false) + { +- for(int i = 0; i < 2048; ++i) ++ for(int i = 0; i < MAX_SHADER_CALL_SITES; ++i) + { + labelBlock[i] = 0; + } +@@ -67,17 +67,17 @@ namespace sw + + // DX9 specific variables + Vector4f p0; +- Array aL; +- Array increment; +- Array iteration; ++ Array aL; ++ Array increment; ++ Array iteration; + + Int loopDepth; // FIXME: Add support for switch + Int stackIndex; // FIXME: Inc/decrement callStack +- Array callStack; ++ Array callStack; + + // Per pixel based on conditions reached + Int enableIndex; +- Array enableStack; ++ Array enableStack; + Int4 enableBreak; + Int4 enableContinue; + Int4 enableLeave; +@@ -152,18 +152,18 @@ namespace sw + void RET(); + void LEAVE(); + +- int ifDepth; +- int loopRepDepth; +- int currentLabel; ++ BoundedIndex ifDepth = 0; ++ BoundedIndex loopRepDepth = 0; ++ BoundedIndex currentLabel = -1; + bool whileTest; + +- BasicBlock *ifFalseBlock[24 + 24]; +- BasicBlock *loopRepTestBlock[4]; +- BasicBlock *loopRepEndBlock[4]; +- BasicBlock *labelBlock[2048]; +- std::vector callRetBlock[2048]; ++ BasicBlock *ifFalseBlock[MAX_SHADER_NESTED_IFS]; ++ BasicBlock *loopRepTestBlock[MAX_SHADER_NESTED_LOOPS]; ++ BasicBlock *loopRepEndBlock[MAX_SHADER_NESTED_LOOPS]; ++ BasicBlock *labelBlock[MAX_SHADER_CALL_SITES]; ++ std::vector callRetBlock[MAX_SHADER_CALL_SITES]; + BasicBlock *returnBlock; +- bool isConditionalIf[24 + 24]; ++ bool isConditionalIf[MAX_SHADER_NESTED_IFS]; + }; + } + +diff --git a/src/Shader/Shader.cpp b/src/Shader/Shader.cpp +index 36192c93c7473e7c4bc140843ad2c16ca11d3788..ed185d1c0c139bf971e44d7a1c2830de28a9c6ff 100644 +--- a/src/Shader/Shader.cpp ++++ b/src/Shader/Shader.cpp +@@ -1877,13 +1877,13 @@ namespace sw + // This is used to know what basic block to return to. + void Shader::analyzeCallSites() + { +- int callSiteIndex[2048] = {0}; ++ int callSiteIndex[MAX_SHADER_CALL_SITES] = {0}; + + for(auto &inst : instruction) + { + if(inst->opcode == OPCODE_CALL || inst->opcode == OPCODE_CALLNZ) + { +- int label = inst->dst.label; ++ int label = sw::min(inst->dst.label, (unsigned int)(MAX_SHADER_CALL_SITES)); + + inst->dst.callSite = callSiteIndex[label]++; + } +diff --git a/src/Shader/VertexProgram.cpp b/src/Shader/VertexProgram.cpp +index ad4e37bd4e5c1e93bc6728d5eaba19caf7f95e92..694f05179d6df328ef6f64a882d428422d7e86d6 100644 +--- a/src/Shader/VertexProgram.cpp ++++ b/src/Shader/VertexProgram.cpp +@@ -31,7 +31,7 @@ namespace sw + currentLabel = -1; + whileTest = false; + +- for(int i = 0; i < 2048; i++) ++ for(int i = 0; i < MAX_SHADER_CALL_SITES; i++) + { + labelBlock[i] = 0; + } +@@ -978,7 +978,7 @@ namespace sw + + Int4 VertexProgram::enableMask(const Shader::Instruction *instruction) + { +- Int4 enable = instruction->analysisBranch ? Int4(enableStack[enableIndex]) : Int4(0xFFFFFFFF); ++ Int4 enable = instruction->analysisBranch ? Int4(enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]) : Int4(0xFFFFFFFF); + + if(!whileTest) + { +@@ -1060,7 +1060,7 @@ namespace sw + + void VertexProgram::BREAK() + { +- enableBreak = enableBreak & ~enableStack[enableIndex]; ++ enableBreak = enableBreak & ~enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + } + + void VertexProgram::BREAKC(Vector4f &src0, Vector4f &src1, Control control) +@@ -1096,14 +1096,14 @@ namespace sw + + void VertexProgram::BREAK(Int4 &condition) + { +- condition &= enableStack[enableIndex]; ++ condition &= enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + + enableBreak = enableBreak & ~condition; + } + + void VertexProgram::CONTINUE() + { +- enableContinue = enableContinue & ~enableStack[enableIndex]; ++ enableContinue = enableContinue & ~enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + } + + void VertexProgram::TEST() +@@ -1120,7 +1120,7 @@ namespace sw + + if(callRetBlock[labelIndex].size() > 1) + { +- callStack[stackIndex++] = UInt(callSiteIndex); ++ callStack[Min(stackIndex++, Int(MAX_SHADER_CALL_STACK_SIZE))] = UInt(callSiteIndex); + } + + Int4 restoreLeave = enableLeave; +@@ -1160,7 +1160,7 @@ namespace sw + + if(callRetBlock[labelIndex].size() > 1) + { +- callStack[stackIndex++] = UInt(callSiteIndex); ++ callStack[Min(stackIndex++, Int(MAX_SHADER_CALL_STACK_SIZE))] = UInt(callSiteIndex); + } + + Int4 restoreLeave = enableLeave; +@@ -1180,7 +1180,7 @@ namespace sw + condition = ~condition; + } + +- condition &= enableStack[enableIndex]; ++ condition &= enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + + if(!labelBlock[labelIndex]) + { +@@ -1189,11 +1189,11 @@ namespace sw + + if(callRetBlock[labelIndex].size() > 1) + { +- callStack[stackIndex++] = UInt(callSiteIndex); ++ callStack[Min(stackIndex++, Int(MAX_SHADER_CALL_STACK_SIZE))] = UInt(callSiteIndex); + } + + enableIndex++; +- enableStack[enableIndex] = condition; ++ enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] = condition; + Int4 restoreLeave = enableLeave; + + Bool notAllFalse = SignMask(condition) != 0; +@@ -1213,12 +1213,12 @@ namespace sw + + if(isConditionalIf[ifDepth]) + { +- Int4 condition = ~enableStack[enableIndex] & enableStack[enableIndex - 1]; ++ Int4 condition = ~enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] & enableStack[Min(enableIndex - 1, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + Bool notAllFalse = SignMask(condition) != 0; + + branch(notAllFalse, falseBlock, endBlock); + +- enableStack[enableIndex] = ~enableStack[enableIndex] & enableStack[enableIndex - 1]; ++ enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] = ~enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] & enableStack[Min(enableIndex - 1, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + } + else + { +@@ -1372,10 +1372,10 @@ namespace sw + + void VertexProgram::IF(Int4 &condition) + { +- condition &= enableStack[enableIndex]; ++ condition &= enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + + enableIndex++; +- enableStack[enableIndex] = condition; ++ enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] = condition; + + BasicBlock *trueBlock = Nucleus::createBasicBlock(); + BasicBlock *falseBlock = Nucleus::createBasicBlock(); +@@ -1481,10 +1481,10 @@ namespace sw + + const Vector4f &src = fetchRegister(temporaryRegister); + Int4 condition = As(src.x); +- condition &= enableStack[enableIndex - 1]; ++ condition &= enableStack[Min(enableIndex - 1, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + if(shader->containsLeaveInstruction()) condition &= enableLeave; + if(shader->containsBreakInstruction()) condition &= enableBreak; +- enableStack[enableIndex] = condition; ++ enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))] = condition; + + Bool notAllFalse = SignMask(condition) != 0; + branch(notAllFalse, loopBlock, endBlock); +@@ -1556,7 +1556,7 @@ namespace sw + + void VertexProgram::LEAVE() + { +- enableLeave = enableLeave & ~enableStack[enableIndex]; ++ enableLeave = enableLeave & ~enableStack[Min(enableIndex, Int(MAX_SHADER_ENABLE_STACK_SIZE))]; + + // FIXME: Return from function if all instances left + // FIXME: Use enableLeave in other control-flow constructs +diff --git a/src/Shader/VertexProgram.hpp b/src/Shader/VertexProgram.hpp +index 3c4199c6611198997326d387f787bcd7467558a3..8421078acaa9f89e311015f62e17d4825a3a6e82 100644 +--- a/src/Shader/VertexProgram.hpp ++++ b/src/Shader/VertexProgram.hpp +@@ -39,18 +39,18 @@ namespace sw + + RegisterArray r; // Temporary registers + Vector4f a0; +- Array aL; ++ Array aL; + Vector4f p0; + +- Array increment; +- Array iteration; ++ Array increment; ++ Array iteration; + + Int loopDepth; + Int stackIndex; // FIXME: Inc/decrement callStack +- Array callStack; ++ Array callStack; + + Int enableIndex; +- Array enableStack; ++ Array enableStack; + Int4 enableBreak; + Int4 enableContinue; + Int4 enableLeave; +@@ -121,18 +121,18 @@ namespace sw + Vector4f sampleTexture(const Src &s, Vector4f &uvwq, Float4 &lod, Vector4f &dsx, Vector4f &dsy, Vector4f &offset, SamplerFunction function); + Vector4f sampleTexture(int sampler, Vector4f &uvwq, Float4 &lod, Vector4f &dsx, Vector4f &dsy, Vector4f &offset, SamplerFunction function); + +- int ifDepth; +- int loopRepDepth; +- int currentLabel; ++ BoundedIndex ifDepth = 0; ++ BoundedIndex loopRepDepth = 0; ++ BoundedIndex currentLabel = -1; + bool whileTest; + +- BasicBlock *ifFalseBlock[24 + 24]; +- BasicBlock *loopRepTestBlock[4]; +- BasicBlock *loopRepEndBlock[4]; +- BasicBlock *labelBlock[2048]; +- std::vector callRetBlock[2048]; ++ BasicBlock *ifFalseBlock[MAX_SHADER_NESTED_IFS]; ++ BasicBlock *loopRepTestBlock[MAX_SHADER_NESTED_LOOPS]; ++ BasicBlock *loopRepEndBlock[MAX_SHADER_NESTED_LOOPS]; ++ BasicBlock *labelBlock[MAX_SHADER_CALL_SITES]; ++ std::vector callRetBlock[MAX_SHADER_CALL_SITES]; + BasicBlock *returnBlock; +- bool isConditionalIf[24 + 24]; ++ bool isConditionalIf[MAX_SHADER_NESTED_IFS]; + }; + } + From 972d45dc09c6480f503d82a7c4fff37d9e554b82 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Mon, 10 Jun 2019 10:01:22 -0700 Subject: [PATCH 31/94] fix: use isEqual instead of pointer equality to convert NSAppearance (#18691) --- atom/browser/api/atom_api_system_preferences_mac.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atom/browser/api/atom_api_system_preferences_mac.mm b/atom/browser/api/atom_api_system_preferences_mac.mm index 73723fefdbc08..70e0287f6c324 100644 --- a/atom/browser/api/atom_api_system_preferences_mac.mm +++ b/atom/browser/api/atom_api_system_preferences_mac.mm @@ -54,11 +54,11 @@ static bool FromV8(v8::Isolate* isolate, return v8::Null(isolate); } - if (val.name == NSAppearanceNameAqua) { + if ([val.name isEqualToString:NSAppearanceNameAqua]) { return mate::ConvertToV8(isolate, "light"); } if (@available(macOS 10.14, *)) { - if (val.name == NSAppearanceNameDarkAqua) { + if ([val.name isEqualToString:NSAppearanceNameDarkAqua]) { return mate::ConvertToV8(isolate, "dark"); } } From 2dd2566fd55ddeaa944a46b489b83d77c2310d38 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Sat, 15 Jun 2019 09:22:36 +0200 Subject: [PATCH 32/94] fix: crash in BrowserWindow destructor after win.webContents.destroy() (#18686) (#18795) --- atom/browser/api/atom_api_browser_window.cc | 6 ++++-- atom/browser/api/atom_api_browser_window.h | 2 +- atom/browser/api/atom_api_web_contents.cc | 8 +++++--- atom/browser/api/atom_api_web_contents.h | 4 ++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/atom/browser/api/atom_api_browser_window.cc b/atom/browser/api/atom_api_browser_window.cc index b54e7d42b87b6..5ed118c39aba0 100644 --- a/atom/browser/api/atom_api_browser_window.cc +++ b/atom/browser/api/atom_api_browser_window.cc @@ -66,7 +66,7 @@ BrowserWindow::BrowserWindow(v8::Isolate* isolate, } web_contents_.Reset(isolate, web_contents.ToV8()); - api_web_contents_ = web_contents.get(); + api_web_contents_ = web_contents->GetWeakPtr(); api_web_contents_->AddObserver(this); Observe(api_web_contents_->web_contents()); @@ -97,7 +97,9 @@ BrowserWindow::BrowserWindow(v8::Isolate* isolate, } BrowserWindow::~BrowserWindow() { - api_web_contents_->RemoveObserver(this); + // FIXME This is a hack rather than a proper fix preventing shutdown crashes. + if (api_web_contents_) + api_web_contents_->RemoveObserver(this); // Note that the OnWindowClosed will not be called after the destructor runs, // since the window object is managed by the TopLevelWindow class. if (web_contents()) diff --git a/atom/browser/api/atom_api_browser_window.h b/atom/browser/api/atom_api_browser_window.h index 79a0737d7704b..ddc71a0572b25 100644 --- a/atom/browser/api/atom_api_browser_window.h +++ b/atom/browser/api/atom_api_browser_window.h @@ -113,7 +113,7 @@ class BrowserWindow : public TopLevelWindow, #endif v8::Global web_contents_; - api::WebContents* api_web_contents_; + base::WeakPtr api_web_contents_; base::WeakPtrFactory weak_factory_; diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index bcb84de93dbfc..6b78b62de2929 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -289,7 +289,9 @@ struct WebContents::FrameDispatchHelper { WebContents::WebContents(v8::Isolate* isolate, content::WebContents* web_contents, Type type) - : content::WebContentsObserver(web_contents), type_(type) { + : content::WebContentsObserver(web_contents), + type_(type), + weak_factory_(this) { const mate::Dictionary options = mate::Dictionary::CreateEmpty(isolate); if (type == REMOTE) { web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent(), @@ -304,8 +306,8 @@ WebContents::WebContents(v8::Isolate* isolate, } } -WebContents::WebContents(v8::Isolate* isolate, - const mate::Dictionary& options) { +WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options) + : weak_factory_(this) { // Read options. options.Get("backgroundThrottling", &background_throttling_); diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index ec0a9a381a6ec..af2303349d39c 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -99,6 +99,8 @@ class WebContents : public mate::TrackableObject, static void BuildPrototype(v8::Isolate* isolate, v8::Local prototype); + base::WeakPtr GetWeakPtr() { return weak_factory_.GetWeakPtr(); } + // Destroy the managed content::WebContents instance. // // Note: The |async| should only be |true| when users are expecting to use the @@ -515,6 +517,8 @@ class WebContents : public mate::TrackableObject, // Observers of this WebContents. base::ObserverList observers_; + base::WeakPtrFactory weak_factory_; + DISALLOW_COPY_AND_ASSIGN(WebContents); }; From 1ae0d41025dff75daa3f5beeb4ddec14234f30b2 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 17 Jun 2019 07:53:34 -0700 Subject: [PATCH 33/94] docs: better explain supported release line levels (#18800) (#18840) --- docs/tutorial/support.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/tutorial/support.md b/docs/tutorial/support.md index c2fb91963fdcd..9f49388d73d64 100644 --- a/docs/tutorial/support.md +++ b/docs/tutorial/support.md @@ -33,9 +33,26 @@ tools and resources. ## Supported Versions -The latest three release branches are supported by the Electron team. -For example, if the latest release is 2.0.x, then the 2-0-x series -is supported, as are the two previous release series 1-7-x and 1-8-x. +The latest three major versions are supported by the Electron team. +For example, if the latest release is 5.0.x, then the 4.x.y series +is supported, as are the two previous release series 3.x.y and 2.x.y. + +The latest stable release unilaterally receives all fixes from `master`, +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. + +All supported release lines will accept external pull requests to backport +fixes previously merged to `master`, though this may be on a case-by-case +basis for some older supported lines. All contested decisions around release +line backports will be resolved by the [Releases Working Group](https://github.com/electron/governance/tree/master/wg-releases) as an agenda item at their weekly meeting the week the backport PR is raised. + +### Currently supported versions +- 5.x +- 4.x +- 3.x + +### End-of-life When a release branch reaches the end of its support cycle, the series will be deprecated in NPM and a final end-of-support release will be From 690e94a329410babda80d9ca0dce1b5fdf9daaed Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 17 Jun 2019 18:59:02 +0200 Subject: [PATCH 34/94] fix: Uncaught TypeError: Cannot set property 'innerText' of null in default-app (#18818) --- default_app/renderer.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/default_app/renderer.js b/default_app/renderer.js index b971f9fb16e6f..3f58fe95d3eeb 100644 --- a/default_app/renderer.js +++ b/default_app/renderer.js @@ -26,11 +26,18 @@ function initialize () { link.addEventListener('auxclick', openLinkExternally) } - document.querySelector('.electron-version').innerText = `Electron v${process.versions.electron}` - document.querySelector('.chrome-version').innerText = `Chromium v${process.versions.chrome}` - document.querySelector('.node-version').innerText = `Node v${process.versions.node}` - document.querySelector('.v8-version').innerText = `v8 v${process.versions.v8}` - document.querySelector('.command-example').innerText = `${electronPath} path-to-app` + function replaceText (selector, text) { + const element = document.querySelector(selector) + if (element) { + element.innerText = text + } + } + + replaceText('.electron-version', `Electron v${process.versions.electron}`) + replaceText('.chrome-version', `Chromium v${process.versions.chrome}`) + replaceText('.node-version', `Node v${process.versions.node}`) + replaceText('.v8-version', `v8 v${process.versions.v8}`) + replaceText('.command-example', `${electronPath} path-to-app`) function getOcticonSvg (name) { const octiconPath = path.resolve(__dirname, 'node_modules', 'octicons', 'build', 'svg', `${name}.svg`) From 9e7390f12808d4d48800368ad242ea579b1909f0 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 17 Jun 2019 14:06:47 -0700 Subject: [PATCH 35/94] chore: update codeowners in 4 (#18836) --- .github/CODEOWNERS | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 537209d075d04..917df1968751a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,19 +3,24 @@ # https://help.github.com/articles/about-codeowners # https://git-scm.com/docs/gitignore -# Everything that falls through the cracks: -* @electron/reviewers +# Most stuff in here is owned by the Community & Safety WG... +/.github/* @electron/wg-community -# filename patterns -*browser_view* @electron/browserview -*notification* @electron/notifications -*pdf* @electron/printing -*printing* @electron/printing -*updater* @electron/updater +# ...except the Admin WG maintains this file. +/.github/CODEOWNERS @electron/wg-admin -# directories -/.github/ @electron/electrocats -/default_app/ @electron/docs -/docs/ @electron/docs -/docs-translations/ @electron/i18n -/npm/ @electron/electrocats \ No newline at end of file +# Upgrades WG +/patches/ @electron/wg-upgrades + +# Releases WG +/npm/ @electron/wg-releases +/script/release-notes @electron/wg-releases +/script/prepare-release.js @electron/wg-releases +/script/bump-version.js @electron/wg-releases +/script/ci-release-build.js @electron/wg-releases +/script/release.js @electron/wg-releases +/script/upload-to-github.js @electron/wg-releases +/script/release-artifact-cleanup.js @electron/wg-releases +/script/get-last-major-for-master.js @electron/wg-releases +/script/find-release.js @electron/wg-releases +/script/download-circleci-artifacts.js @electron/wg-releases \ No newline at end of file From a35b6d3fa858240fd5ca81dfc91a36cc70993a02 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Mon, 17 Jun 2019 18:09:16 -0700 Subject: [PATCH 36/94] fix: use effectiveAppearance to check dark mode on mojave and above (#18666) (#18853) * fix: use effectiveAppearance to check dark mode on mojave and above * chore: add forward declarations for dark appearance --- atom/browser/ui/tray_icon_cocoa.mm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/atom/browser/ui/tray_icon_cocoa.mm b/atom/browser/ui/tray_icon_cocoa.mm index e466a86c35da5..1513e28ea231b 100644 --- a/atom/browser/ui/tray_icon_cocoa.mm +++ b/atom/browser/ui/tray_icon_cocoa.mm @@ -4,8 +4,10 @@ #include "atom/browser/ui/tray_icon_cocoa.h" +#include "atom/browser/mac/atom_application.h" #include "atom/browser/ui/cocoa/NSString+ANSI.h" #include "atom/browser/ui/cocoa/atom_menu_controller.h" +#include "base/mac/sdk_forward_declarations.h" #include "base/strings/sys_string_conversions.h" #include "ui/display/screen.h" #include "ui/events/cocoa/cocoa_event_utils.h" @@ -143,6 +145,10 @@ - (void)drawRect:(NSRect)dirtyRect { } - (BOOL)isDarkMode { + if (@available(macOS 10.14, *)) { + return [[NSApplication sharedApplication].effectiveAppearance.name + isEqualToString:NSAppearanceNameDarkAqua]; + } NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; NSString* mode = [defaults stringForKey:@"AppleInterfaceStyle"]; return mode && [mode isEqualToString:@"Dark"]; @@ -322,9 +328,9 @@ - (void)mouseUp:(NSEvent*)event { - (void)popUpContextMenu:(atom::AtomMenuModel*)menu_model { // Show a custom menu. if (menu_model) { - base::scoped_nsobject menuController([ - [AtomMenuController alloc] initWithModel:menu_model - useDefaultAccelerator:NO]); + base::scoped_nsobject menuController( + [[AtomMenuController alloc] initWithModel:menu_model + useDefaultAccelerator:NO]); forceHighlight_ = YES; // Should highlight when showing menu. [self setNeedsDisplay:YES]; [statusItem_ popUpStatusItemMenu:[menuController menu]]; From 993b70ee9e6e6760593d630fbc3e8a1752706d18 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 18 Jun 2019 16:56:11 -0700 Subject: [PATCH 37/94] chore: improve current branch fetching (#18837) * chore: improve current branch fetching * chore: fix current branch fetch on master (#18844) --- script/lib/utils.js | 33 +++++++++++++++++++++++++++++- script/prepare-release.js | 18 +--------------- script/publish-to-npm.js | 20 +----------------- script/release-artifact-cleanup.js | 13 +----------- 4 files changed, 35 insertions(+), 49 deletions(-) diff --git a/script/lib/utils.js b/script/lib/utils.js index e5c864b0de9db..a958350a31b14 100644 --- a/script/lib/utils.js +++ b/script/lib/utils.js @@ -1,6 +1,10 @@ +const { GitProcess } = require('dugite') +const path = require('path') + const OUT_DIR = process.env.ELECTRON_OUT_DIR || 'Debug' -const path = require('path') +require('colors') +const fail = '\u2717'.red function getElectronExec () { switch (process.platform) { @@ -19,7 +23,34 @@ function getAbsoluteElectronExec () { return path.resolve(__dirname, '../../..', getElectronExec()) } +async function handleGitCall (args, gitDir) { + const details = await GitProcess.exec(args, gitDir) + if (details.exitCode === 0) { + const output = details.stdout.replace(/^\*|\s+|\s+$/, '') + return output.trim() + } else { + const error = GitProcess.parseError(details.stderr) + console.log(`${fail} couldn't parse git process call: `, error) + process.exit(1) + } +} + +async function getCurrentBranch (gitDir) { + let branch = await handleGitCall(['rev-parse', '--abbrev-ref', 'HEAD'], gitDir) + if (branch !== 'master' && !branch.match(/[0-9]+-[0-9]+-x/)) { + const lastCommit = await handleGitCall(['rev-parse', 'HEAD'], gitDir) + const branches = (await handleGitCall(['branch', '--contains', lastCommit], gitDir)).split('\n') + branch = branches.filter(b => b === 'master' || b.match(/[0-9]+-[0-9]+-x/))[0] + if (!branch) { + console.log(`${fail} no release branch exists for this ref`) + process.exit(1) + } + } + return branch +} + module.exports = { + getCurrentBranch, getElectronExec, getAbsoluteElectronExec, OUT_DIR diff --git a/script/prepare-release.js b/script/prepare-release.js index 37fa75237961e..199f458862595 100755 --- a/script/prepare-release.js +++ b/script/prepare-release.js @@ -14,6 +14,7 @@ const pass = '\u2713'.green const path = require('path') const readline = require('readline') const releaseNotesGenerator = require('./release-notes/index.js') +const { getCurrentBranch } = require('./lib/utils.js') const versionType = args._[0] const targetRepo = versionType === 'nightly' ? 'nightlies' : 'electron' @@ -53,23 +54,6 @@ async function getNewVersion (dryRun) { } } -async function getCurrentBranch (gitDir) { - console.log(`Determining current git branch`) - const gitArgs = ['rev-parse', '--abbrev-ref', 'HEAD'] - const branchDetails = await GitProcess.exec(gitArgs, gitDir) - if (branchDetails.exitCode === 0) { - const currentBranch = branchDetails.stdout.trim() - console.log(`${pass} Successfully determined current git branch is ` + - `${currentBranch}`) - return currentBranch - } else { - const error = GitProcess.parseError(branchDetails.stderr) - console.log(`${fail} Could not get details for the current branch, - error was ${branchDetails.stderr}`, error) - process.exit(1) - } -} - async function getReleaseNotes (currentBranch, newVersion) { if (versionType === 'nightly') { return 'Nightlies do not get release notes, please compare tags for info' diff --git a/script/publish-to-npm.js b/script/publish-to-npm.js index 7906501e9f137..f43b71f67cc62 100644 --- a/script/publish-to-npm.js +++ b/script/publish-to-npm.js @@ -2,8 +2,8 @@ const temp = require('temp') const fs = require('fs') const path = require('path') const childProcess = require('child_process') +const { getCurrentBranch } = require('./lib/utils.js') const GitHubApi = require('github') -const { GitProcess } = require('dugite') const request = require('request') const semver = require('semver') const rootPackageJson = require('../package.json') @@ -176,21 +176,3 @@ new Promise((resolve, reject) => { console.error(`Error: ${err}`) process.exit(1) }) - -async function getCurrentBranch () { - const gitDir = path.resolve(__dirname, '..') - console.log(`Determining current git branch`) - const gitArgs = ['rev-parse', '--abbrev-ref', 'HEAD'] - const branchDetails = await GitProcess.exec(gitArgs, gitDir) - if (branchDetails.exitCode === 0) { - const currentBranch = branchDetails.stdout.trim() - console.log(`Successfully determined current git branch is ` + - `${currentBranch}`) - return currentBranch - } else { - const error = GitProcess.parseError(branchDetails.stderr) - console.log(`Could not get details for the current branch, - error was ${branchDetails.stderr}`, error) - process.exit(1) - } -} diff --git a/script/release-artifact-cleanup.js b/script/release-artifact-cleanup.js index dfa340cc19d5b..41bde1988fbf6 100755 --- a/script/release-artifact-cleanup.js +++ b/script/release-artifact-cleanup.js @@ -10,6 +10,7 @@ const args = require('minimist')(process.argv.slice(2), { }) const { execSync } = require('child_process') const { GitProcess } = require('dugite') +const { getCurrentBranch } = require('./lib/utils.js') const GitHub = require('github') const path = require('path') @@ -27,18 +28,6 @@ function getLastBumpCommit (tag) { return JSON.parse(data) } -async function getCurrentBranch (gitDir) { - const gitArgs = ['rev-parse', '--abbrev-ref', 'HEAD'] - const branchDetails = await GitProcess.exec(gitArgs, gitDir) - if (branchDetails.exitCode === 0) { - return branchDetails.stdout.trim() - } - - const error = GitProcess.parseError(branchDetails.stderr) - console.error(`${fail} couldn't get current branch: `, error) - process.exit(1) -} - async function revertBumpCommit (tag) { const branch = await getCurrentBranch() const commitToRevert = getLastBumpCommit(tag).hash From 5d67ec3da5376a5058990e8a9557bc9124ad59a8 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 19 Jun 2019 11:06:58 -0700 Subject: [PATCH 38/94] Bump v4.2.5 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 74ecad8a34195..ad35fe0dbbc2f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.4 \ No newline at end of file +4.2.5 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 5a68987ba7d9d..0ff53d975b3d8 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.4 + 4.2.5 CFBundleShortVersionString - 4.2.4 + 4.2.5 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index f9ecc0b890de0..0097a837449a8 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,4,0 - PRODUCTVERSION 4,2,4,0 + FILEVERSION 4,2,5,0 + PRODUCTVERSION 4,2,5,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.4" + VALUE "FileVersion", "4.2.5" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.4" + VALUE "ProductVersion", "4.2.5" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index dbf5f4a208319..f5da4d385c119 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 4 +#define ATOM_PATCH_VERSION 5 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index 8efe856191c47..e6d8017a80462 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.4", + "version": "4.2.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index aafd0eaa34579..da8125382f86e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.4", + "version": "4.2.5", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 5f30c61c493b0d54526b08661ae11ca50247726e Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 20 Jun 2019 17:26:24 +0200 Subject: [PATCH 39/94] fix: set nativeWindowOpen when sandboxed (#18273) (#18797) --- atom/browser/atom_browser_client.cc | 5 ---- atom/browser/web_contents_preferences.cc | 14 ++++++++++ atom/browser/web_contents_preferences.h | 6 +++++ lib/browser/guest-view-manager.js | 7 +---- lib/browser/guest-window-manager.js | 2 +- spec/webview-spec.js | 34 +++++++++++++++--------- 6 files changed, 44 insertions(+), 24 deletions(-) diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index c67261d4466e1..ab1ab3270b1af 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -466,11 +466,6 @@ bool AtomBrowserClient::CanCreateWindow( int opener_render_process_id = opener->GetProcess()->GetID(); - if (IsRendererSandboxed(opener_render_process_id)) { - *no_javascript_access = false; - return true; - } - if (RendererUsesNativeWindowOpen(opener_render_process_id)) { if (RendererDisablesPopups(opener_render_process_id)) { // without allowpopups attribute should return diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index ec615dfaa7b26..bd9740c55c03c 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -136,6 +136,8 @@ WebContentsPreferences::WebContentsPreferences( #endif SetDefaultBoolIfUndefined(options::kOffscreen, false); + SetDefaults(); + last_preference_ = preference_.Clone(); } @@ -144,6 +146,12 @@ WebContentsPreferences::~WebContentsPreferences() { instances_.end()); } +void WebContentsPreferences::SetDefaults() { + if (IsEnabled(options::kSandbox)) { + SetBool(options::kNativeWindowOpen, true); + } +} + bool WebContentsPreferences::SetDefaultBoolIfUndefined( const base::StringPiece& key, bool val) { @@ -157,6 +165,10 @@ bool WebContentsPreferences::SetDefaultBoolIfUndefined( } } +void WebContentsPreferences::SetBool(const base::StringPiece& key, bool value) { + preference_.SetKey(key, base::Value(value)); +} + bool WebContentsPreferences::IsEnabled(const base::StringPiece& name, bool default_value) const { auto* current_value = @@ -169,6 +181,8 @@ bool WebContentsPreferences::IsEnabled(const base::StringPiece& name, void WebContentsPreferences::Merge(const base::DictionaryValue& extend) { if (preference_.is_dict()) static_cast(&preference_)->MergeDictionary(&extend); + + SetDefaults(); } void WebContentsPreferences::Clear() { diff --git a/atom/browser/web_contents_preferences.h b/atom/browser/web_contents_preferences.h index 2b6ebccbd5542..f353d07ec550b 100644 --- a/atom/browser/web_contents_preferences.h +++ b/atom/browser/web_contents_preferences.h @@ -36,6 +36,9 @@ class WebContentsPreferences const mate::Dictionary& web_preferences); ~WebContentsPreferences() override; + // Set WebPreferences defaults onto the JS object. + void SetDefaults(); + // A simple way to know whether a Boolean property is enabled. bool IsEnabled(const base::StringPiece& name, bool default_value = false) const; @@ -75,6 +78,9 @@ class WebContentsPreferences // Set preference value to given bool if user did not provide value bool SetDefaultBoolIfUndefined(const base::StringPiece& key, bool val); + // Set preference value to given bool + void SetBool(const base::StringPiece& key, bool value); + static std::vector instances_; content::WebContents* web_contents_; diff --git a/lib/browser/guest-view-manager.js b/lib/browser/guest-view-manager.js index d68211015e7f6..f4922575bd28d 100644 --- a/lib/browser/guest-view-manager.js +++ b/lib/browser/guest-view-manager.js @@ -118,7 +118,6 @@ const createGuest = function (embedder, params) { } this.loadURL(params.src, opts) } - guest.allowPopups = params.allowpopups embedder.emit('did-attach-webview', event, guest) }) @@ -220,6 +219,7 @@ const attachGuest = function (event, embedderFrameId, elementInstanceId, guestIn enableRemoteModule: params.enableremotemodule, plugins: params.plugins, zoomFactor: embedder._getZoomFactor(), + disablePopups: !params.allowpopups, webSecurity: !params.disablewebsecurity, enableBlinkFeatures: params.blinkfeatures, disableBlinkFeatures: params.disableblinkfeatures @@ -241,11 +241,6 @@ const attachGuest = function (event, embedderFrameId, elementInstanceId, guestIn webPreferences.preloadURL = params.preload } - // Return null from native window.open if allowpopups is unset - if (webPreferences.nativeWindowOpen === true && !params.allowpopups) { - webPreferences.disablePopups = true - } - // Security options that guest will always inherit from embedder const inheritedWebPreferences = new Map([ ['contextIsolation', true], diff --git a/lib/browser/guest-window-manager.js b/lib/browser/guest-window-manager.js index 6a71e94ce4101..0ca82839345c8 100644 --- a/lib/browser/guest-window-manager.js +++ b/lib/browser/guest-window-manager.js @@ -259,7 +259,7 @@ ipcMain.on('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', function (event options = mergeBrowserWindowOptions(event.sender, options) event.sender.emit('new-window', event, url, frameName, disposition, options, additionalFeatures, referrer) const { newGuest } = event - if ((event.sender.isGuest() && !event.sender.allowPopups) || event.defaultPrevented) { + if ((event.sender.isGuest() && event.sender.getLastWebPreferences().disablePopups) || event.defaultPrevented) { if (newGuest != null) { if (options.webContents === newGuest.webContents) { // the webContents is not changed, so set defaultPrevented to false to diff --git a/spec/webview-spec.js b/spec/webview-spec.js index 67e2464f9eea6..af8e52abcbec1 100644 --- a/spec/webview-spec.js +++ b/spec/webview-spec.js @@ -522,20 +522,30 @@ describe(' tag', function () { }) describe('allowpopups attribute', () => { - it('can not open new window when not set', async () => { - const message = await startLoadingWebViewAndWaitForMessage(webview, { - src: `file://${fixtures}/pages/window-open-hide.html` - }) - expect(message).to.equal('null') - }) + const generateSpecs = (description, webpreferences = '') => { + describe(description, () => { + it('can not open new window when not set', async () => { + const message = await startLoadingWebViewAndWaitForMessage(webview, { + webpreferences, + src: `file://${fixtures}/pages/window-open-hide.html` + }) + expect(message).to.equal('null') + }) - it('can open new window when set', async () => { - const message = await startLoadingWebViewAndWaitForMessage(webview, { - allowpopups: 'on', - src: `file://${fixtures}/pages/window-open-hide.html` + it('can open new window when set', async () => { + const message = await startLoadingWebViewAndWaitForMessage(webview, { + webpreferences, + allowpopups: 'on', + src: `file://${fixtures}/pages/window-open-hide.html` + }) + expect(message).to.equal('window') + }) }) - expect(message).to.equal('window') - }) + } + + generateSpecs('without sandbox') + generateSpecs('with sandbox', 'sandbox=yes') + generateSpecs('with nativeWindowOpen', 'nativeWindowOpen=yes') }) describe('webpreferences attribute', () => { From 140bd753ca8c0bb4c619548b3cbd5f9cfccdfb29 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 20 Jun 2019 13:08:35 -0700 Subject: [PATCH 40/94] chore: fix branch trimming for blast-off releases (#18906) --- script/lib/utils.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/script/lib/utils.js b/script/lib/utils.js index a958350a31b14..4324ad63b3dfb 100644 --- a/script/lib/utils.js +++ b/script/lib/utils.js @@ -26,8 +26,7 @@ function getAbsoluteElectronExec () { async function handleGitCall (args, gitDir) { const details = await GitProcess.exec(args, gitDir) if (details.exitCode === 0) { - const output = details.stdout.replace(/^\*|\s+|\s+$/, '') - return output.trim() + return details.stdout.replace(/^\*|\s+|\s+$/, '') } else { const error = GitProcess.parseError(details.stderr) console.log(`${fail} couldn't parse git process call: `, error) @@ -46,7 +45,7 @@ async function getCurrentBranch (gitDir) { process.exit(1) } } - return branch + return branch.trim() } module.exports = { From a24efe268d65305bb2c79b2fd74da982fc9dbc3c Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2019 14:00:16 -0700 Subject: [PATCH 41/94] chore: account for remotes in branch parsing (#18932) --- script/lib/utils.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/lib/utils.js b/script/lib/utils.js index 4324ad63b3dfb..7d38a89b37bd1 100644 --- a/script/lib/utils.js +++ b/script/lib/utils.js @@ -38,12 +38,19 @@ async function getCurrentBranch (gitDir) { let branch = await handleGitCall(['rev-parse', '--abbrev-ref', 'HEAD'], gitDir) if (branch !== 'master' && !branch.match(/[0-9]+-[0-9]+-x/)) { const lastCommit = await handleGitCall(['rev-parse', 'HEAD'], gitDir) - const branches = (await handleGitCall(['branch', '--contains', lastCommit], gitDir)).split('\n') + const branches = (await handleGitCall([ + 'branch', + '--contains', + lastCommit, + '--remote' + ], gitDir)).split('\n') + branch = branches.filter(b => b === 'master' || b.match(/[0-9]+-[0-9]+-x/))[0] if (!branch) { console.log(`${fail} no release branch exists for this ref`) process.exit(1) } + if (branch.startsWith('origin/')) branch = branch.substr('origin/'.length) } return branch.trim() } From 4c468a9efd609490b8d4f173e31360a5ad7bb9c0 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Fri, 21 Jun 2019 14:01:56 -0700 Subject: [PATCH 42/94] Bump very far --> this is electron bot fixing the release From 65c53cc4fa57e0675b53514b6bdb7f74d91230c8 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2019 15:00:53 -0700 Subject: [PATCH 43/94] refactor: session.{clearCache,getCacheSize} nws13n (#18921) --- atom/browser/api/atom_api_session.cc | 13 ++++++++++++- atom/browser/api/atom_api_session.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index f3ee77b9241b0..23e734afb9eb4 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -419,6 +419,17 @@ void Session::ResolveProxy( browser_context_->GetResolveProxyHelper()->ResolveProxy(url, callback); } +void Session::GetCacheSize(const net::CompletionCallback& callback) { + content::BrowserContext::GetDefaultStoragePartition(browser_context_.get()) + ->GetNetworkContext() + ->ComputeHttpCacheSize( + base::Time(), base::Time::Max(), + base::BindOnce( + [](const net::CompletionCallback& cb, bool is_upper_bound, + int64_t size_or_error) { cb.Run(size_or_error); }, + callback)); +} + template void Session::DoCacheAction(const net::CompletionCallback& callback) { BrowserThread::PostTask( @@ -747,7 +758,7 @@ void Session::BuildPrototype(v8::Isolate* isolate, mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate()) .MakeDestroyable() .SetMethod("resolveProxy", &Session::ResolveProxy) - .SetMethod("getCacheSize", &Session::DoCacheAction) + .SetMethod("getCacheSize", &Session::GetCacheSize) .SetMethod("clearCache", &Session::DoCacheAction) .SetMethod("clearStorageData", &Session::ClearStorageData) .SetMethod("flushStorageData", &Session::FlushStorageData) diff --git a/atom/browser/api/atom_api_session.h b/atom/browser/api/atom_api_session.h index 3a6216a031813..8b4eb06bfbc58 100644 --- a/atom/browser/api/atom_api_session.h +++ b/atom/browser/api/atom_api_session.h @@ -66,6 +66,7 @@ class Session : public mate::TrackableObject, const ResolveProxyHelper::ResolveProxyCallback& callback); template void DoCacheAction(const net::CompletionCallback& callback); + void GetCacheSize(const net::CompletionCallback& callback); void ClearStorageData(mate::Arguments* args); void FlushStorageData(); void SetProxy(const mate::Dictionary& options, const base::Closure& callback); From a568e13642369d94855497ae190fafce9ba6f126 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 24 Jun 2019 17:06:22 +0200 Subject: [PATCH 44/94] fix: app.getAppPath() returning default-app path for files or directories without package.json (#18763) (#18895) --- default_app/main.js | 6 +++-- spec/api-app-spec.js | 36 +++++++++++++++++++++++++ spec/fixtures/api/app-path/lib/index.js | 10 +++++++ spec/fixtures/api/app-path/package.json | 4 +++ 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 spec/fixtures/api/app-path/lib/index.js create mode 100644 spec/fixtures/api/app-path/package.json diff --git a/default_app/main.js b/default_app/main.js index 7dc7c847340f8..7a6e6eaa265b6 100644 --- a/default_app/main.js +++ b/default_app/main.js @@ -86,6 +86,7 @@ function loadApplicationPackage (packagePath) { // Override app name and version. packagePath = path.resolve(packagePath) const packageJsonPath = path.join(packagePath, 'package.json') + let appPath if (fs.existsSync(packageJsonPath)) { let packageJson try { @@ -105,11 +106,12 @@ function loadApplicationPackage (packagePath) { } app.setPath('userData', path.join(app.getPath('appData'), app.getName())) app.setPath('userCache', path.join(app.getPath('cache'), app.getName())) - app.setAppPath(packagePath) + appPath = packagePath } try { - Module._resolveFilename(packagePath, module, true) + const filePath = Module._resolveFilename(packagePath, module, true) + app.setAppPath(appPath || path.dirname(filePath)) } catch (e) { showErrorMessage(`Unable to find Electron app at ${packagePath}\n\n${e.message}`) return diff --git a/spec/api-app-spec.js b/spec/api-app-spec.js index 6be9e0bbd9d7b..34edc058a41af 100644 --- a/spec/api-app-spec.js +++ b/spec/api-app-spec.js @@ -6,6 +6,7 @@ const https = require('https') const net = require('net') const fs = require('fs') const path = require('path') +const cp = require('child_process') const { ipcRenderer, remote } = require('electron') const { emittedOnce } = require('./events-helpers') const { closeWindow } = require('./window-helpers') @@ -556,6 +557,28 @@ describe('app module', () => { }) }) + describe('getAppPath', () => { + it('works for directories with package.json', async () => { + const { appPath } = await runTestApp('app-path') + expect(appPath).to.equal(path.resolve(__dirname, 'fixtures/api/app-path')) + }) + + it('works for directories with index.js', async () => { + const { appPath } = await runTestApp('app-path/lib') + expect(appPath).to.equal(path.resolve(__dirname, 'fixtures/api/app-path/lib')) + }) + + it('works for files without extension', async () => { + const { appPath } = await runTestApp('app-path/lib/index') + expect(appPath).to.equal(path.resolve(__dirname, 'fixtures/api/app-path/lib')) + }) + + it('works for files', async () => { + const { appPath } = await runTestApp('app-path/lib/index.js') + expect(appPath).to.equal(path.resolve(__dirname, 'fixtures/api/app-path/lib')) + }) + }) + describe('getPath(name)', () => { it('returns paths that exist', () => { const paths = [ @@ -1125,3 +1148,16 @@ describe('app module', () => { }) }) }) + +async function runTestApp (name, ...args) { + const appPath = path.join(__dirname, 'fixtures', 'api', name) + const electronPath = remote.getGlobal('process').execPath + const appProcess = cp.spawn(electronPath, [appPath, ...args]) + + let output = '' + appProcess.stdout.on('data', (data) => { output += data }) + + await emittedOnce(appProcess.stdout, 'end') + + return JSON.parse(output) +} diff --git a/spec/fixtures/api/app-path/lib/index.js b/spec/fixtures/api/app-path/lib/index.js new file mode 100644 index 0000000000000..d1a5732edca51 --- /dev/null +++ b/spec/fixtures/api/app-path/lib/index.js @@ -0,0 +1,10 @@ +const { app } = require('electron') + +const payload = { + appPath: app.getAppPath() +} + +process.stdout.write(JSON.stringify(payload)) +process.stdout.end() + +process.exit() diff --git a/spec/fixtures/api/app-path/package.json b/spec/fixtures/api/app-path/package.json new file mode 100644 index 0000000000000..8f9e09dbdabb2 --- /dev/null +++ b/spec/fixtures/api/app-path/package.json @@ -0,0 +1,4 @@ +{ + "name": "app-path", + "main": "lib/index.js" +} From 52c76fcf110652a0c4476987a31cbfe5d81e015f Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2019 13:28:04 -0700 Subject: [PATCH 45/94] fix: make isDarkMode correctly detect dark mode in the auto setting on catalina (#18959) --- atom/browser/api/atom_api_system_preferences_mac.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/atom/browser/api/atom_api_system_preferences_mac.mm b/atom/browser/api/atom_api_system_preferences_mac.mm index 70e0287f6c324..75b24c2af71e6 100644 --- a/atom/browser/api/atom_api_system_preferences_mac.mm +++ b/atom/browser/api/atom_api_system_preferences_mac.mm @@ -439,6 +439,10 @@ AVMediaType ParseMediaType(const std::string& media_type) { } bool SystemPreferences::IsDarkMode() { + if (@available(macOS 10.14, *)) { + return [[NSApplication sharedApplication].effectiveAppearance.name + isEqualToString:NSAppearanceNameDarkAqua]; + } NSString* mode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"]; return [mode isEqualToString:@"Dark"]; From 8acf577efafa855c8e2d54b2197b5de372161123 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2019 13:28:10 -0700 Subject: [PATCH 46/94] fix: override the timers module impls to activate the uv loop (#18968) --- lib/common/init.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/common/init.js b/lib/common/init.js index a69d9627e0ea8..b5036448a0c02 100644 --- a/lib/common/init.js +++ b/lib/common/init.js @@ -30,16 +30,20 @@ function wrap (func, wrapper) { process.nextTick = wrapWithActivateUvLoop(process.nextTick) -global.setImmediate = wrapWithActivateUvLoop(timers.setImmediate) +global.setImmediate = timers.setImmediate = wrapWithActivateUvLoop(timers.setImmediate) global.clearImmediate = timers.clearImmediate +// setTimeout needs to update the polling timeout of the event loop, when +// called under Chromium's event loop the node's event loop won't get a chance +// to update the timeout, so we have to force the node's event loop to +// recalculate the timeout in browser process. +timers.setTimeout = wrapWithActivateUvLoop(timers.setTimeout) +timers.setInterval = wrapWithActivateUvLoop(timers.setInterval) + +// Only override the global setTimeout/setInterval impls in the browser process if (process.type === 'browser') { - // setTimeout needs to update the polling timeout of the event loop, when - // called under Chromium's event loop the node's event loop won't get a chance - // to update the timeout, so we have to force the node's event loop to - // recalculate the timeout in browser process. - global.setTimeout = wrapWithActivateUvLoop(timers.setTimeout) - global.setInterval = wrapWithActivateUvLoop(timers.setInterval) + global.setTimeout = timers.setTimeout + global.setInterval = timers.setInterval } if (process.platform === 'win32') { From b18a012bfdde2f8e15e1cf641958c45fcba95eac Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 26 Jun 2019 11:04:31 -0700 Subject: [PATCH 47/94] fix: On close trying to remove observer from an empty collection leads to an access violation (#15739) (#18992) --- atom/browser/api/atom_api_web_contents.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index af2303349d39c..4b4c15d2da524 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -293,7 +293,9 @@ class WebContents : public mate::TrackableObject, observers_.AddObserver(obs); } void RemoveObserver(ExtendedWebContentsObserver* obs) { - observers_.RemoveObserver(obs); + // Trying to remove from an empty collection leads to an access violation + if (observers_.might_have_observers()) + observers_.RemoveObserver(obs); } bool EmitNavigationEvent(const std::string& event, From 6a25f416e0879ff3bfafe3b5e0b10a6644f54e5d Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2019 16:24:08 +0900 Subject: [PATCH 48/94] fix: delay emitting screen events by a tick to avoid re-entrancy crash (#19024) --- atom/browser/api/atom_api_screen.cc | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/atom/browser/api/atom_api_screen.cc b/atom/browser/api/atom_api_screen.cc index 65a11eed0cce3..452757d0f1943 100644 --- a/atom/browser/api/atom_api_screen.cc +++ b/atom/browser/api/atom_api_screen.cc @@ -52,6 +52,19 @@ std::vector MetricsToArray(uint32_t metrics) { return array; } +void DelayEmit(Screen* screen, + const base::StringPiece& name, + const display::Display& display) { + screen->Emit(name, display); +} + +void DelayEmitWithMetrics(Screen* screen, + const base::StringPiece& name, + const display::Display& display, + const std::vector& metrics) { + screen->Emit(name, display, metrics); +} + } // namespace Screen::Screen(v8::Isolate* isolate, display::Screen* screen) @@ -101,16 +114,23 @@ static gfx::Rect DIPToScreenRect(atom::NativeWindow* window, #endif void Screen::OnDisplayAdded(const display::Display& new_display) { - Emit("display-added", new_display); + base::ThreadTaskRunnerHandle::Get()->PostNonNestableTask( + FROM_HERE, base::Bind(&DelayEmit, base::Unretained(this), "display-added", + new_display)); } void Screen::OnDisplayRemoved(const display::Display& old_display) { - Emit("display-removed", old_display); + base::ThreadTaskRunnerHandle::Get()->PostNonNestableTask( + FROM_HERE, base::Bind(&DelayEmit, base::Unretained(this), + "display-removed", old_display)); } void Screen::OnDisplayMetricsChanged(const display::Display& display, uint32_t changed_metrics) { - Emit("display-metrics-changed", display, MetricsToArray(changed_metrics)); + base::ThreadTaskRunnerHandle::Get()->PostNonNestableTask( + FROM_HERE, base::Bind(&DelayEmitWithMetrics, base::Unretained(this), + "display-metrics-changed", display, + MetricsToArray(changed_metrics))); } // static From e31e98d927b2dcbe562daf03d56a1b04823871ac Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2019 14:00:18 -0700 Subject: [PATCH 49/94] fix: make tray not block main process (#19035) --- atom/browser/ui/tray_icon_cocoa.h | 3 +++ atom/browser/ui/tray_icon_cocoa.mm | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/atom/browser/ui/tray_icon_cocoa.h b/atom/browser/ui/tray_icon_cocoa.h index 34ace850a79e7..535e19b0c6669 100644 --- a/atom/browser/ui/tray_icon_cocoa.h +++ b/atom/browser/ui/tray_icon_cocoa.h @@ -29,6 +29,7 @@ class TrayIconCocoa : public TrayIcon, public AtomMenuModel::Observer { void SetHighlightMode(TrayIcon::HighlightMode mode) override; void SetIgnoreDoubleClickEvents(bool ignore) override; bool GetIgnoreDoubleClickEvents() override; + void PopUpOnUI(AtomMenuModel* menu_model); void PopUpContextMenu(const gfx::Point& pos, AtomMenuModel* menu_model) override; void SetContextMenu(AtomMenuModel* menu_model) override; @@ -48,6 +49,8 @@ class TrayIconCocoa : public TrayIcon, public AtomMenuModel::Observer { // Used for unregistering observer. AtomMenuModel* menu_model_ = nullptr; // weak ref. + base::WeakPtrFactory weak_factory_; + DISALLOW_COPY_AND_ASSIGN(TrayIconCocoa); }; diff --git a/atom/browser/ui/tray_icon_cocoa.mm b/atom/browser/ui/tray_icon_cocoa.mm index 1513e28ea231b..bbcae719bf365 100644 --- a/atom/browser/ui/tray_icon_cocoa.mm +++ b/atom/browser/ui/tray_icon_cocoa.mm @@ -8,7 +8,11 @@ #include "atom/browser/ui/cocoa/NSString+ANSI.h" #include "atom/browser/ui/cocoa/atom_menu_controller.h" #include "base/mac/sdk_forward_declarations.h" +#include "base/message_loop/message_loop.h" #include "base/strings/sys_string_conversions.h" +#include "base/task/post_task.h" +#include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/browser_thread.h" #include "ui/display/screen.h" #include "ui/events/cocoa/cocoa_event_utils.h" #include "ui/gfx/image/image.h" @@ -326,6 +330,9 @@ - (void)mouseUp:(NSEvent*)event { } - (void)popUpContextMenu:(atom::AtomMenuModel*)menu_model { + // Make sure events can be pumped while the menu is up. + base::MessageLoopCurrent::ScopedNestableTaskAllower allow; + // Show a custom menu. if (menu_model) { base::scoped_nsobject menuController( @@ -333,6 +340,7 @@ - (void)popUpContextMenu:(atom::AtomMenuModel*)menu_model { useDefaultAccelerator:NO]); forceHighlight_ = YES; // Should highlight when showing menu. [self setNeedsDisplay:YES]; + [statusItem_ popUpStatusItemMenu:[menuController menu]]; forceHighlight_ = NO; [self setNeedsDisplay:YES]; @@ -340,8 +348,12 @@ - (void)popUpContextMenu:(atom::AtomMenuModel*)menu_model { } if (menuController_ && ![menuController_ isMenuOpen]) { + // Ensure the UI can update while the menu is fading out. + base::ScopedPumpMessagesInPrivateModes pump_private; + // Redraw the tray icon to show highlight if it is enabled. [self setNeedsDisplay:YES]; + [statusItem_ popUpStatusItemMenu:[menuController_ menu]]; // The popUpStatusItemMenu returns only after the showing menu is closed. // When it returns, we need to redraw the tray icon to not show highlight. @@ -439,7 +451,7 @@ - (BOOL)shouldHighlight { namespace atom { -TrayIconCocoa::TrayIconCocoa() { +TrayIconCocoa::TrayIconCocoa() : weak_factory_(this) { status_item_view_.reset([[StatusItemView alloc] initWithIcon:this]); } @@ -477,9 +489,16 @@ - (BOOL)shouldHighlight { return [status_item_view_ getIgnoreDoubleClickEvents]; } +void TrayIconCocoa::PopUpOnUI(AtomMenuModel* menu_model) { + [status_item_view_ popUpContextMenu:menu_model]; +} + void TrayIconCocoa::PopUpContextMenu(const gfx::Point& pos, AtomMenuModel* menu_model) { - [status_item_view_ popUpContextMenu:menu_model]; + base::PostTaskWithTraits( + FROM_HERE, {content::BrowserThread::UI}, + base::BindOnce(&TrayIconCocoa::PopUpOnUI, weak_factory_.GetWeakPtr(), + base::Unretained(menu_model))); } void TrayIconCocoa::SetContextMenu(AtomMenuModel* menu_model) { From dba476e18a1fcedf704603e13d85e021a4d69edd Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2019 11:47:30 -0400 Subject: [PATCH 50/94] ci: run lint on CircleCI (#19059) * ci: run lint on CircleCI * Fix lint errors --- .circleci/config.yml | 44 ++++++++++++++++++++++++++++++++++++++ .vsts/lint.yml | 31 --------------------------- docs/api/browser-window.md | 6 +++--- 3 files changed, 47 insertions(+), 34 deletions(-) delete mode 100644 .vsts/lint.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index d74a07aad67c0..63fea1ae4c8fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -490,6 +490,39 @@ step-maybe-generate-typescript-defs: &step-maybe-generate-typescript-defs fi # Lists of steps. +steps-lint: &steps-lint + steps: + - *step-checkout-electron + - run: + name: Setup third_party Depot Tools + command: | + # "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file. + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools + echo 'export PATH="$PATH:'"$PWD"'/src/third_party/depot_tools"' >> $BASH_ENV + - run: + name: Download GN Binary + command: | + chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)" + buildtools_revision="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep buildtools_revision -A1 | tr -d '\n' | cut -d\' -f4)" + + git clone https://chromium.googlesource.com/chromium/buildtools "buildtools" + (cd "buildtools" && git checkout "$buildtools_revision") + echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/buildtools"' >> $BASH_ENV + + download_from_google_storage --bucket chromium-gn -s "buildtools/linux64/gn.sha1" + - run: + name: Run Lint + command: | + # gn.py tries to find a gclient root folder starting from the current dir. + # When it fails and returns "None" path, the whole script fails. Let's "fix" it. + touch .gclient + # Another option would be to checkout "buildtools" inside the Electron checkout, + # but then we would lint its contents (at least gn format), and it doesn't pass it. + + cd src/electron + npm install + npm run lint + steps-checkout: &steps-checkout steps: - *step-checkout-electron @@ -776,6 +809,13 @@ chromium-upgrade-branches: &chromium-upgrade-branches # List of all jobs. version: 2 jobs: + # Layer 0: Lint. Standalone. + lint: + <<: *machine-linux-medium + environment: + <<: *env-linux-medium + <<: *steps-lint + # Layer 1: Checkout. linux-checkout: <<: *machine-linux-2xlarge @@ -1300,6 +1340,10 @@ jobs: workflows: version: 2 + lint: + jobs: + - lint + build-linux: jobs: - linux-checkout diff --git a/.vsts/lint.yml b/.vsts/lint.yml deleted file mode 100644 index 780c96cad703c..0000000000000 --- a/.vsts/lint.yml +++ /dev/null @@ -1,31 +0,0 @@ -pool: - vmImage: 'Ubuntu 16.04' - -steps: -- bash: | - # "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file. - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git "${AGENT_BUILDDIRECTORY}/third_party/depot_tools" - echo "##vso[task.setvariable variable=PATH]$PATH:${AGENT_BUILDDIRECTORY}/third_party/depot_tools" - displayName: Setup Depot Tools - -- bash: | - chromium_revision="$(grep -A1 chromium_version DEPS | tr -d '\n' | cut -d\' -f4)" - buildtools_revision="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep buildtools_revision -A1 | tr -d '\n' | cut -d\' -f4)" - - git clone https://chromium.googlesource.com/chromium/buildtools "${AGENT_TEMPDIRECTORY}/buildtools" - (cd "${AGENT_TEMPDIRECTORY}/buildtools" && git checkout "$buildtools_revision") - echo "##vso[task.setvariable variable=CHROMIUM_BUILDTOOLS_PATH]$AGENT_TEMPDIRECTORY/buildtools" - - download_from_google_storage --bucket chromium-gn -s "${AGENT_TEMPDIRECTORY}/buildtools/linux64/gn.sha1" - displayName: Download gn binary - -- bash: | - # gn.py tries to find a gclient root folder starting from the current dir. - # When it fails and returns "None" path, the whole script fails. Let's "fix" it. - touch .gclient - # Another option would be to checkout "buildtools" inside the Electron checkout, - # but then we would lint its contents (at least gn format), and it doesn't pass it. - - npm install - npm run lint - displayName: Run Lint diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 91707ba853715..466ebc40540d9 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -903,11 +903,11 @@ Resizes and moves the window to the supplied bounds. Any properties that are not ```javascript const { BrowserWindow } = require('electron') const win = new BrowserWindow() - // set all bounds properties +// set all bounds properties win.setBounds({ x: 440, y: 225, width: 800, height: 600 }) - // set a single bounds property +// set a single bounds property win.setBounds({ width: 200 }) - // { x: 440, y: 225, width: 200, height: 600 } +// { x: 440, y: 225, width: 200, height: 600 } console.log(win.getBounds()) ``` From 21b7dc2717c70b4b1624aad5e5f5e6624546d29b Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 1 Jul 2019 08:55:40 -0700 Subject: [PATCH 51/94] Bump v4.2.6 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index ad35fe0dbbc2f..0ce756d2fdde9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.5 \ No newline at end of file +4.2.6 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 0ff53d975b3d8..0e2fc8232c249 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.5 + 4.2.6 CFBundleShortVersionString - 4.2.5 + 4.2.6 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 0097a837449a8..abb458dade3b4 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,5,0 - PRODUCTVERSION 4,2,5,0 + FILEVERSION 4,2,6,0 + PRODUCTVERSION 4,2,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.5" + VALUE "FileVersion", "4.2.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.5" + VALUE "ProductVersion", "4.2.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index f5da4d385c119..4044d49da792d 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 5 +#define ATOM_PATCH_VERSION 6 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index e6d8017a80462..0a66850448546 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.5", + "version": "4.2.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index da8125382f86e..7fdfef41a7203 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.5", + "version": "4.2.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 1826bbb6842b16a8cb0d1a00c5ad11d150478fc9 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 1 Jul 2019 14:06:09 -0700 Subject: [PATCH 52/94] fix: post_task include (#19064) --- atom/browser/ui/tray_icon_cocoa.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/atom/browser/ui/tray_icon_cocoa.mm b/atom/browser/ui/tray_icon_cocoa.mm index bbcae719bf365..6ef526c6d2cea 100644 --- a/atom/browser/ui/tray_icon_cocoa.mm +++ b/atom/browser/ui/tray_icon_cocoa.mm @@ -10,8 +10,7 @@ #include "base/mac/sdk_forward_declarations.h" #include "base/message_loop/message_loop.h" #include "base/strings/sys_string_conversions.h" -#include "base/task/post_task.h" -#include "content/public/browser/browser_task_traits.h" +#include "base/task_scheduler/post_task.h" #include "content/public/browser/browser_thread.h" #include "ui/display/screen.h" #include "ui/events/cocoa/cocoa_event_utils.h" @@ -495,8 +494,8 @@ - (BOOL)shouldHighlight { void TrayIconCocoa::PopUpContextMenu(const gfx::Point& pos, AtomMenuModel* menu_model) { - base::PostTaskWithTraits( - FROM_HERE, {content::BrowserThread::UI}, + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, base::BindOnce(&TrayIconCocoa::PopUpOnUI, weak_factory_.GetWeakPtr(), base::Unretained(menu_model))); } From 188a92970b4c71045a8f7765af0fe5af327a4436 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 1 Jul 2019 14:07:57 -0700 Subject: [PATCH 53/94] Bump v4.2.7 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 0ce756d2fdde9..c30a8151be197 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.6 \ No newline at end of file +4.2.7 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 0e2fc8232c249..be8ff2e283321 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.6 + 4.2.7 CFBundleShortVersionString - 4.2.6 + 4.2.7 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index abb458dade3b4..8bb37d2f1a375 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,6,0 - PRODUCTVERSION 4,2,6,0 + FILEVERSION 4,2,7,0 + PRODUCTVERSION 4,2,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.6" + VALUE "FileVersion", "4.2.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.6" + VALUE "ProductVersion", "4.2.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 4044d49da792d..fc86b661fb781 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 7 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index 0a66850448546..a993f3d507557 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.6", + "version": "4.2.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7fdfef41a7203..45fbecf6e282f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.6", + "version": "4.2.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 4775c8ec7b563ffeeefb9cd75d177e3fb196bcde Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 1 Jul 2019 14:15:12 -0700 Subject: [PATCH 54/94] Revert "Bump v4.2.7" This reverts commit 188a92970b4c71045a8f7765af0fe5af327a4436. --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index c30a8151be197..0ce756d2fdde9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.7 \ No newline at end of file +4.2.6 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index be8ff2e283321..0e2fc8232c249 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.7 + 4.2.6 CFBundleShortVersionString - 4.2.7 + 4.2.6 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 8bb37d2f1a375..abb458dade3b4 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,7,0 - PRODUCTVERSION 4,2,7,0 + FILEVERSION 4,2,6,0 + PRODUCTVERSION 4,2,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.7" + VALUE "FileVersion", "4.2.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.7" + VALUE "ProductVersion", "4.2.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index fc86b661fb781..4044d49da792d 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 7 +#define ATOM_PATCH_VERSION 6 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index a993f3d507557..0a66850448546 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.7", + "version": "4.2.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 45fbecf6e282f..7fdfef41a7203 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.7", + "version": "4.2.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 71cd22605e0a4108b1945607bce591f7833f8510 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 1 Jul 2019 14:15:39 -0700 Subject: [PATCH 55/94] Revert "Bump v4.2.6" This reverts commit 21b7dc2717c70b4b1624aad5e5f5e6624546d29b. --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 0ce756d2fdde9..ad35fe0dbbc2f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.6 \ No newline at end of file +4.2.5 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 0e2fc8232c249..0ff53d975b3d8 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.6 + 4.2.5 CFBundleShortVersionString - 4.2.6 + 4.2.5 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index abb458dade3b4..0097a837449a8 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,6,0 - PRODUCTVERSION 4,2,6,0 + FILEVERSION 4,2,5,0 + PRODUCTVERSION 4,2,5,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.6" + VALUE "FileVersion", "4.2.5" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.6" + VALUE "ProductVersion", "4.2.5" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 4044d49da792d..f5da4d385c119 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 5 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index 0a66850448546..e6d8017a80462 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.6", + "version": "4.2.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7fdfef41a7203..da8125382f86e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.6", + "version": "4.2.5", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From bd6a3dd79b2f9a6c63b45503feaca03df08faf52 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 1 Jul 2019 14:24:47 -0700 Subject: [PATCH 56/94] Bump v4.2.6 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index ad35fe0dbbc2f..0ce756d2fdde9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.5 \ No newline at end of file +4.2.6 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 0ff53d975b3d8..0e2fc8232c249 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.5 + 4.2.6 CFBundleShortVersionString - 4.2.5 + 4.2.6 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 0097a837449a8..abb458dade3b4 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,5,0 - PRODUCTVERSION 4,2,5,0 + FILEVERSION 4,2,6,0 + PRODUCTVERSION 4,2,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.5" + VALUE "FileVersion", "4.2.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.5" + VALUE "ProductVersion", "4.2.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index f5da4d385c119..4044d49da792d 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 5 +#define ATOM_PATCH_VERSION 6 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index e6d8017a80462..0a66850448546 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.5", + "version": "4.2.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index da8125382f86e..7fdfef41a7203 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.5", + "version": "4.2.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From b98e06e38e8be4409d015cb5701e34a90b6ab97c Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2019 15:22:18 -0700 Subject: [PATCH 57/94] docs: fix heading level for power-monitor docs (#19060) --- docs/api/power-monitor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/power-monitor.md b/docs/api/power-monitor.md index 95d9e025e8578..e2de913e88112 100644 --- a/docs/api/power-monitor.md +++ b/docs/api/power-monitor.md @@ -59,7 +59,7 @@ Emitted as soon as the systems screen is unlocked. The `powerMonitor` module has the following methods: -#### `powerMonitor.querySystemIdleState(idleThreshold, callback)` +### `powerMonitor.querySystemIdleState(idleThreshold, callback)` * `idleThreshold` Integer * `callback` Function @@ -70,7 +70,7 @@ before considered idle. `callback` will be called synchronously on some systems and with an `idleState` argument that describes the system's state. `locked` is available on supported systems only. -#### `powerMonitor.querySystemIdleTime(callback)` +### `powerMonitor.querySystemIdleTime(callback)` * `callback` Function * `idleTime` Integer - Idle time in seconds From b9605cc602fed360fd9bf742dc4ec8af13769afa Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2019 18:26:59 -0700 Subject: [PATCH 58/94] fix: Correct modal focus behavior on macOS (#19061) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip: wish i could hack the main window focus away * main -> key * remove useless code * test: Add focus event spec * test: more robust spec * test: simplify test * duplicate non-firing macOS event listener 😳 * destroy 🚨 * chore: remove unused variable --- .../ui/cocoa/atom_ns_window_delegate.mm | 4 +-- spec/api-browser-window-spec.js | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/atom/browser/ui/cocoa/atom_ns_window_delegate.mm b/atom/browser/ui/cocoa/atom_ns_window_delegate.mm index b96316a3ee753..8b1d83aef8cd5 100644 --- a/atom/browser/ui/cocoa/atom_ns_window_delegate.mm +++ b/atom/browser/ui/cocoa/atom_ns_window_delegate.mm @@ -83,11 +83,11 @@ - (NSRect)windowWillUseStandardFrame:(NSWindow*)window return frame; } -- (void)windowDidBecomeMain:(NSNotification*)notification { +- (void)windowDidBecomeKey:(NSNotification*)notification { shell_->NotifyWindowFocus(); } -- (void)windowDidResignMain:(NSNotification*)notification { +- (void)windowDidResignKey:(NSNotification*)notification { shell_->NotifyWindowBlur(); } diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 540a197b4eb6e..d309ad0253753 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -2330,6 +2330,33 @@ describe('BrowserWindow module', () => { }) }) + describe('focus event', () => { + it('should not emit if focusing on a main window with a modal open', (done) => { + const child = new BrowserWindow({ + parent: w, + modal: true, + show: false + }) + + child.once('ready-to-show', () => { + child.show() + }) + + child.on('show', () => { + w.once('focus', () => { + expect(child.isDestroyed()).to.equal(true) + done() + }) + w.focus() // this should not trigger the above listener + child.close() + }) + + // act + child.loadURL(server.url) + w.show() + }) + }) + describe('sheet-begin event', () => { let sheet = null From 5bf76ea01ab5366758acc823981332aaded19dbf Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2019 09:43:32 +0900 Subject: [PATCH 59/94] fix: check parent-child relationship in canAccessWindow (#19116) --- lib/browser/guest-window-manager.js | 31 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/lib/browser/guest-window-manager.js b/lib/browser/guest-window-manager.js index 0ca82839345c8..2b238dd7d2fa1 100644 --- a/lib/browser/guest-window-manager.js +++ b/lib/browser/guest-window-manager.js @@ -171,20 +171,27 @@ const getGuestWindow = function (guestContents) { return guestWindow } +const isChildWindow = function (sender, target) { + return target.getLastWebPreferences().openerId === sender.id +} + +const isRelatedWindow = function (sender, target) { + return isChildWindow(sender, target) || isChildWindow(target, sender) +} + +const isScriptableWindow = function (sender, target) { + return isRelatedWindow(sender, target) && isSameOrigin(sender.getURL(), target.getURL()) +} + +const isNodeIntegrationEnabled = function (sender) { + return sender.getLastWebPreferences().nodeIntegration === true +} + // Checks whether |sender| can access the |target|: -// 1. Check whether |sender| is the parent of |target|. -// 2. Check whether |sender| has node integration, if so it is allowed to -// do anything it wants. -// 3. Check whether the origins match. -// -// However it allows a child window without node integration but with same -// origin to do anything it wants, when its opener window has node integration. -// The W3C does not have anything on this, but from my understanding of the -// security model of |window.opener|, this should be fine. const canAccessWindow = function (sender, target) { - return (target.getLastWebPreferences().openerId === sender.id) || - (sender.getLastWebPreferences().nodeIntegration === true) || - isSameOrigin(sender.getURL(), target.getURL()) + return isChildWindow(sender, target) || + isScriptableWindow(sender, target) || + isNodeIntegrationEnabled(sender) } // Routed window.open messages with raw options From 47f5fe64116a520cb6f65d731251ccc628f63465 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Mon, 8 Jul 2019 17:46:46 -0700 Subject: [PATCH 60/94] fix: dump correct breakpad symbols on macOS (#19158) --- .circleci/config.yml | 16 +-- BUILD.gn | 116 ++++++++++++++++++++- appveyor.yml | 5 +- build/dump_syms.py | 52 ++++++++++ build/extract_symbols.gni | 55 ++++++++++ script/dump-symbols.py | 98 ------------------ tools/win/generate_breakpad_symbols.py | 138 ------------------------- 7 files changed, 226 insertions(+), 254 deletions(-) create mode 100644 build/dump_syms.py create mode 100644 build/extract_symbols.gni delete mode 100755 script/dump-symbols.py delete mode 100755 tools/win/generate_breakpad_symbols.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 63fea1ae4c8fe..bb44e00a168f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -401,25 +401,13 @@ step-mksnapshot-store: &step-mksnapshot-store path: src/out/Default/mksnapshot.zip destination: mksnapshot.zip -step-maybe-build-dump-syms: &step-maybe-build-dump-syms - run: - name: Build dump_syms binary - command: | - if [ "$GENERATE_SYMBOLS" == "true" ]; then - cd src - # Build needed dump_syms executable - ninja -C out/Default third_party/breakpad:dump_syms - fi - step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols run: name: Generate breakpad symbols command: | if [ "$GENERATE_SYMBOLS" == "true" ]; then cd src - export BUILD_PATH="$PWD/out/Default" - export DEST_PATH="$BUILD_PATH/breakpad_symbols" - electron/script/dump-symbols.py -b $BUILD_PATH -d $DEST_PATH -v + ninja -C out/Default electron:electron_symbols fi step-maybe-zip-symbols: &step-maybe-zip-symbols @@ -627,7 +615,6 @@ steps-electron-build-for-tests: &steps-electron-build-for-tests # Save all data needed for a further tests run. - *step-persist-data-for-tests - - *step-maybe-build-dump-syms - *step-maybe-generate-breakpad-symbols - *step-maybe-zip-symbols @@ -652,7 +639,6 @@ steps-electron-build-for-publish: &steps-electron-build-for-publish - *step-maybe-electron-dist-strip - *step-electron-dist-build - *step-electron-dist-store - - *step-maybe-build-dump-syms - *step-maybe-generate-breakpad-symbols - *step-maybe-zip-symbols diff --git a/BUILD.gn b/BUILD.gn index ef8248c898bda..95726c12d3565 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -13,6 +13,7 @@ import("//tools/grit/grit_rule.gni") import("//tools/grit/repack.gni") import("//tools/v8_context_snapshot/v8_context_snapshot.gni") import("//v8/snapshot_toolchain.gni") +import("build/extract_symbols.gni") if (is_mac) { import("//build/config/mac/rules.gni") @@ -478,6 +479,7 @@ if (is_mac) { electron_helper_name = "$electron_product_name Helper" electron_login_helper_name = "$electron_product_name Login Helper" electron_framework_version = "A" + electron_version = read_file("VERSION", "trim string") mac_xib_bundle_data("electron_xibs") { sources = [ @@ -560,7 +562,6 @@ if (is_mac) { } info_plist = "atom/common/resources/mac/Info.plist" - electron_version = read_file("VERSION", "trim string") extra_substitutions = [ "ATOM_BUNDLE_ID=$electron_mac_bundle_id.framework", "ELECTRON_VERSION=$electron_version", @@ -716,6 +717,76 @@ if (is_mac) { "@executable_path/../Frameworks", ] } + + if (enable_dsyms) { + extract_symbols("electron_framework_syms") { + binary = "$root_out_dir/$electron_framework_name.framework/Versions/$electron_framework_version/$electron_framework_name" + symbol_dir = "$root_out_dir/breakpad_symbols" + dsym_file = "$root_out_dir/$electron_framework_name.dSYM/Contents/Resources/DWARF/$electron_framework_name" + deps = [ + ":electron_framework", + ] + } + + extract_symbols("electron_helper_syms") { + binary = "$root_out_dir/$electron_helper_name.app/Contents/MacOS/$electron_helper_name" + symbol_dir = "$root_out_dir/breakpad_symbols" + dsym_file = "$root_out_dir/$electron_helper_name.dSYM/Contents/Resources/DWARF/$electron_helper_name" + deps = [ + ":electron_helper_app", + ] + } + + extract_symbols("electron_app_syms") { + binary = "$root_out_dir/$electron_product_name.app/Contents/MacOS/$electron_product_name" + symbol_dir = "$root_out_dir/breakpad_symbols" + dsym_file = "$root_out_dir/$electron_product_name.dSYM/Contents/Resources/DWARF/$electron_product_name" + deps = [ + ":electron_app", + ] + } + + extract_symbols("swiftshader_egl_syms") { + binary = "$root_out_dir/libswiftshader_libEGL.dylib" + symbol_dir = "$root_out_dir/breakpad_symbols" + dsym_file = "$root_out_dir/libswiftshader_libEGL.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libEGL.dylib" + deps = [ + "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL", + ] + } + + extract_symbols("swiftshader_gles_syms") { + binary = "$root_out_dir/libswiftshader_libGLESv2.dylib" + symbol_dir = "$root_out_dir/breakpad_symbols" + dsym_file = "$root_out_dir/libswiftshader_libGLESv2.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libGLESv2.dylib" + deps = [ + "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2", + ] + } + + extract_symbols("crashpad_handler_syms") { + binary = "$root_out_dir/crashpad_handler" + symbol_dir = "$root_out_dir/breakpad_symbols" + dsym_file = "$root_out_dir/crashpad_handler.dSYM/Contents/Resources/DWARF/crashpad_handler" + deps = [ + "//third_party/crashpad/crashpad/handler:crashpad_handler", + ] + } + + group("electron_symbols") { + deps = [ + ":crashpad_handler_syms", + ":electron_app_syms", + ":electron_framework_syms", + ":electron_helper_syms", + ":swiftshader_egl_syms", + ":swiftshader_gles_syms", + ] + } + } else { + group("electron_symbols") { + } + } } else { windows_manifest("electron_app_manifest") { sources = [ @@ -813,6 +884,49 @@ if (is_mac) { } } } + + if (is_official_build) { + if (is_linux) { + _target_executable_suffix = "" + _target_shared_library_suffix = ".so" + } else if (is_win) { + _target_executable_suffix = ".exe" + _target_shared_library_suffix = ".dll" + } + + extract_symbols("electron_app_symbols") { + binary = "$root_out_dir/$electron_project_name$_target_executable_suffix" + symbol_dir = "$root_out_dir/breakpad_symbols" + deps = [ + ":electron_app", + ] + } + + extract_symbols("swiftshader_egl_symbols") { + binary = "$root_out_dir/swiftshader/libEGL$_target_shared_library_suffix" + symbol_dir = "$root_out_dir/breakpad_symbols" + deps = [ + "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL", + ] + } + + extract_symbols("swiftshader_gles_symbols") { + binary = + "$root_out_dir/swiftshader/libGLESv2$_target_shared_library_suffix" + symbol_dir = "$root_out_dir/breakpad_symbols" + deps = [ + "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2", + ] + } + + group("electron_symbols") { + deps = [ + ":electron_app_symbols", + ":swiftshader_egl_symbols", + ":swiftshader_gles_symbols", + ] + } + } } group("electron_tests") { diff --git a/appveyor.yml b/appveyor.yml index aa458bd76fa5e..ac6604bb64b69 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -68,9 +68,10 @@ build_script: - appveyor PushArtifact out/ffmpeg/ffmpeg.zip - ps: >- if ($env:GN_CONFIG -eq 'release') { - ninja -C out/Default third_party/breakpad:dump_syms + # Needed for msdia140.dll on 64-bit windows + $env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin" + ninja -C out/Default electron:electron_symbols } - - if "%GN_CONFIG%"=="release" ( python electron\script\dump-symbols.py -d %cd%\out\Default\breakpad_symbols -v) - ps: >- if ($env:GN_CONFIG -eq 'release') { python electron\script\zip-symbols.py diff --git a/build/dump_syms.py b/build/dump_syms.py new file mode 100644 index 0000000000000..eb9a9b5834176 --- /dev/null +++ b/build/dump_syms.py @@ -0,0 +1,52 @@ +from __future__ import print_function + +import collections +import os +import subprocess +import sys +import errno + +# The BINARY_INFO tuple describes a binary as dump_syms identifies it. +BINARY_INFO = collections.namedtuple('BINARY_INFO', + ['platform', 'arch', 'hash', 'name']) + +def get_module_info(header_info): + # header info is of the form "MODULE $PLATFORM $ARCH $HASH $BINARY" + info_split = header_info.strip().split(' ', 4) + if len(info_split) != 5 or info_split[0] != 'MODULE': + return None + return BINARY_INFO(*info_split[1:]) + +def get_symbol_path(symbol_data): + module_info = get_module_info(symbol_data[:symbol_data.index('\n')]) + if not module_info: + raise Exception("Couldn't get module info for binary '{}'".format(binary)) + return os.path.join(module_info.name, module_info.hash, module_info.name + ".sym") + +def mkdir_p(path): + """Simulates mkdir -p.""" + try: + os.makedirs(path) + except OSError as e: + if e.errno == errno.EEXIST and os.path.isdir(path): + pass + else: raise + +def main(dump_syms, binary, out_dir, stamp_file, dsym_file=None): + args = [dump_syms] + if dsym_file: + args += ["-g", dsym_file] + args += [binary] + + symbol_data = subprocess.check_output(args) + symbol_path = os.path.join(out_dir, get_symbol_path(symbol_data)) + mkdir_p(os.path.dirname(symbol_path)) + + with open(symbol_path, 'w') as out: + out.write(symbol_data) + + with open(stamp_file, 'w'): + pass + +if __name__ == '__main__': + main(*sys.argv[1:]) diff --git a/build/extract_symbols.gni b/build/extract_symbols.gni new file mode 100644 index 0000000000000..cd3a9f2cfd0a3 --- /dev/null +++ b/build/extract_symbols.gni @@ -0,0 +1,55 @@ +import("//build/toolchain/toolchain.gni") + +# Extracts symbols from a binary into a symbol file using dump_syms. +# +# Args: +# binary: Path to the binary containing symbols to extract, e.g.: +# "$root_out_dir/electron" +# symbol_dir: Desired output directory for symbols, e.g.: +# "$root_out_dir/breakpad_symbols" + +if (host_os == "win") { + _host_executable_suffix = ".exe" +} else { + _host_executable_suffix = "" +} + +template("extract_symbols") { + action(target_name) { + forward_variables_from(invoker, + [ + "deps", + "testonly", + ]) + assert(defined(invoker.binary), "Need binary to dump") + assert(defined(invoker.symbol_dir), "Need directory for symbol output") + + dump_syms_label = "//third_party/breakpad:dump_syms($host_toolchain)" + dump_syms_binary = get_label_info(dump_syms_label, "root_out_dir") + + "/dump_syms$_host_executable_suffix" + + script = "//electron/build/dump_syms.py" + inputs = [ + invoker.binary, + dump_syms_binary, + ] + stamp_file = "${target_gen_dir}/${target_name}.stamp" + outputs = [ + stamp_file, + ] + args = [ + "./" + rebase_path(dump_syms_binary, root_build_dir), + rebase_path(invoker.binary, root_build_dir), + rebase_path(invoker.symbol_dir, root_build_dir), + rebase_path(stamp_file, root_build_dir), + ] + if (defined(invoker.dsym_file)) { + args += [ rebase_path(invoker.dsym_file, root_build_dir) ] + } + + if (!defined(deps)) { + deps = [] + } + deps += [ dump_syms_label ] + } +} diff --git a/script/dump-symbols.py b/script/dump-symbols.py deleted file mode 100755 index cb9f4cefeb931..0000000000000 --- a/script/dump-symbols.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python - -import argparse -import os -import sys - -from lib.config import PLATFORM, enable_verbose_mode, is_verbose_mode -from lib.util import get_electron_branding, execute, rm_rf, get_out_dir, \ - SRC_DIR - -ELECTRON_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) -SOURCE_ROOT = os.path.abspath(os.path.dirname(ELECTRON_ROOT)) -RELEASE_PATH = get_out_dir() - -def main(): - args = parse_args() - if args.verbose: - enable_verbose_mode() - rm_rf(args.destination) - source_root = os.path.abspath(args.source_root) - build_path = os.path.join(source_root, args.build_dir) - (project_name, product_name) = get_names_from_branding() - - if PLATFORM in ['darwin', 'linux']: - - if PLATFORM == 'darwin': - #macOS has an additional helper app; provide the path to that binary also - main_app = os.path.join(build_path, '{0}.app'.format(product_name), - 'Contents', 'MacOS', product_name) - helper_name = product_name + " Helper" - helper_app = os.path.join(build_path, '{0}.app'.format(helper_name), - 'Contents', 'MacOS', product_name + " Helper") - binaries = [main_app, helper_app] - for binary in binaries: - generate_posix_symbols(binary, source_root, build_path, - args.destination) - else: - binary = os.path.join(build_path, project_name) - generate_posix_symbols(binary, source_root, build_path, - args.destination) - - else: - generate_breakpad_symbols = os.path.join(ELECTRON_ROOT, 'tools', 'win', - 'generate_breakpad_symbols.py') - args = [ - '--symbols-dir={0}'.format(args.destination), - '--jobs=16', - os.path.relpath(build_path), - ] - if is_verbose_mode(): - args += ['-v'] - #Make sure msdia140.dll is in the path (needed for dump_syms.exe) - env = os.environ.copy() - msdia140_dll_path = os.path.join(SRC_DIR, 'third_party', 'llvm-build', - 'Release+Asserts', 'bin') - env['PATH'] = os.path.pathsep.join( - [env.get('PATH', '')] + [msdia140_dll_path]) - execute([sys.executable, generate_breakpad_symbols] + args, env) - -def get_names_from_branding(): - variables = get_electron_branding() - return (variables['project_name'], variables['product_name']) - -def generate_posix_symbols(binary, source_root, build_dir, destination): - generate_breakpad_symbols = os.path.join(source_root, 'components', 'crash', - 'content', 'tools', - 'generate_breakpad_symbols.py') - args = [ - '--build-dir={0}'.format(build_dir), - '--symbols-dir={0}'.format(destination), - '--jobs=16', - '--binary={0}'.format(binary), - ] - if is_verbose_mode(): - args += ['--verbose'] - execute([sys.executable, generate_breakpad_symbols] + args) - -def parse_args(): - parser = argparse.ArgumentParser(description='Create breakpad symbols') - parser.add_argument('-b', '--build-dir', - help='Path to an Electron build folder.', - default=RELEASE_PATH, - required=False) - parser.add_argument('-d', '--destination', - help='Path to save symbols to.', - default=None, - required=True) - parser.add_argument('-s', '--source-root', - help='Path to the src folder.', - default=SOURCE_ROOT, - required=False) - parser.add_argument('-v', '--verbose', - action='store_true', - help='Prints the output of the subprocesses') - return parser.parse_args() - -if __name__ == '__main__': - sys.exit(main()) diff --git a/tools/win/generate_breakpad_symbols.py b/tools/win/generate_breakpad_symbols.py deleted file mode 100755 index 9ed970dbffe6e..0000000000000 --- a/tools/win/generate_breakpad_symbols.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 GitHub, Inc. -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Convert pdb to sym for given directories""" - -import errno -import glob -import optparse -import os -import Queue -import re -import subprocess -import sys -import threading - -SRC_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..', '..')) - -# Duplicated as this script lives in tools not script -def get_out_dir(): - out_dir = 'Debug' - override = os.environ.get('ELECTRON_OUT_DIR') - if override is not None: - out_dir = override - return os.path.join(SRC_DIR, 'out', out_dir) - - -CONCURRENT_TASKS=4 -OUT_DIR=get_out_dir() -DUMP_SYMS=os.path.join(OUT_DIR, 'dump_syms.exe') - - -def GetCommandOutput(command): - """Runs the command list, returning its output. - - Prints the given command (which should be a list of one or more strings), - then runs it and returns its output (stdout) as a string. - - From chromium_utils. - """ - devnull = open(os.devnull, 'w') - proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=devnull, - bufsize=1) - output = proc.communicate()[0] - return output - - -def mkdir_p(path): - """Simulates mkdir -p.""" - try: - os.makedirs(path) - except OSError as e: - if e.errno == errno.EEXIST and os.path.isdir(path): - pass - else: raise - - -def GenerateSymbols(options, binaries): - """Dumps the symbols of binary and places them in the given directory.""" - - queue = Queue.Queue() - print_lock = threading.Lock() - - def _Worker(): - while True: - binary = queue.get() - - if options.verbose: - with print_lock: - print "Generating symbols for %s" % binary - - syms = GetCommandOutput([DUMP_SYMS, binary]) - module_line = re.match("MODULE [^ ]+ [^ ]+ ([0-9A-Fa-f]+) (.*)\r\n", syms) - if module_line == None: - with print_lock: - print "Failed to get symbols for %s" % binary - queue.task_done() - continue - - output_path = os.path.join(options.symbols_dir, module_line.group(2), - module_line.group(1)) - mkdir_p(output_path) - symbol_file = "%s.sym" % module_line.group(2)[:-4] # strip .pdb - f = open(os.path.join(output_path, symbol_file), 'w') - f.write(syms) - f.close() - - queue.task_done() - - for binary in binaries: - queue.put(binary) - - for _ in range(options.jobs): - t = threading.Thread(target=_Worker) - t.daemon = True - t.start() - - queue.join() - - -def main(): - parser = optparse.OptionParser() - parser.add_option('', '--symbols-dir', default='', - help='The directory where to write the symbols file.') - parser.add_option('', '--clear', default=False, action='store_true', - help='Clear the symbols directory before writing new ' - 'symbols.') - parser.add_option('-j', '--jobs', default=CONCURRENT_TASKS, action='store', - type='int', help='Number of parallel tasks to run.') - parser.add_option('-v', '--verbose', action='store_true', - help='Print verbose status output.') - - (options, directories) = parser.parse_args() - - if not options.symbols_dir: - print "Required option --symbols-dir missing." - return 1 - - if options.clear: - try: - shutil.rmtree(options.symbols_dir) - except: - pass - - pdbs = [] - for directory in directories: - pdbs += glob.glob(os.path.join(directory, '*.exe.pdb')) - pdbs += glob.glob(os.path.join(directory, '*.dll.pdb')) - - GenerateSymbols(options, pdbs) - - return 0 - - -if '__main__' == __name__: - sys.exit(main()) From b8162becd753b9f6badd742db09c2fcaec16d714 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 9 Jul 2019 15:27:19 +0900 Subject: [PATCH 61/94] fix: disable animation for win.setSimpleFullScreen (#19143) --- atom/browser/native_window_mac.mm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 541c90fff4235..210fe6702c4c5 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -952,7 +952,13 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { [[window standardWindowButton:NSWindowCloseButton] setHidden:YES]; } - [window setFrame:fullscreenFrame display:YES animate:YES]; + // There is a bug with Chromium that, after setting window style, calling + // setFrame with animation immediately would block window rendering for + // a few seconds. + // This Chromium bug is fixed in later versions, but it is hard to find + // out how to backport the fix or how to work around it, disabling the + // animation is the easist fix and most users would not even notice it. + [window setFrame:fullscreenFrame display:YES animate:NO]; // Fullscreen windows can't be resized, minimized, maximized, or moved SetMinimizable(false); @@ -976,7 +982,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { [[window standardWindowButton:NSWindowCloseButton] setHidden:window_button_hidden]; - [window setFrame:original_frame_ display:YES animate:YES]; + [window setFrame:original_frame_ display:YES animate:NO]; window.level = original_level_; [NSApp setPresentationOptions:simple_fullscreen_options_]; From 768b4c97576b419033d565e1d72eccf2b2379563 Mon Sep 17 00:00:00 2001 From: Robo Date: Tue, 9 Jul 2019 11:36:27 -0700 Subject: [PATCH 62/94] fix: Windows OnSecreenKeyboard for various mouse events (#19144) Backports the following CLs: https://chromium-review.googlesource.com/c/chromium/src/+/1194406/ https://chromium-review.googlesource.com/c/chromium/src/+/1220560/ https://chromium-review.googlesource.com/c/chromium/src/+/1140199/ --- patches/common/chromium/.patches | 3 + .../chromium/browser_compositor_mac.patch | 2 +- .../chromium/crashpad_http_status.patch | 2 +- ...irtual_keyboard_for_all_mouse_inputs.patch | 253 ++++++++++++++++++ .../enable_quic_proxies_for_https_urls.patch | 5 +- ...verflows_of_operationid_a_bit_better.patch | 2 +- ..._when_focus_moves_from_ui_to_content.patch | 131 +++++++++ .../chromium/intersection-observer.patch | 2 +- ...rm_control_rendering_on_10_14_mojave.patch | 4 +- ...lowed-ports_work_with_networkservice.patch | 28 +- patches/common/chromium/mas-cfisobjc.patch | 6 +- .../chromium/mas_blink_no_private_api.patch | 6 +- .../common/chromium/mas_no_private_api.patch | 42 +-- .../render_widget_host_view_mac.patch | 8 +- ...efore_calling_displayvirtualkeyboard.patch | 39 +++ .../chromium/tabbed_window_lagging.patch | 6 +- .../common/chromium/webview_cross_drag.patch | 2 +- 17 files changed, 483 insertions(+), 58 deletions(-) create mode 100644 patches/common/chromium/do_not_show_virtual_keyboard_for_all_mouse_inputs.patch create mode 100644 patches/common/chromium/fire_caret_location_change_when_focus_moves_from_ui_to_content.patch create mode 100644 patches/common/chromium/setup_the_observer_before_calling_displayvirtualkeyboard.patch diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index b5664d459ace1..f21c4f55f32b3 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -106,3 +106,6 @@ enable_quic_proxies_for_https_urls.patch fix_svg_crash_for_v0_distribution_into_foreignobject.patch filesystem_harden_against_overflows_of_operationid_a_bit_better.patch fix_uap_in_imagebitmaploader_filereaderloader.patch +fire_caret_location_change_when_focus_moves_from_ui_to_content.patch +do_not_show_virtual_keyboard_for_all_mouse_inputs.patch +setup_the_observer_before_calling_displayvirtualkeyboard.patch diff --git a/patches/common/chromium/browser_compositor_mac.patch b/patches/common/chromium/browser_compositor_mac.patch index cb6210eb21cbf..9aad97014a7f1 100644 --- a/patches/common/chromium/browser_compositor_mac.patch +++ b/patches/common/chromium/browser_compositor_mac.patch @@ -29,7 +29,7 @@ diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/cont index 92afcc77910610e53378f55adc003cc1bdf3109a..42bd6fd7c169de36c775471c68b456f1386ff666 100644 --- a/content/browser/renderer_host/browser_compositor_view_mac.mm +++ b/content/browser/renderer_host/browser_compositor_view_mac.mm -@@ -81,6 +81,12 @@ +@@ -81,6 +81,12 @@ BrowserCompositorMac::~BrowserCompositorMac() { DCHECK_EQ(1u, num_erased); } diff --git a/patches/common/chromium/crashpad_http_status.patch b/patches/common/chromium/crashpad_http_status.patch index 4f7a9ff88725c..1acbc21e8fc82 100644 --- a/patches/common/chromium/crashpad_http_status.patch +++ b/patches/common/chromium/crashpad_http_status.patch @@ -22,7 +22,7 @@ diff --git a/third_party/crashpad/crashpad/util/net/http_transport_mac.mm b/thir index 8d5f78cc6efc8b8e349958f51c78921a8c163c4e..a433bb357da5865144ade7d3663b1c9b36199f8e 100644 --- a/third_party/crashpad/crashpad/util/net/http_transport_mac.mm +++ b/third_party/crashpad/crashpad/util/net/http_transport_mac.mm -@@ -293,7 +293,7 @@ static void Unschedule(CFReadStreamRef stream, +@@ -293,7 +293,7 @@ bool HTTPTransportMac::ExecuteSynchronously(std::string* response_body) { return false; } NSInteger http_status = [http_response statusCode]; diff --git a/patches/common/chromium/do_not_show_virtual_keyboard_for_all_mouse_inputs.patch b/patches/common/chromium/do_not_show_virtual_keyboard_for_all_mouse_inputs.patch new file mode 100644 index 0000000000000..7741f5dc4576f --- /dev/null +++ b/patches/common/chromium/do_not_show_virtual_keyboard_for_all_mouse_inputs.patch @@ -0,0 +1,253 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lan Wei +Date: Tue, 11 Sep 2018 19:41:33 +0000 +Subject: Do not show virtual keyboard for all mouse inputs + +We have an issue that Windows virtual Keyboard appears whenever a text +area is selected with the mouse or keyboard. Since we decide to only +show the virtual keyboard when the input type is touch. + +Bug: 871756 +Change-Id: Ia804afad907341ed478409d223b67f09c6b7f8f3 +Reviewed-on: https://chromium-review.googlesource.com/1194406 +Reviewed-by: Pavel Feldman +Reviewed-by: Marc Treib +Reviewed-by: Keigo Oka +Reviewed-by: Lei Zhang +Reviewed-by: Navid Zolghadr +Reviewed-by: Sadrul Chowdhury +Commit-Queue: Lan Wei +Cr-Commit-Position: refs/heads/master@{#590440} + +diff --git a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc +index 5c8bdc8c73dc2047175f16c658428c9f2c038412..f7c8c33b3d6764116e0713244e446356873e015f 100644 +--- a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc ++++ b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc +@@ -1154,6 +1154,9 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, + + // Set |TextInputState.show_ime_if_needed| to true. Expect IME. + sender.SetShowVirtualKeyboardIfEnabled(true); ++#if defined(OS_WIN) ++ sender.SetLastPointerType(ui::EventPointerType::POINTER_TYPE_TOUCH); ++#endif + EXPECT_TRUE(send_and_check_show_ime()); + + // Send the same message. Expect IME (no change). +@@ -1171,6 +1174,12 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, + sender.SetShowVirtualKeyboardIfEnabled(true); + EXPECT_TRUE(send_and_check_show_ime()); + ++#if defined(OS_WIN) ++ // Set input type to mouse. Expect no IME. ++ sender.SetLastPointerType(ui::EventPointerType::POINTER_TYPE_MOUSE); ++ EXPECT_FALSE(send_and_check_show_ime()); ++#endif ++ + // Set |TextInputState.type| to ui::TEXT_INPUT_TYPE_NONE. Expect no IME. + sender.SetType(ui::TEXT_INPUT_TYPE_NONE); + EXPECT_FALSE(send_and_check_show_ime()); +diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc +index 1445829a89caaeeea602cd050b9c3bf0161f5881..0bb77fbfee6a4c08ce261bbc4846c8ec0755b01a 100644 +--- a/chrome/browser/ui/search/search_tab_helper.cc ++++ b/chrome/browser/ui/search/search_tab_helper.cc +@@ -271,7 +271,9 @@ void SearchTabHelper::FocusOmnibox(OmniboxFocusState state) { + // visual cue to users who really understand selection state about what + // will happen if they start typing. + omnibox_view->SelectAll(false); ++#if !defined(OS_WIN) + omnibox_view->ShowVirtualKeyboardIfEnabled(); ++#endif + break; + case OMNIBOX_FOCUS_NONE: + // Remove focus only if the popup is closed. This will prevent someone +diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc +index 0eec5c7a6861f189192ab0cf8b3dbb3b452292e0..de9490d94d98afa6812e81b0cf50fb4adc81887c 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura.cc ++++ b/content/browser/renderer_host/render_widget_host_view_aura.cc +@@ -756,9 +756,11 @@ void RenderWidgetHostViewAura::FocusedNodeTouched(bool editable) { + return; + auto* controller = input_method->GetInputMethodKeyboardController(); + if (editable && host()->GetView() && host()->delegate()) { +- keyboard_observer_.reset(new WinScreenKeyboardObserver(this)); +- if (!controller->DisplayVirtualKeyboard()) +- keyboard_observer_.reset(nullptr); ++ keyboard_observer_.reset(nullptr); ++ if (last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH && ++ controller->DisplayVirtualKeyboard()) { ++ keyboard_observer_.reset(new WinScreenKeyboardObserver(this)); ++ } + virtual_keyboard_requested_ = keyboard_observer_.get(); + } else { + virtual_keyboard_requested_ = false; +@@ -2341,9 +2343,16 @@ void RenderWidgetHostViewAura::OnUpdateTextInputStateCalled( + const TextInputState* state = text_input_manager_->GetTextInputState(); + if (state && state->type != ui::TEXT_INPUT_TYPE_NONE && + state->mode != ui::TEXT_INPUT_MODE_NONE) { ++ bool show_virtual_keyboard = true; ++#if defined(OS_WIN) ++ show_virtual_keyboard = ++ last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH; ++#endif + if (state->show_ime_if_needed && +- GetInputMethod()->GetTextInputClient() == this) ++ GetInputMethod()->GetTextInputClient() == this && ++ show_virtual_keyboard) { + GetInputMethod()->ShowVirtualKeyboardIfEnabled(); ++ } + // Ensure that accessibility events are fired when the selection location + // moves from UI back to content. + text_input_manager->NotifySelectionBoundsChanged(updated_view); +diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h +index 5f75e19c4a9fa8aaa57882dcbb094a73199f50d0..2257552851e933a06cb9addbee00e511573561ec 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura.h ++++ b/content/browser/renderer_host/render_widget_host_view_aura.h +@@ -342,6 +342,12 @@ class CONTENT_EXPORT RenderWidgetHostViewAura + + void ScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect); + ++ // TODO(lanwei): Use TestApi interface to write functions that are used in ++ // tests and remove FRIEND_TEST_ALL_PREFIXES. ++ void SetLastPointerType(ui::EventPointerType last_pointer_type) { ++ last_pointer_type_ = last_pointer_type; ++ } ++ + protected: + ~RenderWidgetHostViewAura() override; + +@@ -408,6 +414,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura + DiscardDelegatedFramesWithMemoryPressure); + FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraKeyboardTest, + KeyboardObserverDestroyed); ++ FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraKeyboardTest, ++ KeyboardObserverForOnlyTouchInput); + FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraSurfaceSynchronizationTest, + DropFallbackWhenHidden); + FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraSurfaceSynchronizationTest, +diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +index 9aac9b4c740245727124991a750a36b54f3d7ac5..f7b9e13226b1896028044d389ace5383554b5dce 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ++++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +@@ -6735,6 +6735,7 @@ class RenderWidgetHostViewAuraKeyboardTest + }; + + TEST_F(RenderWidgetHostViewAuraKeyboardTest, KeyboardObserverDestroyed) { ++ parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_TOUCH); + parent_view_->FocusedNodeTouched(true); + EXPECT_NE(parent_view_->keyboard_observer_.get(), nullptr); + EXPECT_EQ(keyboard_controller_observer_count(), 1u); +@@ -6744,6 +6745,20 @@ TEST_F(RenderWidgetHostViewAuraKeyboardTest, KeyboardObserverDestroyed) { + EXPECT_EQ(keyboard_controller_observer_count(), 0u); + } + ++TEST_F(RenderWidgetHostViewAuraKeyboardTest, ++ KeyboardObserverForOnlyTouchInput) { ++ // Show virtual keyboard for touch inputs. ++ parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_TOUCH); ++ parent_view_->FocusedNodeTouched(true); ++ EXPECT_NE(parent_view_->keyboard_observer_.get(), nullptr); ++ EXPECT_EQ(keyboard_controller_observer_count(), 1u); ++ // Do not show virtual keyboard for mouse inputs. ++ parent_view_->SetLastPointerType(ui::EventPointerType::POINTER_TYPE_MOUSE); ++ parent_view_->FocusedNodeTouched(true); ++ EXPECT_EQ(parent_view_->keyboard_observer_.get(), nullptr); ++ EXPECT_EQ(keyboard_controller_observer_count(), 0u); ++} ++ + #endif // defined(OS_WIN) + + } // namespace content +diff --git a/content/public/test/text_input_test_utils.cc b/content/public/test/text_input_test_utils.cc +index 3d27041d9cfae4d87e4b2b26983f7a004ffc31d9..2d724b57c213052b184fc3b4c012bb0d8ad25b50 100644 +--- a/content/public/test/text_input_test_utils.cc ++++ b/content/public/test/text_input_test_utils.cc +@@ -186,7 +186,7 @@ class TestRenderWidgetHostViewDestructionObserver::InternalObserver + DISALLOW_COPY_AND_ASSIGN(InternalObserver); + }; + +-#ifdef USE_AURA ++#if defined(USE_AURA) + class InputMethodObserverAura : public TestInputMethodObserver, + public ui::InputMethodObserver { + public: +@@ -453,6 +453,15 @@ void TextInputStateSender::SetShowVirtualKeyboardIfEnabled( + text_input_state_->show_ime_if_needed = show_ime_if_needed; + } + ++#if defined(USE_AURA) ++void TextInputStateSender::SetLastPointerType( ++ ui::EventPointerType last_pointer_type) { ++ RenderWidgetHostViewAura* rwhva = ++ static_cast(view_); ++ rwhva->SetLastPointerType(last_pointer_type); ++} ++#endif ++ + TestInputMethodObserver::TestInputMethodObserver() {} + + TestInputMethodObserver::~TestInputMethodObserver() {} +@@ -462,7 +471,7 @@ std::unique_ptr TestInputMethodObserver::Create( + WebContents* web_contents) { + std::unique_ptr observer; + +-#ifdef USE_AURA ++#if defined(USE_AURA) + RenderWidgetHostViewAura* view = static_cast( + web_contents->GetRenderWidgetHostView()); + observer.reset(new InputMethodObserverAura(view->GetInputMethod())); +diff --git a/content/public/test/text_input_test_utils.h b/content/public/test/text_input_test_utils.h +index d438b72e176adbcb1240848c223596ffef2c558d..2bb337c19de138a106f8f3fe8c631aa8ca717df5 100644 +--- a/content/public/test/text_input_test_utils.h ++++ b/content/public/test/text_input_test_utils.h +@@ -17,6 +17,10 @@ + #include "content/public/browser/browser_message_filter.h" + #endif + ++#if defined(USE_AURA) ++#include "ui/events/event_constants.h" ++#endif ++ + namespace ipc { + class Message; + } +@@ -194,6 +198,9 @@ class TextInputStateSender { + void SetFlags(int flags); + void SetCanComposeInline(bool can_compose_inline); + void SetShowVirtualKeyboardIfEnabled(bool show_ime_if_needed); ++#if defined(USE_AURA) ++ void SetLastPointerType(ui::EventPointerType last_pointer_type); ++#endif + + private: + std::unique_ptr text_input_state_; +diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc +index c9a96b43788835476310c96b71b1ced21737a3c3..7963a4d1912eb8ba03d46dd353665f977680a2c5 100644 +--- a/ui/views/controls/textfield/textfield.cc ++++ b/ui/views/controls/textfield/textfield.cc +@@ -666,7 +666,9 @@ bool Textfield::OnMousePressed(const ui::MouseEvent& event) { + (event.IsOnlyLeftMouseButton() || event.IsOnlyRightMouseButton())) { + if (!had_focus) + RequestFocusWithPointer(ui::EventPointerType::POINTER_TYPE_MOUSE); ++#if !defined(OS_WIN) + ShowVirtualKeyboardIfEnabled(); ++#endif + } + + #if defined(OS_LINUX) && !defined(OS_CHROMEOS) +@@ -743,10 +745,16 @@ bool Textfield::OnKeyReleased(const ui::KeyEvent& event) { + } + + void Textfield::OnGestureEvent(ui::GestureEvent* event) { ++ bool show_virtual_keyboard = true; ++#if defined(OS_WIN) ++ show_virtual_keyboard = event->details().primary_pointer_type() == ++ ui::EventPointerType::POINTER_TYPE_TOUCH; ++#endif + switch (event->type()) { + case ui::ET_GESTURE_TAP_DOWN: + RequestFocusWithPointer(event->details().primary_pointer_type()); +- ShowVirtualKeyboardIfEnabled(); ++ if (show_virtual_keyboard) ++ ShowVirtualKeyboardIfEnabled(); + event->SetHandled(); + break; + case ui::ET_GESTURE_TAP: diff --git a/patches/common/chromium/enable_quic_proxies_for_https_urls.patch b/patches/common/chromium/enable_quic_proxies_for_https_urls.patch index ec9fc99380115..015ce7e33dc98 100644 --- a/patches/common/chromium/enable_quic_proxies_for_https_urls.patch +++ b/patches/common/chromium/enable_quic_proxies_for_https_urls.patch @@ -1,9 +1,8 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Sun, 31 Mar 2019 21:12:59 +0200 -Subject: =?UTF-8?q?Enable=20support=20for=20sending=20HTTPS=20URLs=20via?= - =?UTF-8?q?=20QUIC=20proxies=20only=20when=0Athe=20finch=20param=20enable?= - =?UTF-8?q?=5Fquic=5Fproxies=5Ffor=5Fhttps=5Furls=20is=20set.?= +Subject: Enable support for sending HTTPS URLs via QUIC proxies only when the + finch param enable_quic_proxies_for_https_urls is set. Backports: - https://chromium-review.googlesource.com/c/chromium/src/+/1377709 diff --git a/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch b/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch index 789949d398a7e..291052f760743 100644 --- a/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch +++ b/patches/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marijn Kruisselbrink Date: Tue, 29 Jan 2019 19:51:07 +0000 -Subject: [FileSystem] Harden against overflows of OperationID a bit better. +Subject: Harden against overflows of OperationID a bit better. Rather than having a UAF when OperationID overflows instead overwrite the old operation with the new one. Can still cause weirdness, but at diff --git a/patches/common/chromium/fire_caret_location_change_when_focus_moves_from_ui_to_content.patch b/patches/common/chromium/fire_caret_location_change_when_focus_moves_from_ui_to_content.patch new file mode 100644 index 0000000000000..fcc68573e545e --- /dev/null +++ b/patches/common/chromium/fire_caret_location_change_when_focus_moves_from_ui_to_content.patch @@ -0,0 +1,131 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aaron Leventhal +Date: Wed, 25 Jul 2018 14:05:53 +0000 +Subject: Fire caret location change when focus moves from UI to content + +When focus moves from UI back into content, but the same content element +is focused as was previously, an accessibility event must be fired for +the caret location change, as it is no longer in the UI. + +This fix assists screen magnification software that must track the caret +location. + +Bug: 864563 +Change-Id: Ie9cc745288c124ddd73a54906c41dc16e07b9ff6 +Reviewed-on: https://chromium-review.googlesource.com/1140199 +Reviewed-by: Sadrul Chowdhury +Reviewed-by: Kinuko Yasuda +Reviewed-by: Dominic Mazzoni +Commit-Queue: Aaron Leventhal +Cr-Commit-Position: refs/heads/master@{#577868} + +diff --git a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc +index c06ff416d83c943731166501260a7a4d9b36b078..5c8bdc8c73dc2047175f16c658428c9f2c038412 100644 +--- a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc ++++ b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc +@@ -10,6 +10,8 @@ + #include "build/build_config.h" + #include "chrome/browser/chrome_content_browser_client.h" + #include "chrome/browser/ui/browser.h" ++#include "chrome/browser/ui/browser_window.h" ++#include "chrome/browser/ui/location_bar/location_bar.h" + #include "chrome/browser/ui/tabs/tab_strip_model.h" + #include "chrome/test/base/in_process_browser_test.h" + #include "chrome/test/base/interactive_test_utils.h" +@@ -639,6 +641,41 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, + reset_state_observer.Wait(); + } + ++#if defined(USE_AURA) ++// This test creates a blank page and adds an to it. Then, the ++// is focused, UI is focused, then the input is refocused. The test verifies ++// that selection bounds change with the refocus (see https://crbug.com/864563). ++IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, ++ SelectionBoundsChangeAfterRefocusInput) { ++ CreateIframePage("a()"); ++ content::RenderFrameHost* main_frame = GetFrame(IndexVector{}); ++ content::RenderWidgetHostView* view = main_frame->GetView(); ++ content::WebContents* web_contents = active_contents(); ++ AddInputFieldToFrame(main_frame, "text", "", false); ++ ++ auto focus_input_and_wait_for_selection_bounds_change = ++ [&main_frame, &web_contents, &view]() { ++ ViewSelectionBoundsChangedObserver bounds_observer(web_contents, view); ++ // SimulateKeyPress(web_contents, ui::DomKey::TAB, ui::DomCode::TAB, ++ // ui::VKEY_TAB, false, true, false, false); ++ EXPECT_TRUE(ExecuteScript(main_frame, ++ "document.querySelector('input').focus();")); ++ bounds_observer.Wait(); ++ }; ++ ++ focus_input_and_wait_for_selection_bounds_change(); ++ ++ // Focus location bar. ++ BrowserWindow* window = browser()->window(); ++ ASSERT_TRUE(window); ++ LocationBar* location_bar = window->GetLocationBar(); ++ ASSERT_TRUE(location_bar); ++ location_bar->FocusLocation(true); ++ ++ focus_input_and_wait_for_selection_bounds_change(); ++} ++#endif ++ + // This test verifies that if we have a focused in the main frame and + // the tab is closed, TextInputManager handles unregistering itself and + // notifying the observers properly (see https://crbug.com/669375). +diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc +index 09168578786f9ecfa3e1c44b134d7fe76af9504c..0eec5c7a6861f189192ab0cf8b3dbb3b452292e0 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura.cc ++++ b/content/browser/renderer_host/render_widget_host_view_aura.cc +@@ -2339,11 +2339,14 @@ void RenderWidgetHostViewAura::OnUpdateTextInputStateCalled( + GetInputMethod()->OnTextInputTypeChanged(this); + + const TextInputState* state = text_input_manager_->GetTextInputState(); +- if (state && state->show_ime_if_needed && +- state->type != ui::TEXT_INPUT_TYPE_NONE && +- state->mode != ui::TEXT_INPUT_MODE_NONE && +- GetInputMethod()->GetTextInputClient() == this) { +- GetInputMethod()->ShowVirtualKeyboardIfEnabled(); ++ if (state && state->type != ui::TEXT_INPUT_TYPE_NONE && ++ state->mode != ui::TEXT_INPUT_MODE_NONE) { ++ if (state->show_ime_if_needed && ++ GetInputMethod()->GetTextInputClient() == this) ++ GetInputMethod()->ShowVirtualKeyboardIfEnabled(); ++ // Ensure that accessibility events are fired when the selection location ++ // moves from UI back to content. ++ text_input_manager->NotifySelectionBoundsChanged(updated_view); + } + + if (auto* render_widget_host = updated_view->host()) { +diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc +index 24f32e7228aa2b7ece229312a79cc0c95251a31f..ce3a5ff83cf2e0ca9e3cda56308b3b00f6471f16 100644 +--- a/content/browser/renderer_host/text_input_manager.cc ++++ b/content/browser/renderer_host/text_input_manager.cc +@@ -209,6 +209,11 @@ void TextInputManager::SelectionBoundsChanged( + selection_region_map_[view].first_selection_rect.set_size( + params.anchor_rect.size()); + ++ NotifySelectionBoundsChanged(view); ++} ++ ++void TextInputManager::NotifySelectionBoundsChanged( ++ RenderWidgetHostViewBase* view) { + for (auto& observer : observer_list_) + observer.OnSelectionBoundsChanged(this, view); + } +diff --git a/content/browser/renderer_host/text_input_manager.h b/content/browser/renderer_host/text_input_manager.h +index 8e4ecfe5be2defa1578eec9be3c713be0b07e84d..d145a992144079401817e2e24f664576c493b3fb 100644 +--- a/content/browser/renderer_host/text_input_manager.h ++++ b/content/browser/renderer_host/text_input_manager.h +@@ -184,6 +184,10 @@ class CONTENT_EXPORT TextInputManager { + void SelectionBoundsChanged(RenderWidgetHostViewBase* view, + const ViewHostMsg_SelectionBounds_Params& params); + ++ // Notify observers that the selection bounds have been updated. This is also ++ // called when a view with a selection is reactivated. ++ void NotifySelectionBoundsChanged(RenderWidgetHostViewBase* view); ++ + // Called when the composition range and/or character bounds have changed. + void ImeCompositionRangeChanged( + RenderWidgetHostViewBase* view, diff --git a/patches/common/chromium/intersection-observer.patch b/patches/common/chromium/intersection-observer.patch index e9e145ec5f6c2..208a45f8601eb 100644 --- a/patches/common/chromium/intersection-observer.patch +++ b/patches/common/chromium/intersection-observer.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 27 Mar 2019 23:27:40 +0100 -Subject: [IntersectionObserver] Report coordinates as CSS pixels. +Subject: Report coordinates as CSS pixels. Prior to this patch, IntersectionObserverEntry was reporting coordinates in device pixels. diff --git a/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch b/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch index 5bae6c27ef777..151a530df4e06 100644 --- a/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch +++ b/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch @@ -56,7 +56,7 @@ diff --git a/services/service_manager/sandbox/mac/sandbox_mac.mm b/services/serv index d69fcc0d4c5c2471163280c03a9fd9366e05031d..cdd7b7f6723162d6875c4d11379837708bdde79d 100644 --- a/services/service_manager/sandbox/mac/sandbox_mac.mm +++ b/services/service_manager/sandbox/mac/sandbox_mac.mm -@@ -81,6 +81,21 @@ +@@ -81,6 +81,21 @@ static_assert(arraysize(kDefaultSandboxTypeToResourceIDMapping) == size_t(SANDBOX_TYPE_AFTER_LAST_TYPE), "sandbox type to resource id mapping incorrect"); @@ -78,7 +78,7 @@ index d69fcc0d4c5c2471163280c03a9fd9366e05031d..cdd7b7f6723162d6875c4d1137983770 } // namespace // Static variable declarations. -@@ -242,6 +257,9 @@ +@@ -242,6 +257,9 @@ bool SandboxMac::Enable(SandboxType sandbox_type) { if (!compiler.InsertBooleanParam(kSandboxMacOS1013, macos_1013)) return false; diff --git a/patches/common/chromium/make_--explicitly-allowed-ports_work_with_networkservice.patch b/patches/common/chromium/make_--explicitly-allowed-ports_work_with_networkservice.patch index 0f6130fac6b69..f80f539264d7e 100644 --- a/patches/common/chromium/make_--explicitly-allowed-ports_work_with_networkservice.patch +++ b/patches/common/chromium/make_--explicitly-allowed-ports_work_with_networkservice.patch @@ -13,7 +13,7 @@ Reviewed-by: John Abd-El-Malek Cr-Commit-Position: refs/heads/master@{#620910} diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc -index 665718d90bf66061f92164c2715f5e500608beb5..63b88c0051354eab316edd16c522b3c7f89158ca 100644 +index e2afc34bd98f6a6cc76132dc4d1f8ca5c84afbaf..1a86063573849d5e174603ce418beebd103120d3 100644 --- a/chrome/browser/ui/startup/startup_browser_creator.cc +++ b/chrome/browser/ui/startup/startup_browser_creator.cc @@ -66,7 +66,6 @@ @@ -96,10 +96,10 @@ index 0000000000000000000000000000000000000000..e47cbbf08076216f60f0d01942626f16 + +} // namespace content diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index aac3f05054724c2fa030efd4c8d7543de9433612..b8a0e794b9ea2791a699d84fa3d4987cced36324 100644 +index 35fdb9d351db5a6bdaa61742ec49dc75fe70cfa4..c72025ad2e825d3c7f8136434587bcebf8f858e0 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2793,6 +2793,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -2782,6 +2782,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( static const char* const kSwitchNames[] = { switches::kDisableColorCorrectRendering, network::switches::kNoReferrers, @@ -107,7 +107,7 @@ index aac3f05054724c2fa030efd4c8d7543de9433612..b8a0e794b9ea2791a699d84fa3d4987c service_manager::switches::kDisableInProcessStackTraces, service_manager::switches::kDisableSeccompFilterSandbox, service_manager::switches::kNoSandbox, -@@ -2875,7 +2876,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -2863,7 +2864,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( switches::kEnableWebGLDraftExtensions, switches::kEnableWebGLImageChromium, switches::kEnableWebVR, @@ -116,7 +116,7 @@ index aac3f05054724c2fa030efd4c8d7543de9433612..b8a0e794b9ea2791a699d84fa3d4987c switches::kFMPNetworkQuietTimeout, switches::kForceColorProfile, diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc -index 074f290638ff7311d6c9683a63f7a7c39a402876..5e1c9138bcf604831fca12a9673675e0d9d4734f 100644 +index 9d7c9791bd99c361a9ba3edc539d9b48b46659d4..3d11373b77af8bc0db42a27fcfab3089f8aaed1c 100644 --- a/content/browser/utility_process_host.cc +++ b/content/browser/utility_process_host.cc @@ -286,6 +286,7 @@ bool UtilityProcessHost::StartProcess() { @@ -128,10 +128,10 @@ index 074f290638ff7311d6c9683a63f7a7c39a402876..5e1c9138bcf604831fca12a9673675e0 #if defined(OS_MACOSX) service_manager::switches::kEnableSandboxLogging, diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc -index eeb540ba52e109aff7348714a0ad22399a460a2d..512d0bb910bf9d5091943a5a40b253ad7ac43e65 100644 +index 19c2246a3bd8dcc3d1e070b74ff3d416adc473fe..cdf81f6c35cd78b4fff4d666284d0615e6c057c6 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc -@@ -473,10 +473,6 @@ const char kEnableWebVR[] = "enable-webvr"; +@@ -469,10 +469,6 @@ const char kEnableWebVR[] = "enable-webvr"; // Enable rasterizer that writes directly to GPU memory associated with tiles. const char kEnableZeroCopy[] = "enable-zero-copy"; @@ -143,10 +143,10 @@ index eeb540ba52e109aff7348714a0ad22399a460a2d..512d0bb910bf9d5091943a5a40b253ad // be shared between processes. The argument to this switch is the handle id // (pointer on Windows) as a string, followed by a comma, then the size of the diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h -index 2a08de6a59bb67bfe0f65f82f6ba3397a4896056..f420773ee9fe29e5562878ded07ad98ad6700e5f 100644 +index 2c795e814b13961eb190d5c7f9bce3c854dbfc17..a4da6292e7c5784e06e686cd62e017b010fa7e27 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h -@@ -148,7 +148,6 @@ CONTENT_EXPORT extern const char kEnableWebGLDraftExtensions[]; +@@ -147,7 +147,6 @@ CONTENT_EXPORT extern const char kEnableWebGLDraftExtensions[]; CONTENT_EXPORT extern const char kEnableWebGLImageChromium[]; CONTENT_EXPORT extern const char kEnableWebVR[]; CONTENT_EXPORT extern const char kEnableZeroCopy[]; @@ -155,7 +155,7 @@ index 2a08de6a59bb67bfe0f65f82f6ba3397a4896056..f420773ee9fe29e5562878ded07ad98a CONTENT_EXPORT extern const char kFileUrlPathAlias[]; CONTENT_EXPORT extern const char kForceDisplayList2dCanvas[]; diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc -index 2e17bf6f1522d3f8557b5d4bac0fb76fec034418..44df5d5461c718d2a793171d3592691c7bba12c8 100644 +index 5c31ab7654d0168d232e9974105573fa01543aed..b670c95891ab80e749209a843d958ffcbdcc6ba2 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -143,6 +143,7 @@ @@ -180,7 +180,7 @@ index 2e17bf6f1522d3f8557b5d4bac0fb76fec034418..44df5d5461c718d2a793171d3592691c } } diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn -index 9e705c8b905c21db05b9e6461c31b0cea7d30980..dab1cfc7e2dd3ad65e9a554362f159970eb5cbd4 100644 +index 15a64a49d5c821d3cb10b9dfd99725296e6a912c..a28467ec68e2b63964e396977c17a2cbb5cf2407 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn @@ -791,6 +791,7 @@ test("content_browsertests") { @@ -192,7 +192,7 @@ index 9e705c8b905c21db05b9e6461c31b0cea7d30980..dab1cfc7e2dd3ad65e9a554362f15997 "../browser/network_service_browsertest.cc", "../browser/network_service_restart_browsertest.cc", diff --git a/services/network/network_service.cc b/services/network/network_service.cc -index e4cf8022f4d017321fb2f684ec0ade3bbd122df3..d22a74c6a8d7cc2e3acc1f0adc15f4b3a6b47867 100644 +index a91a9f4b5866c11ae76e2d173a92579f0b7d12a1..404c3fa8316abdd77b492468e29a577c0c9c0988 100644 --- a/services/network/network_service.cc +++ b/services/network/network_service.cc @@ -19,6 +19,7 @@ @@ -218,7 +218,7 @@ index e4cf8022f4d017321fb2f684ec0ade3bbd122df3..d22a74c6a8d7cc2e3acc1f0adc15f4b3 // per-NetworkContext basis. UMA_HISTOGRAM_BOOLEAN( diff --git a/services/network/public/cpp/network_switches.cc b/services/network/public/cpp/network_switches.cc -index 8b2d4ed3b39e35e1a078ad26a946cc752a830310..60859bc46e6420165a11e2c4bd03dcd81345b122 100644 +index 7790a6fa6e749f0f87d104f0175ad76d5aace108..6e489aafa30155fbbf75edfbffd17f93159e5665 100644 --- a/services/network/public/cpp/network_switches.cc +++ b/services/network/public/cpp/network_switches.cc @@ -37,6 +37,10 @@ const char kLogNetLog[] = "log-net-log"; @@ -233,7 +233,7 @@ index 8b2d4ed3b39e35e1a078ad26a946cc752a830310..60859bc46e6420165a11e2c4bd03dcd8 } // namespace network diff --git a/services/network/public/cpp/network_switches.h b/services/network/public/cpp/network_switches.h -index 83e78d0f3f705dc4082992ad8147bb5145308152..db64e5af747369823f91eb5d596ecb6f0cf94f96 100644 +index 3829a2d4360e6b04fc348712f236451ee704c575..28edfb93d4eaa3797a24691772850dc0009d50c9 100644 --- a/services/network/public/cpp/network_switches.h +++ b/services/network/public/cpp/network_switches.h @@ -18,6 +18,7 @@ COMPONENT_EXPORT(NETWORK_CPP) diff --git a/patches/common/chromium/mas-cfisobjc.patch b/patches/common/chromium/mas-cfisobjc.patch index 180423f3b8ede..c1dc41702a15b 100644 --- a/patches/common/chromium/mas-cfisobjc.patch +++ b/patches/common/chromium/mas-cfisobjc.patch @@ -9,7 +9,7 @@ diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e25fe7ca21 100644 --- a/base/mac/foundation_util.mm +++ b/base/mac/foundation_util.mm -@@ -26,7 +26,6 @@ +@@ -26,7 +26,6 @@ CFTypeID SecKeyGetTypeID(); #if !defined(OS_IOS) CFTypeID SecACLGetTypeID(); CFTypeID SecTrustedApplicationGetTypeID(); @@ -17,7 +17,7 @@ index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e2 #endif } // extern "C" -@@ -325,8 +324,7 @@ void SetBaseBundleID(const char* new_base_bundle_id) { +@@ -325,8 +324,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) { const_cast(reinterpret_cast(cf_val)); DCHECK(!cf_val || CTFontGetTypeID() == CFGetTypeID(cf_val) || @@ -27,7 +27,7 @@ index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e2 return ns_val; } -@@ -394,9 +392,6 @@ CTFontRef NSToCFCast(NSFont* ns_val) { +@@ -394,9 +392,6 @@ CFCast(const CFTypeRef& cf_val) { return (CTFontRef)(cf_val); } diff --git a/patches/common/chromium/mas_blink_no_private_api.patch b/patches/common/chromium/mas_blink_no_private_api.patch index 3870d2481d5d6..d687746c3eceb 100644 --- a/patches/common/chromium/mas_blink_no_private_api.patch +++ b/patches/common/chromium/mas_blink_no_private_api.patch @@ -18,7 +18,7 @@ index 94afefcee81b87c05bf9b1199d90d3d4b5ea84a6..2ec7f04c71824b47de1ddbf1f0e8625d extern "C" { // Kill ring calls. Would be better to use NSKillRing.h, but that's not -@@ -39,38 +40,53 @@ +@@ -39,38 +40,53 @@ NSString* _NSYankFromKillRing(); void _NSNewKillRingSequence(); void _NSSetKillRingToYankedState(); } @@ -92,7 +92,7 @@ index 7a1260db0a139f9f3f8a823af2c220f36162812a..bf9cf7046e2fc9cdfee5b92f2a348185 namespace blink { -@@ -73,10 +75,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame, +@@ -73,10 +75,12 @@ bool ThemePainterMac::PaintTextField(const Node* node, // behavior change while remaining a fragile solution. // https://bugs.chromium.org/p/chromium/issues/detail?id=658085#c3 if (!use_ns_text_field_cell) { @@ -105,7 +105,7 @@ index 7a1260db0a139f9f3f8a823af2c220f36162812a..bf9cf7046e2fc9cdfee5b92f2a348185 return false; } -@@ -162,10 +166,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame, +@@ -162,10 +166,12 @@ bool ThemePainterMac::PaintTextArea(const Node* node, const PaintInfo& paint_info, const IntRect& r) { LocalCurrentGraphicsContext local_context(paint_info.context, r); diff --git a/patches/common/chromium/mas_no_private_api.patch b/patches/common/chromium/mas_no_private_api.patch index 3df25dff8d7b0..e63ef305d557a 100644 --- a/patches/common/chromium/mas_no_private_api.patch +++ b/patches/common/chromium/mas_no_private_api.patch @@ -41,7 +41,7 @@ diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/cont index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518325ef70a 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm -@@ -135,6 +135,7 @@ +@@ -135,6 +135,7 @@ NSDictionary* attributeToMethodNameMap = nil; // VoiceOver uses -1 to mean "no limit" for AXResultsLimit. const int kAXResultsLimitNoLimit = -1; @@ -49,7 +49,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 extern "C" { // The following are private accessibility APIs required for cursor navigation -@@ -341,6 +342,7 @@ void AddMisspelledTextAttributes( +@@ -341,6 +342,7 @@ NSAttributedString* GetAttributedTextForTextMarkerRange( AddMisspelledTextAttributes(text_only_objects, attributed_text); return [attributed_text attributedSubstringFromRange:range]; } @@ -57,7 +57,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns an autoreleased copy of the AXNodeData's attribute. NSString* NSStringForStringAttribute( -@@ -595,7 +597,9 @@ + (void)initialize { +@@ -595,7 +597,9 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; {NSAccessibilityDOMIdentifierAttribute, @"domIdentifier"}, {NSAccessibilityEditableAncestorAttribute, @"editableAncestor"}, {NSAccessibilityEnabledAttribute, @"enabled"}, @@ -67,7 +67,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 {NSAccessibilityExpandedAttribute, @"expanded"}, {NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"}, {NSAccessibilityFocusedAttribute, @"focused"}, -@@ -630,13 +634,17 @@ + (void)initialize { +@@ -630,13 +634,17 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; {NSAccessibilityRowsAttribute, @"rows"}, // TODO(aboxhall): expose // NSAccessibilityServesAsTitleForUIElementsAttribute @@ -85,7 +85,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 {NSAccessibilitySizeAttribute, @"size"}, {NSAccessibilitySortDirectionAttribute, @"sortDirection"}, {NSAccessibilitySubroleAttribute, @"subrole"}, -@@ -1114,6 +1122,7 @@ - (NSNumber*)enabled { +@@ -1114,6 +1122,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; ax::mojom::Restriction::kDisabled]; } @@ -93,7 +93,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns a text marker that points to the last character in the document that // can be selected with VoiceOver. - (id)endTextMarker { -@@ -1124,6 +1133,7 @@ - (id)endTextMarker { +@@ -1124,6 +1133,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtEndOfAnchor()); } @@ -101,7 +101,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 - (NSNumber*)expanded { if (![self instanceActive]) -@@ -2029,6 +2039,7 @@ - (NSValue*)selectedTextRange { +@@ -2029,6 +2039,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; return [NSValue valueWithRange:NSMakeRange(selStart, selLength)]; } @@ -109,7 +109,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 - (id)selectedTextMarkerRange { if (![self instanceActive]) return nil; -@@ -2061,6 +2072,7 @@ - (id)selectedTextMarkerRange { +@@ -2061,6 +2072,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; anchorAffinity, *focusObject, focusOffset, focusAffinity)); } @@ -117,7 +117,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 - (NSValue*)size { if (![self instanceActive]) -@@ -2093,6 +2105,7 @@ - (NSString*)sortDirection { +@@ -2093,6 +2105,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; return nil; } @@ -125,7 +125,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns a text marker that points to the first character in the document that // can be selected with VoiceOver. - (id)startTextMarker { -@@ -2103,6 +2116,7 @@ - (id)startTextMarker { +@@ -2103,6 +2116,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtStartOfAnchor()); } @@ -133,7 +133,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns a subrole based upon the role. - (NSString*) subrole { -@@ -2405,12 +2419,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range { +@@ -2405,12 +2419,14 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; NSMutableAttributedString* attributedValue = [[[NSMutableAttributedString alloc] initWithString:value] autorelease]; @@ -148,7 +148,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 return [attributedValue attributedSubstringFromRange:range]; } -@@ -2527,6 +2543,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute +@@ -2527,6 +2543,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; return nil; } @@ -156,7 +156,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) { BrowserAccessibilityPositionInstance position = CreatePositionFromTextMarker(parameter); -@@ -2704,6 +2721,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute +@@ -2704,6 +2721,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; NSString* text = GetTextForTextMarkerRange(parameter); return [NSNumber numberWithInt:[text length]]; } @@ -164,7 +164,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 if ([attribute isEqualToString: NSAccessibilityBoundsForRangeParameterizedAttribute]) { -@@ -2741,6 +2759,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute +@@ -2741,6 +2759,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; return nil; } @@ -172,7 +172,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 if ([attribute isEqualToString: NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) { BrowserAccessibilityPositionInstance position = -@@ -2820,6 +2839,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition( +@@ -2820,6 +2839,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; return @(child->GetIndexInParent()); } @@ -184,7 +184,7 @@ diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm index 8e32a08226079c6d7515b8e784babacb3226ecd6..93bb7273684fa529bdc6049af2ed379f8b059397 100644 --- a/content/browser/accessibility/browser_accessibility_manager_mac.mm +++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm -@@ -437,6 +437,7 @@ +@@ -437,6 +437,7 @@ NSDictionary* BrowserAccessibilityManagerMac:: [user_info setObject:native_focus_object forKey:NSAccessibilityTextChangeElement]; @@ -192,7 +192,7 @@ index 8e32a08226079c6d7515b8e784babacb3226ecd6..93bb7273684fa529bdc6049af2ed379f id selected_text = [native_focus_object selectedTextMarkerRange]; if (selected_text) { NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute = -@@ -444,6 +445,7 @@ +@@ -444,6 +445,7 @@ NSDictionary* BrowserAccessibilityManagerMac:: [user_info setObject:selected_text forKey:NSAccessibilitySelectedTextMarkerRangeAttribute]; } @@ -220,7 +220,7 @@ index 1e2cc38d3868ceccf8e45f5f82f57bcaa478f982..daa934c345e2686fd2174b7721d0f69a namespace content { -@@ -38,6 +40,7 @@ void _LSSetApplicationLaunchServicesServerConnectionStatus( +@@ -38,6 +40,7 @@ namespace { // This disconnects from the window server, and then indicates that Chrome // should continue execution without access to launchservicesd. void DisconnectWindowServer() { @@ -248,7 +248,7 @@ index 8b2092ec78f9f6bc1bd4c8af21ada74538f54d29..4f2ee8e2809790df68aedcee09462631 extern "C" { // Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and // `Karabiner` [3] to programmatically control the Bluetooth state. Calling the -@@ -47,6 +48,7 @@ +@@ -47,6 +48,7 @@ extern "C" { // [4] https://support.apple.com/kb/PH25091 void IOBluetoothPreferenceSetControllerPowerState(int state); } @@ -256,7 +256,7 @@ index 8b2092ec78f9f6bc1bd4c8af21ada74538f54d29..4f2ee8e2809790df68aedcee09462631 namespace { -@@ -120,8 +122,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { +@@ -120,8 +122,10 @@ BluetoothAdapterMac::BluetoothAdapterMac() controller_state_function_( base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState, base::Unretained(this))), @@ -267,7 +267,7 @@ index 8b2092ec78f9f6bc1bd4c8af21ada74538f54d29..4f2ee8e2809790df68aedcee09462631 should_update_name_(true), classic_discovery_manager_( BluetoothDiscoveryManagerMac::CreateClassic(this)), -@@ -314,8 +318,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { +@@ -314,8 +318,12 @@ bool BluetoothAdapterMac::IsLowEnergyAvailable() { } bool BluetoothAdapterMac::SetPoweredImpl(bool powered) { diff --git a/patches/common/chromium/render_widget_host_view_mac.patch b/patches/common/chromium/render_widget_host_view_mac.patch index 5d3b87d43d0e5..78998124eb60c 100644 --- a/patches/common/chromium/render_widget_host_view_mac.patch +++ b/patches/common/chromium/render_widget_host_view_mac.patch @@ -20,7 +20,7 @@ index 8b84322baa808f66044361d1033ec63805856227..70d244e01b75f98a6ed580475710d740 // These are not documented, so use only after checking -respondsToSelector:. @interface NSApplication (UndocumentedSpeechMethods) - (void)speakString:(NSString*)string; -@@ -354,6 +359,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { +@@ -354,6 +359,9 @@ void ExtractUnderlines(NSAttributedString* string, } - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { @@ -30,7 +30,7 @@ index 8b84322baa808f66044361d1033ec63805856227..70d244e01b75f98a6ed580475710d740 return [self acceptsMouseEventsWhenInactive]; } -@@ -688,6 +696,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { +@@ -688,6 +696,10 @@ void ExtractUnderlines(NSAttributedString* string, eventType == NSKeyDown && !(modifierFlags & NSCommandKeyMask); @@ -41,7 +41,7 @@ index 8b84322baa808f66044361d1033ec63805856227..70d244e01b75f98a6ed580475710d740 // We only handle key down events and just simply forward other events. if (eventType != NSKeyDown) { localClient_->ForwardKeyboardEvent(event, latency_info); -@@ -1460,9 +1472,11 @@ - (id)accessibilityFocusedUIElement { +@@ -1460,9 +1472,11 @@ void ExtractUnderlines(NSAttributedString* string, // Since this implementation doesn't have to wait any IPC calls, this doesn't // make any key-typing jank. --hbono 7/23/09 // @@ -53,7 +53,7 @@ index 8b84322baa808f66044361d1033ec63805856227..70d244e01b75f98a6ed580475710d740 - (NSArray*)validAttributesForMarkedText { // This code is just copied from WebKit except renaming variables. -@@ -1471,7 +1485,10 @@ - (NSArray*)validAttributesForMarkedText { +@@ -1471,7 +1485,10 @@ extern NSString* NSTextInputReplacementRangeAttributeName; initWithObjects:NSUnderlineStyleAttributeName, NSUnderlineColorAttributeName, NSMarkedClauseSegmentAttributeName, diff --git a/patches/common/chromium/setup_the_observer_before_calling_displayvirtualkeyboard.patch b/patches/common/chromium/setup_the_observer_before_calling_displayvirtualkeyboard.patch new file mode 100644 index 0000000000000..711291929414d --- /dev/null +++ b/patches/common/chromium/setup_the_observer_before_calling_displayvirtualkeyboard.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lan Wei +Date: Wed, 12 Sep 2018 00:36:53 +0000 +Subject: Setup the observer before calling DisplayVirtualKeyboard + +This is a follow up CL of +https://chromium-review.googlesource.com/c/chromium/src/+/1194406 + +We should setup the keyboard observer before displaying the virtual +keyboard otherwise the observer won't see the change of the virtual +keyboard. + +Bug: 871756 +Change-Id: I6b13072ed06d9e10d188c553082b411f2bb09326 +Reviewed-on: https://chromium-review.googlesource.com/1220560 +Reviewed-by: Sadrul Chowdhury +Commit-Queue: Lan Wei +Cr-Commit-Position: refs/heads/master@{#590553} + +diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc +index de9490d94d98afa6812e81b0cf50fb4adc81887c..a1ae227501930e918ea87d2013f6c300fd83644d 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura.cc ++++ b/content/browser/renderer_host/render_widget_host_view_aura.cc +@@ -756,10 +756,12 @@ void RenderWidgetHostViewAura::FocusedNodeTouched(bool editable) { + return; + auto* controller = input_method->GetInputMethodKeyboardController(); + if (editable && host()->GetView() && host()->delegate()) { +- keyboard_observer_.reset(nullptr); +- if (last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH && +- controller->DisplayVirtualKeyboard()) { ++ if (last_pointer_type_ == ui::EventPointerType::POINTER_TYPE_TOUCH) { + keyboard_observer_.reset(new WinScreenKeyboardObserver(this)); ++ if (!controller->DisplayVirtualKeyboard()) ++ keyboard_observer_.reset(nullptr); ++ } else { ++ keyboard_observer_.reset(nullptr); + } + virtual_keyboard_requested_ = keyboard_observer_.get(); + } else { diff --git a/patches/common/chromium/tabbed_window_lagging.patch b/patches/common/chromium/tabbed_window_lagging.patch index 1538624675ac3..ddb29ec569366 100644 --- a/patches/common/chromium/tabbed_window_lagging.patch +++ b/patches/common/chromium/tabbed_window_lagging.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cheng Zhao -Date: Thu May 16 13:52:12 JST 2019 +Date: Thu, 16 May 2019 13:52:12 +0900 Subject: tabbed_window_lagging.patch Fix lagging when using tabbed windows. @@ -12,10 +12,10 @@ we can not just cherry-pick them. Instead I'm just using the dummy fix and it does not seem to have side effects. diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm -index 69c5f1f44d7e..45aba19b2390 100644 +index 8841b59f6b70ac4687adfde61a1fba1424e57e48..cc3659319c4076043a0493798db3c7b8a4afd21e 100644 --- a/ui/views/cocoa/bridged_native_widget.mm +++ b/ui/views/cocoa/bridged_native_widget.mm -@@ -1037,6 +1037,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { +@@ -1039,6 +1039,12 @@ bool BridgedNativeWidget::ShouldRunCustomAnimationFor( // BridgedNativeWidget, ui::CATransactionObserver bool BridgedNativeWidget::ShouldWaitInPreCommit() { diff --git a/patches/common/chromium/webview_cross_drag.patch b/patches/common/chromium/webview_cross_drag.patch index 762e30a083c32..2594a6d429b16 100644 --- a/patches/common/chromium/webview_cross_drag.patch +++ b/patches/common/chromium/webview_cross_drag.patch @@ -20,7 +20,7 @@ diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser index cec3bd8a97b8b9bcab176a9bd2c296ec12aba838..7a2b4462bd44176e8e8389499f8c3d5fea647fa0 100644 --- a/content/browser/web_contents/web_drag_dest_mac.mm +++ b/content/browser/web_contents/web_drag_dest_mac.mm -@@ -348,6 +348,7 @@ - (void)setDragStartTrackersForProcess:(int)processID { +@@ -348,6 +348,7 @@ GetRenderWidgetHostAtPoint:(const NSPoint&)viewPoint } - (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH { From 09f9c95f8f64eb9e05021fd37d44d289c8d7c331 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 10 Jul 2019 16:38:16 +0200 Subject: [PATCH 63/94] ci: add check for dist zip file changes (#19175) --- .circleci/config.yml | 23 ++ appveyor.yml | 1 + build/zip.py | 4 +- script/generate-zip-manifest.py | 14 + script/zip_manifests/check-zip-manifest.py | 27 ++ .../zip_manifests/dist_zip.linux.arm.manifest | 69 ++++ .../dist_zip.linux.arm64.manifest | 69 ++++ .../zip_manifests/dist_zip.linux.x64.manifest | 71 ++++ .../zip_manifests/dist_zip.linux.x86.manifest | 71 ++++ .../zip_manifests/dist_zip.mac.x64.manifest | 312 ++++++++++++++++++ .../dist_zip.mac_mas.x64.manifest | 206 ++++++++++++ .../zip_manifests/dist_zip.win.ia32.manifest | 73 ++++ .../zip_manifests/dist_zip.win.x64.manifest | 73 ++++ 13 files changed, 1012 insertions(+), 1 deletion(-) create mode 100755 script/generate-zip-manifest.py create mode 100755 script/zip_manifests/check-zip-manifest.py create mode 100644 script/zip_manifests/dist_zip.linux.arm.manifest create mode 100644 script/zip_manifests/dist_zip.linux.arm64.manifest create mode 100644 script/zip_manifests/dist_zip.linux.x64.manifest create mode 100644 script/zip_manifests/dist_zip.linux.x86.manifest create mode 100644 script/zip_manifests/dist_zip.mac.x64.manifest create mode 100644 script/zip_manifests/dist_zip.mac_mas.x64.manifest create mode 100644 script/zip_manifests/dist_zip.win.ia32.manifest create mode 100644 script/zip_manifests/dist_zip.win.x64.manifest diff --git a/.circleci/config.yml b/.circleci/config.yml index bb44e00a168f0..d3a9bc01581e2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,7 @@ env-debug-build: &env-debug-build env-testing-build: &env-testing-build GN_CONFIG: //electron/build/args/testing.gn + CHECK_DIST_MANIFEST: '1' env-release-build: &env-release-build GN_CONFIG: //electron/build/args/release.gn @@ -253,6 +254,28 @@ step-electron-dist-build: &step-electron-dist-build command: | cd src ninja -C out/Default electron:electron_dist_zip + if [ "$CHECK_DIST_MANIFEST" == "1" ]; then + if [ "`uname`" == "Darwin" ]; then + target_os=mac + target_cpu=x64 + if [ x"$MAS_BUILD" == x"true" ]; then + target_os=mac_mas + fi + elif [ "`uname`" == "Linux" ]; then + target_os=linux + if [ x"$TARGET_ARCH" == x ]; then + target_cpu=x64 + elif [ "$TARGET_ARCH" == "ia32" ]; then + target_cpu=x86 + else + target_cpu="$TARGET_ARCH" + fi + else + echo "Unknown system: `uname`" + exit 1 + fi + electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.$target_cpu.manifest + fi step-electron-dist-store: &step-electron-dist-store store_artifacts: diff --git a/appveyor.yml b/appveyor.yml index ac6604bb64b69..d4423aed68004 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -77,6 +77,7 @@ build_script: python electron\script\zip-symbols.py appveyor PushArtifact out/Default/symbols.zip } + - python electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest test_script: - ps: >- if ((-Not (Test-Path Env:\ELECTRON_RELEASE)) -And ($env:GN_CONFIG -in "testing", "release")) { diff --git a/build/zip.py b/build/zip.py index ce7ae9722e0c7..ed863bfdca2be 100644 --- a/build/zip.py +++ b/build/zip.py @@ -5,7 +5,9 @@ import zipfile EXTENSIONS_TO_SKIP = [ - '.pdb' + '.pdb', + '.mojom.externs.js', + '.mojom.js', ] PATHS_TO_SKIP = [ diff --git a/script/generate-zip-manifest.py b/script/generate-zip-manifest.py new file mode 100755 index 0000000000000..c6cb5792d0e57 --- /dev/null +++ b/script/generate-zip-manifest.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import zipfile +import sys + +def main(zip_path, manifest_out): + with open(manifest_out, 'w') as manifest, \ + zipfile.ZipFile(zip_path, 'r', allowZip64=True) as z: + for name in sorted(z.namelist()): + manifest.write(name + '\n') + return 0 + +if __name__ == '__main__': + sys.exit(main(*sys.argv[1:])) diff --git a/script/zip_manifests/check-zip-manifest.py b/script/zip_manifests/check-zip-manifest.py new file mode 100755 index 0000000000000..6af55104e0d1a --- /dev/null +++ b/script/zip_manifests/check-zip-manifest.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +import zipfile +import sys + +def main(zip_path, manifest_in): + with open(manifest_in, 'r') as manifest, \ + zipfile.ZipFile(zip_path, 'r', allowZip64=True) as z: + files_in_zip = set(z.namelist()) + files_in_manifest = set([l.strip() for l in manifest.readlines()]) + added_files = files_in_zip - files_in_manifest + removed_files = files_in_manifest - files_in_zip + if added_files: + print("Files added to bundle:") + for f in sorted(list(added_files)): + print('+' + f) + if removed_files: + print("Files removed from bundle:") + for f in sorted(list(removed_files)): + print('-' + f) + if added_files or removed_files: + return 1 + else: + return 0 + +if __name__ == '__main__': + sys.exit(main(*sys.argv[1:])) diff --git a/script/zip_manifests/dist_zip.linux.arm.manifest b/script/zip_manifests/dist_zip.linux.arm.manifest new file mode 100644 index 0000000000000..33f4b843719df --- /dev/null +++ b/script/zip_manifests/dist_zip.linux.arm.manifest @@ -0,0 +1,69 @@ +LICENSE +LICENSES.chromium.html +chrome_100_percent.pak +chrome_200_percent.pak +electron +icudtl.dat +libEGL.so +libGLESv2.so +libffmpeg.so +locales/am.pak +locales/ar.pak +locales/bg.pak +locales/bn.pak +locales/ca.pak +locales/cs.pak +locales/da.pak +locales/de.pak +locales/el.pak +locales/en-GB.pak +locales/en-US.pak +locales/es-419.pak +locales/es.pak +locales/et.pak +locales/fa.pak +locales/fi.pak +locales/fil.pak +locales/fr.pak +locales/gu.pak +locales/he.pak +locales/hi.pak +locales/hr.pak +locales/hu.pak +locales/id.pak +locales/it.pak +locales/ja.pak +locales/kn.pak +locales/ko.pak +locales/lt.pak +locales/lv.pak +locales/ml.pak +locales/mr.pak +locales/ms.pak +locales/nb.pak +locales/nl.pak +locales/pl.pak +locales/pt-BR.pak +locales/pt-PT.pak +locales/ro.pak +locales/ru.pak +locales/sk.pak +locales/sl.pak +locales/sr.pak +locales/sv.pak +locales/sw.pak +locales/ta.pak +locales/te.pak +locales/th.pak +locales/tr.pak +locales/uk.pak +locales/vi.pak +locales/zh-CN.pak +locales/zh-TW.pak +natives_blob.bin +resources.pak +resources/default_app.asar +resources/electron.asar +snapshot_blob.bin +v8_context_snapshot.bin +version diff --git a/script/zip_manifests/dist_zip.linux.arm64.manifest b/script/zip_manifests/dist_zip.linux.arm64.manifest new file mode 100644 index 0000000000000..33f4b843719df --- /dev/null +++ b/script/zip_manifests/dist_zip.linux.arm64.manifest @@ -0,0 +1,69 @@ +LICENSE +LICENSES.chromium.html +chrome_100_percent.pak +chrome_200_percent.pak +electron +icudtl.dat +libEGL.so +libGLESv2.so +libffmpeg.so +locales/am.pak +locales/ar.pak +locales/bg.pak +locales/bn.pak +locales/ca.pak +locales/cs.pak +locales/da.pak +locales/de.pak +locales/el.pak +locales/en-GB.pak +locales/en-US.pak +locales/es-419.pak +locales/es.pak +locales/et.pak +locales/fa.pak +locales/fi.pak +locales/fil.pak +locales/fr.pak +locales/gu.pak +locales/he.pak +locales/hi.pak +locales/hr.pak +locales/hu.pak +locales/id.pak +locales/it.pak +locales/ja.pak +locales/kn.pak +locales/ko.pak +locales/lt.pak +locales/lv.pak +locales/ml.pak +locales/mr.pak +locales/ms.pak +locales/nb.pak +locales/nl.pak +locales/pl.pak +locales/pt-BR.pak +locales/pt-PT.pak +locales/ro.pak +locales/ru.pak +locales/sk.pak +locales/sl.pak +locales/sr.pak +locales/sv.pak +locales/sw.pak +locales/ta.pak +locales/te.pak +locales/th.pak +locales/tr.pak +locales/uk.pak +locales/vi.pak +locales/zh-CN.pak +locales/zh-TW.pak +natives_blob.bin +resources.pak +resources/default_app.asar +resources/electron.asar +snapshot_blob.bin +v8_context_snapshot.bin +version diff --git a/script/zip_manifests/dist_zip.linux.x64.manifest b/script/zip_manifests/dist_zip.linux.x64.manifest new file mode 100644 index 0000000000000..112797d435799 --- /dev/null +++ b/script/zip_manifests/dist_zip.linux.x64.manifest @@ -0,0 +1,71 @@ +LICENSE +LICENSES.chromium.html +chrome_100_percent.pak +chrome_200_percent.pak +electron +icudtl.dat +libEGL.so +libGLESv2.so +libffmpeg.so +locales/am.pak +locales/ar.pak +locales/bg.pak +locales/bn.pak +locales/ca.pak +locales/cs.pak +locales/da.pak +locales/de.pak +locales/el.pak +locales/en-GB.pak +locales/en-US.pak +locales/es-419.pak +locales/es.pak +locales/et.pak +locales/fa.pak +locales/fi.pak +locales/fil.pak +locales/fr.pak +locales/gu.pak +locales/he.pak +locales/hi.pak +locales/hr.pak +locales/hu.pak +locales/id.pak +locales/it.pak +locales/ja.pak +locales/kn.pak +locales/ko.pak +locales/lt.pak +locales/lv.pak +locales/ml.pak +locales/mr.pak +locales/ms.pak +locales/nb.pak +locales/nl.pak +locales/pl.pak +locales/pt-BR.pak +locales/pt-PT.pak +locales/ro.pak +locales/ru.pak +locales/sk.pak +locales/sl.pak +locales/sr.pak +locales/sv.pak +locales/sw.pak +locales/ta.pak +locales/te.pak +locales/th.pak +locales/tr.pak +locales/uk.pak +locales/vi.pak +locales/zh-CN.pak +locales/zh-TW.pak +natives_blob.bin +resources.pak +resources/default_app.asar +resources/electron.asar +snapshot_blob.bin +swiftshader/libEGL.so +swiftshader/libGLESv2.so +v8_context_snapshot.bin +version diff --git a/script/zip_manifests/dist_zip.linux.x86.manifest b/script/zip_manifests/dist_zip.linux.x86.manifest new file mode 100644 index 0000000000000..112797d435799 --- /dev/null +++ b/script/zip_manifests/dist_zip.linux.x86.manifest @@ -0,0 +1,71 @@ +LICENSE +LICENSES.chromium.html +chrome_100_percent.pak +chrome_200_percent.pak +electron +icudtl.dat +libEGL.so +libGLESv2.so +libffmpeg.so +locales/am.pak +locales/ar.pak +locales/bg.pak +locales/bn.pak +locales/ca.pak +locales/cs.pak +locales/da.pak +locales/de.pak +locales/el.pak +locales/en-GB.pak +locales/en-US.pak +locales/es-419.pak +locales/es.pak +locales/et.pak +locales/fa.pak +locales/fi.pak +locales/fil.pak +locales/fr.pak +locales/gu.pak +locales/he.pak +locales/hi.pak +locales/hr.pak +locales/hu.pak +locales/id.pak +locales/it.pak +locales/ja.pak +locales/kn.pak +locales/ko.pak +locales/lt.pak +locales/lv.pak +locales/ml.pak +locales/mr.pak +locales/ms.pak +locales/nb.pak +locales/nl.pak +locales/pl.pak +locales/pt-BR.pak +locales/pt-PT.pak +locales/ro.pak +locales/ru.pak +locales/sk.pak +locales/sl.pak +locales/sr.pak +locales/sv.pak +locales/sw.pak +locales/ta.pak +locales/te.pak +locales/th.pak +locales/tr.pak +locales/uk.pak +locales/vi.pak +locales/zh-CN.pak +locales/zh-TW.pak +natives_blob.bin +resources.pak +resources/default_app.asar +resources/electron.asar +snapshot_blob.bin +swiftshader/libEGL.so +swiftshader/libGLESv2.so +v8_context_snapshot.bin +version diff --git a/script/zip_manifests/dist_zip.mac.x64.manifest b/script/zip_manifests/dist_zip.mac.x64.manifest new file mode 100644 index 0000000000000..e80751291376c --- /dev/null +++ b/script/zip_manifests/dist_zip.mac.x64.manifest @@ -0,0 +1,312 @@ +Electron.app/ +Electron.app/Contents/ +Electron.app/Contents/Frameworks/ +Electron.app/Contents/Frameworks/Electron Framework.framework/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Electron Framework +Electron.app/Contents/Frameworks/Electron Framework.framework/Libraries +Electron.app/Contents/Frameworks/Electron Framework.framework/Resources +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/Info.plist +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/MainMenu.nib +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/am.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/am.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ar.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ar.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bg.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bg.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bn.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bn.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ca.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ca.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/chrome_100_percent.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/chrome_200_percent.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/crashpad_handler +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/cs.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/cs.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/da.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/da.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/de.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/de.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/el.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/el.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en_GB.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en_GB.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es_419.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es_419.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/et.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/et.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fa.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fa.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fi.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fi.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fil.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fil.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fr.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fr.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/gu.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/gu.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/he.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/he.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hi.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hi.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hr.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hr.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hu.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hu.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/icudtl.dat +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/id.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/id.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/it.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/it.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ja.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ja.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/kn.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/kn.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ko.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ko.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lt.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lt.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lv.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lv.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ml.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ml.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/mr.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/mr.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ms.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ms.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/natives_blob.bin +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/nb.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/nb.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/nl.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/nl.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pl.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pl.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pt_BR.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pt_BR.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pt_PT.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pt_PT.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/resources.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ro.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ro.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ru.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ru.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sk.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sk.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sl.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sl.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sr.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sr.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sv.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sv.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sw.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sw.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ta.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ta.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/te.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/te.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/th.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/th.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/tr.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/tr.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/uk.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/uk.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/v8_context_snapshot.bin +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/vi.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/vi.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/zh_CN.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/zh_CN.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/zh_TW.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/zh_TW.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/Current +Electron.app/Contents/Frameworks/Electron Helper.app/ +Electron.app/Contents/Frameworks/Electron Helper.app/Contents/ +Electron.app/Contents/Frameworks/Electron Helper.app/Contents/Info.plist +Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/ +Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper +Electron.app/Contents/Frameworks/Electron Helper.app/Contents/PkgInfo +Electron.app/Contents/Frameworks/Mantle.framework/ +Electron.app/Contents/Frameworks/Mantle.framework/Headers +Electron.app/Contents/Frameworks/Mantle.framework/Mantle +Electron.app/Contents/Frameworks/Mantle.framework/Modules +Electron.app/Contents/Frameworks/Mantle.framework/Resources +Electron.app/Contents/Frameworks/Mantle.framework/Versions/ +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/ +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/ +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLJSONAdapter.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLManagedObjectAdapter.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLModel+NSCoding.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLModel.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/MTLValueTransformer.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/Mantle.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSArray+MTLManipulationAdditions.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSDictionary+MTLManipulationAdditions.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSObject+MTLComparisonAdditions.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSValueTransformer+MTLInversionAdditions.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Headers/NSValueTransformer+MTLPredefinedTransformerAdditions.h +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Mantle +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Modules/ +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Modules/module.modulemap +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Resources/ +Electron.app/Contents/Frameworks/Mantle.framework/Versions/A/Resources/Info.plist +Electron.app/Contents/Frameworks/Mantle.framework/Versions/Current +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/ +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Headers +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Modules +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/ReactiveCocoa +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Resources +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/ +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/ +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/ +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/EXTKeyPathCoding.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/EXTScope.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSArray+RACSequenceAdditions.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSControl+RACCommandSupport.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSControl+RACTextSignalSupport.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSData+RACSupport.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSDictionary+RACSequenceAdditions.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSEnumerator+RACSequenceAdditions.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSFileHandle+RACSupport.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSIndexSet+RACSequenceAdditions.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSNotificationCenter+RACSupport.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACAppKitBindings.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACDeallocating.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACLifting.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACPropertySubscribing.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSObject+RACSelectorSignal.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSOrderedSet+RACSequenceAdditions.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSSet+RACSequenceAdditions.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSString+RACSequenceAdditions.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSString+RACSupport.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSText+RACSignalSupport.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSURLConnection+RACSupport.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/NSUserDefaults+RACSupport.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACBacktrace.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACBehaviorSubject.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACChannel.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACCommand.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACCompoundDisposable.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACDisposable.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACEvent.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACGroupedSignal.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACKVOChannel.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACMulticastConnection.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACQueueScheduler+Subclass.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACQueueScheduler.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACReplaySubject.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScheduler+Subclass.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScheduler.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACScopedDisposable.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSequence.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSerialDisposable.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSignal+Operations.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSignal.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACStream.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubject.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubscriber.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACSubscriptingAssignmentTrampoline.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTargetQueueScheduler.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTestScheduler.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACTuple.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/RACUnit.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/ReactiveCocoa.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Headers/metamacros.h +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Modules/ +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Modules/module.modulemap +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/ReactiveCocoa +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Resources/ +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/Resources/Info.plist +Electron.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/Current +Electron.app/Contents/Frameworks/Squirrel.framework/ +Electron.app/Contents/Frameworks/Squirrel.framework/Headers +Electron.app/Contents/Frameworks/Squirrel.framework/Modules +Electron.app/Contents/Frameworks/Squirrel.framework/Resources +Electron.app/Contents/Frameworks/Squirrel.framework/Squirrel +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/ +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/ +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/ +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/NSBundle+SQRLVersionExtensions.h +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/NSProcessInfo+SQRLVersionExtensions.h +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLDownloadedUpdate.h +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLUpdate.h +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/SQRLUpdater.h +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Headers/Squirrel.h +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Modules/ +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Modules/module.modulemap +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/Info.plist +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Squirrel +Electron.app/Contents/Frameworks/Squirrel.framework/Versions/Current +Electron.app/Contents/Info.plist +Electron.app/Contents/MacOS/ +Electron.app/Contents/MacOS/Electron +Electron.app/Contents/PkgInfo +Electron.app/Contents/Resources/ +Electron.app/Contents/Resources/am.lproj/ +Electron.app/Contents/Resources/ar.lproj/ +Electron.app/Contents/Resources/bg.lproj/ +Electron.app/Contents/Resources/bn.lproj/ +Electron.app/Contents/Resources/ca.lproj/ +Electron.app/Contents/Resources/cs.lproj/ +Electron.app/Contents/Resources/da.lproj/ +Electron.app/Contents/Resources/de.lproj/ +Electron.app/Contents/Resources/default_app.asar +Electron.app/Contents/Resources/el.lproj/ +Electron.app/Contents/Resources/electron.asar +Electron.app/Contents/Resources/electron.icns +Electron.app/Contents/Resources/en.lproj/ +Electron.app/Contents/Resources/en_GB.lproj/ +Electron.app/Contents/Resources/es.lproj/ +Electron.app/Contents/Resources/es_419.lproj/ +Electron.app/Contents/Resources/et.lproj/ +Electron.app/Contents/Resources/fa.lproj/ +Electron.app/Contents/Resources/fi.lproj/ +Electron.app/Contents/Resources/fil.lproj/ +Electron.app/Contents/Resources/fr.lproj/ +Electron.app/Contents/Resources/gu.lproj/ +Electron.app/Contents/Resources/he.lproj/ +Electron.app/Contents/Resources/hi.lproj/ +Electron.app/Contents/Resources/hr.lproj/ +Electron.app/Contents/Resources/hu.lproj/ +Electron.app/Contents/Resources/id.lproj/ +Electron.app/Contents/Resources/it.lproj/ +Electron.app/Contents/Resources/ja.lproj/ +Electron.app/Contents/Resources/kn.lproj/ +Electron.app/Contents/Resources/ko.lproj/ +Electron.app/Contents/Resources/lt.lproj/ +Electron.app/Contents/Resources/lv.lproj/ +Electron.app/Contents/Resources/ml.lproj/ +Electron.app/Contents/Resources/mr.lproj/ +Electron.app/Contents/Resources/ms.lproj/ +Electron.app/Contents/Resources/nb.lproj/ +Electron.app/Contents/Resources/nl.lproj/ +Electron.app/Contents/Resources/pl.lproj/ +Electron.app/Contents/Resources/pt_BR.lproj/ +Electron.app/Contents/Resources/pt_PT.lproj/ +Electron.app/Contents/Resources/ro.lproj/ +Electron.app/Contents/Resources/ru.lproj/ +Electron.app/Contents/Resources/sk.lproj/ +Electron.app/Contents/Resources/sl.lproj/ +Electron.app/Contents/Resources/sr.lproj/ +Electron.app/Contents/Resources/sv.lproj/ +Electron.app/Contents/Resources/sw.lproj/ +Electron.app/Contents/Resources/ta.lproj/ +Electron.app/Contents/Resources/te.lproj/ +Electron.app/Contents/Resources/th.lproj/ +Electron.app/Contents/Resources/tr.lproj/ +Electron.app/Contents/Resources/uk.lproj/ +Electron.app/Contents/Resources/vi.lproj/ +Electron.app/Contents/Resources/zh_CN.lproj/ +Electron.app/Contents/Resources/zh_TW.lproj/ +LICENSE +LICENSES.chromium.html +version diff --git a/script/zip_manifests/dist_zip.mac_mas.x64.manifest b/script/zip_manifests/dist_zip.mac_mas.x64.manifest new file mode 100644 index 0000000000000..c1f16be9c857b --- /dev/null +++ b/script/zip_manifests/dist_zip.mac_mas.x64.manifest @@ -0,0 +1,206 @@ +Electron.app/ +Electron.app/Contents/ +Electron.app/Contents/Frameworks/ +Electron.app/Contents/Frameworks/Electron Framework.framework/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Electron Framework +Electron.app/Contents/Frameworks/Electron Framework.framework/Libraries +Electron.app/Contents/Frameworks/Electron Framework.framework/Resources +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/Info.plist +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/MainMenu.nib +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/am.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/am.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ar.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ar.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bg.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bg.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bn.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/bn.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ca.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ca.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/chrome_100_percent.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/chrome_200_percent.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/cs.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/cs.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/da.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/da.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/de.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/de.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/el.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/el.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en_GB.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/en_GB.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es_419.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/es_419.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/et.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/et.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fa.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fa.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fi.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fi.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fil.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fil.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fr.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/fr.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/gu.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/gu.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/he.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/he.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hi.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hi.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hr.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hr.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hu.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/hu.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/icudtl.dat +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/id.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/id.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/it.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/it.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ja.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ja.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/kn.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/kn.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ko.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ko.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lt.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lt.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lv.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/lv.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ml.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ml.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/mr.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/mr.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ms.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ms.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/natives_blob.bin +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/nb.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/nb.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/nl.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/nl.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pl.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pl.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pt_BR.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pt_BR.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pt_PT.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/pt_PT.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/resources.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ro.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ro.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ru.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ru.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sk.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sk.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sl.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sl.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sr.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sr.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sv.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sv.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sw.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/sw.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ta.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/ta.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/te.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/te.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/th.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/th.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/tr.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/tr.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/uk.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/uk.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/v8_context_snapshot.bin +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/vi.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/vi.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/zh_CN.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/zh_CN.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/zh_TW.lproj/ +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/zh_TW.lproj/locale.pak +Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/Current +Electron.app/Contents/Frameworks/Electron Helper.app/ +Electron.app/Contents/Frameworks/Electron Helper.app/Contents/ +Electron.app/Contents/Frameworks/Electron Helper.app/Contents/Info.plist +Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/ +Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper +Electron.app/Contents/Frameworks/Electron Helper.app/Contents/PkgInfo +Electron.app/Contents/Info.plist +Electron.app/Contents/Library/ +Electron.app/Contents/Library/LoginItems/ +Electron.app/Contents/Library/LoginItems/Electron Login Helper.app/ +Electron.app/Contents/Library/LoginItems/Electron Login Helper.app/Contents/ +Electron.app/Contents/Library/LoginItems/Electron Login Helper.app/Contents/Info.plist +Electron.app/Contents/Library/LoginItems/Electron Login Helper.app/Contents/MacOS/ +Electron.app/Contents/Library/LoginItems/Electron Login Helper.app/Contents/MacOS/Electron Login Helper +Electron.app/Contents/Library/LoginItems/Electron Login Helper.app/Contents/PkgInfo +Electron.app/Contents/MacOS/ +Electron.app/Contents/MacOS/Electron +Electron.app/Contents/PkgInfo +Electron.app/Contents/Resources/ +Electron.app/Contents/Resources/am.lproj/ +Electron.app/Contents/Resources/ar.lproj/ +Electron.app/Contents/Resources/bg.lproj/ +Electron.app/Contents/Resources/bn.lproj/ +Electron.app/Contents/Resources/ca.lproj/ +Electron.app/Contents/Resources/cs.lproj/ +Electron.app/Contents/Resources/da.lproj/ +Electron.app/Contents/Resources/de.lproj/ +Electron.app/Contents/Resources/default_app.asar +Electron.app/Contents/Resources/el.lproj/ +Electron.app/Contents/Resources/electron.asar +Electron.app/Contents/Resources/electron.icns +Electron.app/Contents/Resources/en.lproj/ +Electron.app/Contents/Resources/en_GB.lproj/ +Electron.app/Contents/Resources/es.lproj/ +Electron.app/Contents/Resources/es_419.lproj/ +Electron.app/Contents/Resources/et.lproj/ +Electron.app/Contents/Resources/fa.lproj/ +Electron.app/Contents/Resources/fi.lproj/ +Electron.app/Contents/Resources/fil.lproj/ +Electron.app/Contents/Resources/fr.lproj/ +Electron.app/Contents/Resources/gu.lproj/ +Electron.app/Contents/Resources/he.lproj/ +Electron.app/Contents/Resources/hi.lproj/ +Electron.app/Contents/Resources/hr.lproj/ +Electron.app/Contents/Resources/hu.lproj/ +Electron.app/Contents/Resources/id.lproj/ +Electron.app/Contents/Resources/it.lproj/ +Electron.app/Contents/Resources/ja.lproj/ +Electron.app/Contents/Resources/kn.lproj/ +Electron.app/Contents/Resources/ko.lproj/ +Electron.app/Contents/Resources/lt.lproj/ +Electron.app/Contents/Resources/lv.lproj/ +Electron.app/Contents/Resources/ml.lproj/ +Electron.app/Contents/Resources/mr.lproj/ +Electron.app/Contents/Resources/ms.lproj/ +Electron.app/Contents/Resources/nb.lproj/ +Electron.app/Contents/Resources/nl.lproj/ +Electron.app/Contents/Resources/pl.lproj/ +Electron.app/Contents/Resources/pt_BR.lproj/ +Electron.app/Contents/Resources/pt_PT.lproj/ +Electron.app/Contents/Resources/ro.lproj/ +Electron.app/Contents/Resources/ru.lproj/ +Electron.app/Contents/Resources/sk.lproj/ +Electron.app/Contents/Resources/sl.lproj/ +Electron.app/Contents/Resources/sr.lproj/ +Electron.app/Contents/Resources/sv.lproj/ +Electron.app/Contents/Resources/sw.lproj/ +Electron.app/Contents/Resources/ta.lproj/ +Electron.app/Contents/Resources/te.lproj/ +Electron.app/Contents/Resources/th.lproj/ +Electron.app/Contents/Resources/tr.lproj/ +Electron.app/Contents/Resources/uk.lproj/ +Electron.app/Contents/Resources/vi.lproj/ +Electron.app/Contents/Resources/zh_CN.lproj/ +Electron.app/Contents/Resources/zh_TW.lproj/ +LICENSE +LICENSES.chromium.html +version diff --git a/script/zip_manifests/dist_zip.win.ia32.manifest b/script/zip_manifests/dist_zip.win.ia32.manifest new file mode 100644 index 0000000000000..b90ddfecd362f --- /dev/null +++ b/script/zip_manifests/dist_zip.win.ia32.manifest @@ -0,0 +1,73 @@ +LICENSE +LICENSES.chromium.html +chrome_100_percent.pak +chrome_200_percent.pak +d3dcompiler_47.dll +electron.exe +ffmpeg.dll +icudtl.dat +libEGL.dll +libGLESv2.dll +locales/am.pak +locales/ar.pak +locales/bg.pak +locales/bn.pak +locales/ca.pak +locales/cs.pak +locales/da.pak +locales/de.pak +locales/el.pak +locales/en-GB.pak +locales/en-US.pak +locales/es-419.pak +locales/es.pak +locales/et.pak +locales/fa.pak +locales/fi.pak +locales/fil.pak +locales/fr.pak +locales/gu.pak +locales/he.pak +locales/hi.pak +locales/hr.pak +locales/hu.pak +locales/id.pak +locales/it.pak +locales/ja.pak +locales/kn.pak +locales/ko.pak +locales/lt.pak +locales/lv.pak +locales/ml.pak +locales/mr.pak +locales/ms.pak +locales/nb.pak +locales/nl.pak +locales/pl.pak +locales/pt-BR.pak +locales/pt-PT.pak +locales/ro.pak +locales/ru.pak +locales/sk.pak +locales/sl.pak +locales/sr.pak +locales/sv.pak +locales/sw.pak +locales/ta.pak +locales/te.pak +locales/th.pak +locales/tr.pak +locales/uk.pak +locales/vi.pak +locales/zh-CN.pak +locales/zh-TW.pak +natives_blob.bin +osmesa.dll +resources.pak +resources/default_app.asar +resources/electron.asar +snapshot_blob.bin +swiftshader/libEGL.dll +swiftshader/libGLESv2.dll +v8_context_snapshot.bin +version diff --git a/script/zip_manifests/dist_zip.win.x64.manifest b/script/zip_manifests/dist_zip.win.x64.manifest new file mode 100644 index 0000000000000..b90ddfecd362f --- /dev/null +++ b/script/zip_manifests/dist_zip.win.x64.manifest @@ -0,0 +1,73 @@ +LICENSE +LICENSES.chromium.html +chrome_100_percent.pak +chrome_200_percent.pak +d3dcompiler_47.dll +electron.exe +ffmpeg.dll +icudtl.dat +libEGL.dll +libGLESv2.dll +locales/am.pak +locales/ar.pak +locales/bg.pak +locales/bn.pak +locales/ca.pak +locales/cs.pak +locales/da.pak +locales/de.pak +locales/el.pak +locales/en-GB.pak +locales/en-US.pak +locales/es-419.pak +locales/es.pak +locales/et.pak +locales/fa.pak +locales/fi.pak +locales/fil.pak +locales/fr.pak +locales/gu.pak +locales/he.pak +locales/hi.pak +locales/hr.pak +locales/hu.pak +locales/id.pak +locales/it.pak +locales/ja.pak +locales/kn.pak +locales/ko.pak +locales/lt.pak +locales/lv.pak +locales/ml.pak +locales/mr.pak +locales/ms.pak +locales/nb.pak +locales/nl.pak +locales/pl.pak +locales/pt-BR.pak +locales/pt-PT.pak +locales/ro.pak +locales/ru.pak +locales/sk.pak +locales/sl.pak +locales/sr.pak +locales/sv.pak +locales/sw.pak +locales/ta.pak +locales/te.pak +locales/th.pak +locales/tr.pak +locales/uk.pak +locales/vi.pak +locales/zh-CN.pak +locales/zh-TW.pak +natives_blob.bin +osmesa.dll +resources.pak +resources/default_app.asar +resources/electron.asar +snapshot_blob.bin +swiftshader/libEGL.dll +swiftshader/libGLESv2.dll +v8_context_snapshot.bin +version From bfd7412b642eaabf3aaa0837eea72b5b2959790e Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2019 17:34:15 +0900 Subject: [PATCH 64/94] remove non-existent event (#19168) --- docs/api/system-preferences.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/api/system-preferences.md b/docs/api/system-preferences.md index fe068f1f155b3..65e1f0bd4734c 100644 --- a/docs/api/system-preferences.md +++ b/docs/api/system-preferences.md @@ -35,14 +35,6 @@ Returns: * `invertedColorScheme` Boolean - `true` if an inverted color scheme, such as a high contrast theme, is being used, `false` otherwise. -### Event: 'appearance-changed' _macOS_ - -Returns: - -* `newAppearance` String - Can be `dark` or `light` - -**NOTE:** This event is only emitted after you have called `startAppLevelAppearanceTrackingOS` - ## Methods ### `systemPreferences.isDarkMode()` _macOS_ From 6a1d3e80c8d595eae9cd7d4ed69854c5a49eefb3 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Thu, 11 Jul 2019 15:31:46 -0700 Subject: [PATCH 65/94] fix: backport workaround for blockfile cache corruption on macOS (#19212) backport of https://chromium-review.googlesource.com/c/chromium/src/+/1347109 --- patches/common/chromium/.patches | 1 + ...uption_in_blockfile_on_os_x_10_14_by.patch | 89 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 patches/common/chromium/workaround_apparent_data_corruption_in_blockfile_on_os_x_10_14_by.patch diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index f21c4f55f32b3..1ce224b5f92b1 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -109,3 +109,4 @@ fix_uap_in_imagebitmaploader_filereaderloader.patch fire_caret_location_change_when_focus_moves_from_ui_to_content.patch do_not_show_virtual_keyboard_for_all_mouse_inputs.patch setup_the_observer_before_calling_displayvirtualkeyboard.patch +workaround_apparent_data_corruption_in_blockfile_on_os_x_10_14_by.patch diff --git a/patches/common/chromium/workaround_apparent_data_corruption_in_blockfile_on_os_x_10_14_by.patch b/patches/common/chromium/workaround_apparent_data_corruption_in_blockfile_on_os_x_10_14_by.patch new file mode 100644 index 0000000000000..69f9ada6c18fc --- /dev/null +++ b/patches/common/chromium/workaround_apparent_data_corruption_in_blockfile_on_os_x_10_14_by.patch @@ -0,0 +1,89 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maks Orlovich +Date: Thu, 22 Nov 2018 14:05:57 +0000 +Subject: Workaround apparent data corruption in blockfile on OS X 10.14 by + switching backends. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is slower, but it's better than not loading pages at all since important resources +got corrupted:( + +Bug: 899874 +Change-Id: I19f7eccff0c8aa119e522aee9cf728934906b917 +Reviewed-on: https://chromium-review.googlesource.com/c/1347109 +Commit-Queue: Maks Orlovich +Reviewed-by: Elly Fong-Jones +Reviewed-by: Bence Béky +Cr-Commit-Position: refs/heads/master@{#610404} + +diff --git a/components/network_session_configurator/browser/network_session_configurator.cc b/components/network_session_configurator/browser/network_session_configurator.cc +index 21d34cfab2c426ae367148433d21916fcd92c757..8d98b44fe167f2229dc7204027878f79be533b83 100644 +--- a/components/network_session_configurator/browser/network_session_configurator.cc ++++ b/components/network_session_configurator/browser/network_session_configurator.cc +@@ -27,6 +27,10 @@ + #include "net/third_party/quic/core/quic_packets.h" + #include "net/third_party/spdy/core/spdy_protocol.h" + ++#if defined(OS_MACOSX) && !defined(OS_IOS) ++#include "base/mac/mac_util.h" ++#endif ++ + namespace { + + // Map from name to value for all parameters associate with a field trial. +@@ -589,12 +593,25 @@ net::URLRequestContextBuilder::HttpCacheParams::Type ChooseCacheType( + if (opt_value.empty() || base::LowerCaseEqualsASCII(opt_value, "on")) + return net::URLRequestContextBuilder::HttpCacheParams::DISK_SIMPLE; + } ++ + const std::string experiment_name = + base::FieldTrialList::FindFullName("SimpleCacheTrial"); + if (base::StartsWith(experiment_name, "Disable", + base::CompareCase::INSENSITIVE_ASCII)) { + return net::URLRequestContextBuilder::HttpCacheParams::DISK_BLOCKFILE; + } ++ ++ // Blockfile breaks on OSX 10.14 (see https://crbug.com/899874); so use ++ // SimpleCache even when we don't enable it via experiment, as long as we ++ // don't force it off (not used at this time). This unfortunately ++ // muddles the experiment data, but as this was written to be considered for ++ // backport, having it behave differently than in stable would be a bigger ++ // problem. ++#if defined(OS_MACOSX) && !defined(OS_IOS) ++ if (base::mac::IsAtLeastOS10_14()) ++ return net::URLRequestContextBuilder::HttpCacheParams::DISK_SIMPLE; ++#endif // defined(OS_MACOSX) && !defined(OS_IOS) ++ + if (base::StartsWith(experiment_name, "ExperimentYes", + base::CompareCase::INSENSITIVE_ASCII)) { + return net::URLRequestContextBuilder::HttpCacheParams::DISK_SIMPLE; +diff --git a/components/network_session_configurator/browser/network_session_configurator_unittest.cc b/components/network_session_configurator/browser/network_session_configurator_unittest.cc +index 1e3f7b89c3c1ef5b3da2c89516acd13ac1ad283f..80e5d7ada3f0044f16aeb73891e20316c6cd2461 100644 +--- a/components/network_session_configurator/browser/network_session_configurator_unittest.cc ++++ b/components/network_session_configurator/browser/network_session_configurator_unittest.cc +@@ -25,6 +25,10 @@ + #include "net/url_request/url_request_context_builder.h" + #include "testing/gtest/include/gtest/gtest.h" + ++#if defined(OS_MACOSX) && !defined(OS_IOS) ++#include "base/mac/mac_util.h" ++#endif ++ + namespace network_session_configurator { + + class NetworkSessionConfiguratorTest : public testing::Test { +@@ -735,6 +739,12 @@ TEST_F(NetworkSessionConfiguratorTest, DefaultCacheBackend) { + #if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) + EXPECT_EQ(net::URLRequestContextBuilder::HttpCacheParams::DISK_SIMPLE, + ChooseCacheType(command_line)); ++#elif defined(OS_MACOSX) && !defined(OS_IOS) ++ EXPECT_EQ( ++ base::mac::IsAtLeastOS10_14() ++ ? net::URLRequestContextBuilder::HttpCacheParams::DISK_SIMPLE ++ : net::URLRequestContextBuilder::HttpCacheParams::DISK_BLOCKFILE, ++ ChooseCacheType(command_line)); + #else + EXPECT_EQ(net::URLRequestContextBuilder::HttpCacheParams::DISK_BLOCKFILE, + ChooseCacheType(command_line)); From 4e1c358d874f278f221668089a26d0b580499c71 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2019 20:47:56 -0500 Subject: [PATCH 66/94] feat: provide the frame URL with permission requests and checks (#18757) (#19204) * feat: provide the frame URL with permission requests and checks Also provides a handy isMainFrame property to determine if it is an iframe making the request * chore: refactor to use base::Value * chore: use SetKey over SetPath --- atom/browser/atom_permission_manager.cc | 23 ++++++++++++++++------- atom/browser/atom_permission_manager.h | 4 ++-- docs/api/session.md | 12 ++++++++---- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/atom/browser/atom_permission_manager.cc b/atom/browser/atom_permission_manager.cc index 71dfcd16ce4ef..64e7be2104ada 100644 --- a/atom/browser/atom_permission_manager.cc +++ b/atom/browser/atom_permission_manager.cc @@ -183,12 +183,14 @@ int AtomPermissionManager::RequestPermissionsWithDetails( const auto callback = base::Bind(&AtomPermissionManager::OnPermissionResponse, base::Unretained(this), request_id, i); - if (details == nullptr) { - request_handler_.Run(web_contents, permission, callback, - base::DictionaryValue()); - } else { - request_handler_.Run(web_contents, permission, callback, *details); - } + auto mutable_details = + details == nullptr ? base::DictionaryValue() : details->Clone(); + mutable_details.SetKey( + "requestingUrl", + base::Value(render_frame_host->GetLastCommittedURL().spec())); + mutable_details.SetKey( + "isMainFrame", base::Value(render_frame_host->GetParent() == nullptr)); + request_handler_.Run(web_contents, permission, callback, mutable_details); } return request_id; @@ -241,8 +243,15 @@ bool AtomPermissionManager::CheckPermissionWithDetails( } auto* web_contents = content::WebContents::FromRenderFrameHost(render_frame_host); + auto mutable_details = + details == nullptr ? base::DictionaryValue() : details->Clone(); + mutable_details.SetKey( + "requestingUrl", + base::Value(render_frame_host->GetLastCommittedURL().spec())); + mutable_details.SetKey( + "isMainFrame", base::Value(render_frame_host->GetParent() == nullptr)); return check_handler_.Run(web_contents, permission, requesting_origin, - *details); + mutable_details); } blink::mojom::PermissionStatus diff --git a/atom/browser/atom_permission_manager.h b/atom/browser/atom_permission_manager.h index 605db56bedcc8..07d8c1e4bb6fb 100644 --- a/atom/browser/atom_permission_manager.h +++ b/atom/browser/atom_permission_manager.h @@ -31,11 +31,11 @@ class AtomPermissionManager : public content::PermissionControllerDelegate { using RequestHandler = base::Callback; + const base::Value&)>; using CheckHandler = base::Callback; + const base::Value&)>; // Handler to dispatch permission requests in JS. void SetPermissionRequestHandler(const RequestHandler& handler); diff --git a/docs/api/session.md b/docs/api/session.md index 9884daf6b0ca3..97a3f123e9d2e 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -288,15 +288,17 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => { #### `ses.setPermissionRequestHandler(handler)` * `handler` Function | null - * `webContents` [WebContents](web-contents.md) - WebContents requesting the permission. + * `webContents` [WebContents](web-contents.md) - WebContents requesting the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. * `permission` String - Enum of 'media', 'geolocation', 'notifications', 'midiSysex', 'pointerLock', 'fullscreen', 'openExternal'. * `callback` Function * `permissionGranted` Boolean - Allow or deny the permission. * `details` Object - Some properties are only available on certain permission types. - * `externalURL` String - The url of the `openExternal` request. - * `mediaTypes` String[] - The types of media access being requested, elements can be `video` + * `externalURL` String (Optional) - The url of the `openExternal` request. + * `mediaTypes` String[] (Optional) - The types of media access being requested, elements can be `video` or `audio` + * `requestingUrl` String - The last URL the requesting frame loaded + * `isMainFrame` Boolean - Whether the frame making the request is the main frame Sets the handler which can be used to respond to permission requests for the `session`. Calling `callback(true)` will allow the permission and `callback(false)` will reject it. @@ -316,13 +318,15 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents #### `ses.setPermissionCheckHandler(handler)` * `handler` Function | null - * `webContents` [WebContents](web-contents.md) - WebContents checking the permission. + * `webContents` [WebContents](web-contents.md) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. * `permission` String - Enum of 'media'. * `requestingOrigin` String - The origin URL of the permission check * `details` Object - Some properties are only available on certain permission types. * `securityOrigin` String - The security orign of the `media` check. * `mediaType` String - The type of media access being requested, can be `video`, `audio` or `unknown` + * `requestingUrl` String - The last URL the requesting frame loaded + * `isMainFrame` Boolean - Whether the frame making the request is the main frame Sets the handler which can be used to respond to permission checks for the `session`. Returning `true` will allow the permission and `false` will reject it. From 489e40f76334d0679aa7b8a0f0211f30b21ad02a Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Sun, 14 Jul 2019 01:48:03 -0700 Subject: [PATCH 67/94] chore: revert key -> main change in window delegate listener (#19239) --- .../ui/cocoa/atom_ns_window_delegate.mm | 4 +-- spec/api-browser-window-spec.js | 27 ------------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/atom/browser/ui/cocoa/atom_ns_window_delegate.mm b/atom/browser/ui/cocoa/atom_ns_window_delegate.mm index 8b1d83aef8cd5..b96316a3ee753 100644 --- a/atom/browser/ui/cocoa/atom_ns_window_delegate.mm +++ b/atom/browser/ui/cocoa/atom_ns_window_delegate.mm @@ -83,11 +83,11 @@ - (NSRect)windowWillUseStandardFrame:(NSWindow*)window return frame; } -- (void)windowDidBecomeKey:(NSNotification*)notification { +- (void)windowDidBecomeMain:(NSNotification*)notification { shell_->NotifyWindowFocus(); } -- (void)windowDidResignKey:(NSNotification*)notification { +- (void)windowDidResignMain:(NSNotification*)notification { shell_->NotifyWindowBlur(); } diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index d309ad0253753..540a197b4eb6e 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -2330,33 +2330,6 @@ describe('BrowserWindow module', () => { }) }) - describe('focus event', () => { - it('should not emit if focusing on a main window with a modal open', (done) => { - const child = new BrowserWindow({ - parent: w, - modal: true, - show: false - }) - - child.once('ready-to-show', () => { - child.show() - }) - - child.on('show', () => { - w.once('focus', () => { - expect(child.isDestroyed()).to.equal(true) - done() - }) - w.focus() // this should not trigger the above listener - child.close() - }) - - // act - child.loadURL(server.url) - w.show() - }) - }) - describe('sheet-begin event', () => { let sheet = null From cdc11e1dc55bcfa8b876291f2db7a5b2a8ced73f Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 15 Jul 2019 07:56:18 -0700 Subject: [PATCH 68/94] Bump v4.2.7 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 0ce756d2fdde9..c30a8151be197 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.6 \ No newline at end of file +4.2.7 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 0e2fc8232c249..be8ff2e283321 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.6 + 4.2.7 CFBundleShortVersionString - 4.2.6 + 4.2.7 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index abb458dade3b4..8bb37d2f1a375 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,6,0 - PRODUCTVERSION 4,2,6,0 + FILEVERSION 4,2,7,0 + PRODUCTVERSION 4,2,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.6" + VALUE "FileVersion", "4.2.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.6" + VALUE "ProductVersion", "4.2.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 4044d49da792d..fc86b661fb781 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 7 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index 0a66850448546..a993f3d507557 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.6", + "version": "4.2.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7fdfef41a7203..45fbecf6e282f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.6", + "version": "4.2.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From bc93eed472f74bd29e2418da71ab19bc710981fc Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 15 Jul 2019 09:11:37 -0700 Subject: [PATCH 69/94] Revert "Bump v4.2.7" This reverts commit cdc11e1dc55bcfa8b876291f2db7a5b2a8ced73f. --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index c30a8151be197..0ce756d2fdde9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.7 \ No newline at end of file +4.2.6 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index be8ff2e283321..0e2fc8232c249 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.7 + 4.2.6 CFBundleShortVersionString - 4.2.7 + 4.2.6 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 8bb37d2f1a375..abb458dade3b4 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,7,0 - PRODUCTVERSION 4,2,7,0 + FILEVERSION 4,2,6,0 + PRODUCTVERSION 4,2,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.7" + VALUE "FileVersion", "4.2.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.7" + VALUE "ProductVersion", "4.2.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index fc86b661fb781..4044d49da792d 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 7 +#define ATOM_PATCH_VERSION 6 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index a993f3d507557..0a66850448546 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.7", + "version": "4.2.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 45fbecf6e282f..7fdfef41a7203 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.7", + "version": "4.2.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From bc218c6176fa1f072d6d76a7fe9114545306526e Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Mon, 15 Jul 2019 11:31:26 -0700 Subject: [PATCH 70/94] fix: don't try to dump swiftshader symbols on mac (#19258) --- BUILD.gn | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 95726c12d3565..f07e37ccb8567 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -746,24 +746,6 @@ if (is_mac) { ] } - extract_symbols("swiftshader_egl_syms") { - binary = "$root_out_dir/libswiftshader_libEGL.dylib" - symbol_dir = "$root_out_dir/breakpad_symbols" - dsym_file = "$root_out_dir/libswiftshader_libEGL.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libEGL.dylib" - deps = [ - "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL", - ] - } - - extract_symbols("swiftshader_gles_syms") { - binary = "$root_out_dir/libswiftshader_libGLESv2.dylib" - symbol_dir = "$root_out_dir/breakpad_symbols" - dsym_file = "$root_out_dir/libswiftshader_libGLESv2.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libGLESv2.dylib" - deps = [ - "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2", - ] - } - extract_symbols("crashpad_handler_syms") { binary = "$root_out_dir/crashpad_handler" symbol_dir = "$root_out_dir/breakpad_symbols" @@ -779,8 +761,6 @@ if (is_mac) { ":electron_app_syms", ":electron_framework_syms", ":electron_helper_syms", - ":swiftshader_egl_syms", - ":swiftshader_gles_syms", ] } } else { From 979dfc7903ce916f21e9a6f021a9de431949cb54 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Mon, 15 Jul 2019 14:33:54 -0700 Subject: [PATCH 71/94] fix: don't try to generate swiftshader symbols on arm (#19262) --- BUILD.gn | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index f07e37ccb8567..27932f430f3be 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -902,9 +902,13 @@ if (is_mac) { group("electron_symbols") { deps = [ ":electron_app_symbols", - ":swiftshader_egl_symbols", - ":swiftshader_gles_symbols", ] + if (target_cpu == "x86" || target_cpu == "x64") { + deps += [ + ":swiftshader_egl_symbols", + ":swiftshader_gles_symbols", + ] + } } } } From da9a91748226b7cb0b10f88a90b0fa0efa489085 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 15 Jul 2019 14:49:18 -0700 Subject: [PATCH 72/94] Bump v4.2.7 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 0ce756d2fdde9..c30a8151be197 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.6 \ No newline at end of file +4.2.7 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 0e2fc8232c249..be8ff2e283321 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.6 + 4.2.7 CFBundleShortVersionString - 4.2.6 + 4.2.7 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index abb458dade3b4..8bb37d2f1a375 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,6,0 - PRODUCTVERSION 4,2,6,0 + FILEVERSION 4,2,7,0 + PRODUCTVERSION 4,2,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.6" + VALUE "FileVersion", "4.2.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.6" + VALUE "ProductVersion", "4.2.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 4044d49da792d..fc86b661fb781 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 7 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index 0a66850448546..a993f3d507557 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.6", + "version": "4.2.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7fdfef41a7203..45fbecf6e282f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.6", + "version": "4.2.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 4fa8a866d4f9aae057c94f766462f2d0beb040f7 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 15 Jul 2019 14:55:42 -0700 Subject: [PATCH 73/94] Revert "Bump v4.2.7" This reverts commit da9a91748226b7cb0b10f88a90b0fa0efa489085. --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index c30a8151be197..0ce756d2fdde9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.7 \ No newline at end of file +4.2.6 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index be8ff2e283321..0e2fc8232c249 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.7 + 4.2.6 CFBundleShortVersionString - 4.2.7 + 4.2.6 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 8bb37d2f1a375..abb458dade3b4 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,7,0 - PRODUCTVERSION 4,2,7,0 + FILEVERSION 4,2,6,0 + PRODUCTVERSION 4,2,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.7" + VALUE "FileVersion", "4.2.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.7" + VALUE "ProductVersion", "4.2.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index fc86b661fb781..4044d49da792d 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 7 +#define ATOM_PATCH_VERSION 6 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index a993f3d507557..0a66850448546 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.7", + "version": "4.2.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 45fbecf6e282f..7fdfef41a7203 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.7", + "version": "4.2.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 36ea114ac0616e469e75ae94e6d53af48925e036 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 15 Jul 2019 15:05:57 -0700 Subject: [PATCH 74/94] Bump v4.2.7 --- VERSION | 2 +- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 0ce756d2fdde9..c30a8151be197 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.6 \ No newline at end of file +4.2.7 \ No newline at end of file diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 0e2fc8232c249..be8ff2e283321 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 4.2.6 + 4.2.7 CFBundleShortVersionString - 4.2.6 + 4.2.7 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index abb458dade3b4..8bb37d2f1a375 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -50,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,2,6,0 - PRODUCTVERSION 4,2,6,0 + FILEVERSION 4,2,7,0 + PRODUCTVERSION 4,2,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -68,12 +68,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "4.2.6" + VALUE "FileVersion", "4.2.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "4.2.6" + VALUE "ProductVersion", "4.2.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 4044d49da792d..fc86b661fb781 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 4 #define ATOM_MINOR_VERSION 2 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 7 // clang-format off // #define ATOM_PRE_RELEASE_VERSION // clang-format on diff --git a/package-lock.json b/package-lock.json index 0a66850448546..a993f3d507557 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.6", + "version": "4.2.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7fdfef41a7203..45fbecf6e282f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "4.2.6", + "version": "4.2.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 0b0f7ed7dc13400eb08c3cab2fea27e5eb69ac81 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Fri, 19 Jul 2019 15:19:23 -0700 Subject: [PATCH 75/94] fix: backport patch for leaking HTML5 video elements (#19347) --- patches/common/chromium/.patches | 1 + .../chromium/browser_compositor_mac.patch | 2 +- .../chromium/crashpad_http_status.patch | 2 +- ...rm_control_rendering_on_10_14_mojave.patch | 4 +- patches/common/chromium/mas-cfisobjc.patch | 6 +- .../chromium/mas_blink_no_private_api.patch | 6 +- .../common/chromium/mas_no_private_api.patch | 42 ++--- ...t_observers_when_controls_are_hidden.patch | 148 ++++++++++++++++++ .../render_widget_host_view_mac.patch | 8 +- .../chromium/tabbed_window_lagging.patch | 2 +- .../common/chromium/webview_cross_drag.patch | 2 +- 11 files changed, 186 insertions(+), 37 deletions(-) create mode 100644 patches/common/chromium/mediacontrols_disconnect_observers_when_controls_are_hidden.patch diff --git a/patches/common/chromium/.patches b/patches/common/chromium/.patches index 1ce224b5f92b1..c3a05e006a371 100644 --- a/patches/common/chromium/.patches +++ b/patches/common/chromium/.patches @@ -110,3 +110,4 @@ fire_caret_location_change_when_focus_moves_from_ui_to_content.patch do_not_show_virtual_keyboard_for_all_mouse_inputs.patch setup_the_observer_before_calling_displayvirtualkeyboard.patch workaround_apparent_data_corruption_in_blockfile_on_os_x_10_14_by.patch +mediacontrols_disconnect_observers_when_controls_are_hidden.patch diff --git a/patches/common/chromium/browser_compositor_mac.patch b/patches/common/chromium/browser_compositor_mac.patch index 9aad97014a7f1..cb6210eb21cbf 100644 --- a/patches/common/chromium/browser_compositor_mac.patch +++ b/patches/common/chromium/browser_compositor_mac.patch @@ -29,7 +29,7 @@ diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/cont index 92afcc77910610e53378f55adc003cc1bdf3109a..42bd6fd7c169de36c775471c68b456f1386ff666 100644 --- a/content/browser/renderer_host/browser_compositor_view_mac.mm +++ b/content/browser/renderer_host/browser_compositor_view_mac.mm -@@ -81,6 +81,12 @@ BrowserCompositorMac::~BrowserCompositorMac() { +@@ -81,6 +81,12 @@ DCHECK_EQ(1u, num_erased); } diff --git a/patches/common/chromium/crashpad_http_status.patch b/patches/common/chromium/crashpad_http_status.patch index 1acbc21e8fc82..4f7a9ff88725c 100644 --- a/patches/common/chromium/crashpad_http_status.patch +++ b/patches/common/chromium/crashpad_http_status.patch @@ -22,7 +22,7 @@ diff --git a/third_party/crashpad/crashpad/util/net/http_transport_mac.mm b/thir index 8d5f78cc6efc8b8e349958f51c78921a8c163c4e..a433bb357da5865144ade7d3663b1c9b36199f8e 100644 --- a/third_party/crashpad/crashpad/util/net/http_transport_mac.mm +++ b/third_party/crashpad/crashpad/util/net/http_transport_mac.mm -@@ -293,7 +293,7 @@ bool HTTPTransportMac::ExecuteSynchronously(std::string* response_body) { +@@ -293,7 +293,7 @@ static void Unschedule(CFReadStreamRef stream, return false; } NSInteger http_status = [http_response statusCode]; diff --git a/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch b/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch index 151a530df4e06..5bae6c27ef777 100644 --- a/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch +++ b/patches/common/chromium/mac_fix_form_control_rendering_on_10_14_mojave.patch @@ -56,7 +56,7 @@ diff --git a/services/service_manager/sandbox/mac/sandbox_mac.mm b/services/serv index d69fcc0d4c5c2471163280c03a9fd9366e05031d..cdd7b7f6723162d6875c4d11379837708bdde79d 100644 --- a/services/service_manager/sandbox/mac/sandbox_mac.mm +++ b/services/service_manager/sandbox/mac/sandbox_mac.mm -@@ -81,6 +81,21 @@ static_assert(arraysize(kDefaultSandboxTypeToResourceIDMapping) == +@@ -81,6 +81,21 @@ size_t(SANDBOX_TYPE_AFTER_LAST_TYPE), "sandbox type to resource id mapping incorrect"); @@ -78,7 +78,7 @@ index d69fcc0d4c5c2471163280c03a9fd9366e05031d..cdd7b7f6723162d6875c4d1137983770 } // namespace // Static variable declarations. -@@ -242,6 +257,9 @@ bool SandboxMac::Enable(SandboxType sandbox_type) { +@@ -242,6 +257,9 @@ if (!compiler.InsertBooleanParam(kSandboxMacOS1013, macos_1013)) return false; diff --git a/patches/common/chromium/mas-cfisobjc.patch b/patches/common/chromium/mas-cfisobjc.patch index c1dc41702a15b..180423f3b8ede 100644 --- a/patches/common/chromium/mas-cfisobjc.patch +++ b/patches/common/chromium/mas-cfisobjc.patch @@ -9,7 +9,7 @@ diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e25fe7ca21 100644 --- a/base/mac/foundation_util.mm +++ b/base/mac/foundation_util.mm -@@ -26,7 +26,6 @@ CFTypeID SecKeyGetTypeID(); +@@ -26,7 +26,6 @@ #if !defined(OS_IOS) CFTypeID SecACLGetTypeID(); CFTypeID SecTrustedApplicationGetTypeID(); @@ -17,7 +17,7 @@ index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e2 #endif } // extern "C" -@@ -325,8 +324,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) { +@@ -325,8 +324,7 @@ void SetBaseBundleID(const char* new_base_bundle_id) { const_cast(reinterpret_cast(cf_val)); DCHECK(!cf_val || CTFontGetTypeID() == CFGetTypeID(cf_val) || @@ -27,7 +27,7 @@ index 15fc15ba307e18f438852f00f41b2f5ecf7ff85f..7ca4e0ec5ca87f34e0baa22ba0b704e2 return ns_val; } -@@ -394,9 +392,6 @@ CFCast(const CFTypeRef& cf_val) { +@@ -394,9 +392,6 @@ CTFontRef NSToCFCast(NSFont* ns_val) { return (CTFontRef)(cf_val); } diff --git a/patches/common/chromium/mas_blink_no_private_api.patch b/patches/common/chromium/mas_blink_no_private_api.patch index d687746c3eceb..3870d2481d5d6 100644 --- a/patches/common/chromium/mas_blink_no_private_api.patch +++ b/patches/common/chromium/mas_blink_no_private_api.patch @@ -18,7 +18,7 @@ index 94afefcee81b87c05bf9b1199d90d3d4b5ea84a6..2ec7f04c71824b47de1ddbf1f0e8625d extern "C" { // Kill ring calls. Would be better to use NSKillRing.h, but that's not -@@ -39,38 +40,53 @@ NSString* _NSYankFromKillRing(); +@@ -39,38 +40,53 @@ void _NSNewKillRingSequence(); void _NSSetKillRingToYankedState(); } @@ -92,7 +92,7 @@ index 7a1260db0a139f9f3f8a823af2c220f36162812a..bf9cf7046e2fc9cdfee5b92f2a348185 namespace blink { -@@ -73,10 +75,12 @@ bool ThemePainterMac::PaintTextField(const Node* node, +@@ -73,10 +75,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame, // behavior change while remaining a fragile solution. // https://bugs.chromium.org/p/chromium/issues/detail?id=658085#c3 if (!use_ns_text_field_cell) { @@ -105,7 +105,7 @@ index 7a1260db0a139f9f3f8a823af2c220f36162812a..bf9cf7046e2fc9cdfee5b92f2a348185 return false; } -@@ -162,10 +166,12 @@ bool ThemePainterMac::PaintTextArea(const Node* node, +@@ -162,10 +166,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame, const PaintInfo& paint_info, const IntRect& r) { LocalCurrentGraphicsContext local_context(paint_info.context, r); diff --git a/patches/common/chromium/mas_no_private_api.patch b/patches/common/chromium/mas_no_private_api.patch index e63ef305d557a..3df25dff8d7b0 100644 --- a/patches/common/chromium/mas_no_private_api.patch +++ b/patches/common/chromium/mas_no_private_api.patch @@ -41,7 +41,7 @@ diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/cont index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518325ef70a 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm -@@ -135,6 +135,7 @@ NSDictionary* attributeToMethodNameMap = nil; +@@ -135,6 +135,7 @@ // VoiceOver uses -1 to mean "no limit" for AXResultsLimit. const int kAXResultsLimitNoLimit = -1; @@ -49,7 +49,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 extern "C" { // The following are private accessibility APIs required for cursor navigation -@@ -341,6 +342,7 @@ NSAttributedString* GetAttributedTextForTextMarkerRange( +@@ -341,6 +342,7 @@ void AddMisspelledTextAttributes( AddMisspelledTextAttributes(text_only_objects, attributed_text); return [attributed_text attributedSubstringFromRange:range]; } @@ -57,7 +57,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns an autoreleased copy of the AXNodeData's attribute. NSString* NSStringForStringAttribute( -@@ -595,7 +597,9 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -595,7 +597,9 @@ + (void)initialize { {NSAccessibilityDOMIdentifierAttribute, @"domIdentifier"}, {NSAccessibilityEditableAncestorAttribute, @"editableAncestor"}, {NSAccessibilityEnabledAttribute, @"enabled"}, @@ -67,7 +67,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 {NSAccessibilityExpandedAttribute, @"expanded"}, {NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"}, {NSAccessibilityFocusedAttribute, @"focused"}, -@@ -630,13 +634,17 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -630,13 +634,17 @@ + (void)initialize { {NSAccessibilityRowsAttribute, @"rows"}, // TODO(aboxhall): expose // NSAccessibilityServesAsTitleForUIElementsAttribute @@ -85,7 +85,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 {NSAccessibilitySizeAttribute, @"size"}, {NSAccessibilitySortDirectionAttribute, @"sortDirection"}, {NSAccessibilitySubroleAttribute, @"subrole"}, -@@ -1114,6 +1122,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -1114,6 +1122,7 @@ - (NSNumber*)enabled { ax::mojom::Restriction::kDisabled]; } @@ -93,7 +93,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns a text marker that points to the last character in the document that // can be selected with VoiceOver. - (id)endTextMarker { -@@ -1124,6 +1133,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -1124,6 +1133,7 @@ - (id)endTextMarker { BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtEndOfAnchor()); } @@ -101,7 +101,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 - (NSNumber*)expanded { if (![self instanceActive]) -@@ -2029,6 +2039,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2029,6 +2039,7 @@ - (NSValue*)selectedTextRange { return [NSValue valueWithRange:NSMakeRange(selStart, selLength)]; } @@ -109,7 +109,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 - (id)selectedTextMarkerRange { if (![self instanceActive]) return nil; -@@ -2061,6 +2072,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2061,6 +2072,7 @@ - (id)selectedTextMarkerRange { anchorAffinity, *focusObject, focusOffset, focusAffinity)); } @@ -117,7 +117,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 - (NSValue*)size { if (![self instanceActive]) -@@ -2093,6 +2105,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2093,6 +2105,7 @@ - (NSString*)sortDirection { return nil; } @@ -125,7 +125,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns a text marker that points to the first character in the document that // can be selected with VoiceOver. - (id)startTextMarker { -@@ -2103,6 +2116,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2103,6 +2116,7 @@ - (id)startTextMarker { BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0); return CreateTextMarker(position->CreatePositionAtStartOfAnchor()); } @@ -133,7 +133,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 // Returns a subrole based upon the role. - (NSString*) subrole { -@@ -2405,12 +2419,14 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2405,12 +2419,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range { NSMutableAttributedString* attributedValue = [[[NSMutableAttributedString alloc] initWithString:value] autorelease]; @@ -148,7 +148,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 return [attributedValue attributedSubstringFromRange:range]; } -@@ -2527,6 +2543,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2527,6 +2543,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute return nil; } @@ -156,7 +156,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) { BrowserAccessibilityPositionInstance position = CreatePositionFromTextMarker(parameter); -@@ -2704,6 +2721,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2704,6 +2721,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute NSString* text = GetTextForTextMarkerRange(parameter); return [NSNumber numberWithInt:[text length]]; } @@ -164,7 +164,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 if ([attribute isEqualToString: NSAccessibilityBoundsForRangeParameterizedAttribute]) { -@@ -2741,6 +2759,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2741,6 +2759,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute return nil; } @@ -172,7 +172,7 @@ index 07e9862b76a920438a779f22d67d3a45ab39abf7..efa52aa9de2f819f28109978c8cef518 if ([attribute isEqualToString: NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) { BrowserAccessibilityPositionInstance position = -@@ -2820,6 +2839,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired"; +@@ -2820,6 +2839,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition( return @(child->GetIndexInParent()); } @@ -184,7 +184,7 @@ diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm index 8e32a08226079c6d7515b8e784babacb3226ecd6..93bb7273684fa529bdc6049af2ed379f8b059397 100644 --- a/content/browser/accessibility/browser_accessibility_manager_mac.mm +++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm -@@ -437,6 +437,7 @@ NSDictionary* BrowserAccessibilityManagerMac:: +@@ -437,6 +437,7 @@ [user_info setObject:native_focus_object forKey:NSAccessibilityTextChangeElement]; @@ -192,7 +192,7 @@ index 8e32a08226079c6d7515b8e784babacb3226ecd6..93bb7273684fa529bdc6049af2ed379f id selected_text = [native_focus_object selectedTextMarkerRange]; if (selected_text) { NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute = -@@ -444,6 +445,7 @@ NSDictionary* BrowserAccessibilityManagerMac:: +@@ -444,6 +445,7 @@ [user_info setObject:selected_text forKey:NSAccessibilitySelectedTextMarkerRangeAttribute]; } @@ -220,7 +220,7 @@ index 1e2cc38d3868ceccf8e45f5f82f57bcaa478f982..daa934c345e2686fd2174b7721d0f69a namespace content { -@@ -38,6 +40,7 @@ namespace { +@@ -38,6 +40,7 @@ void _LSSetApplicationLaunchServicesServerConnectionStatus( // This disconnects from the window server, and then indicates that Chrome // should continue execution without access to launchservicesd. void DisconnectWindowServer() { @@ -248,7 +248,7 @@ index 8b2092ec78f9f6bc1bd4c8af21ada74538f54d29..4f2ee8e2809790df68aedcee09462631 extern "C" { // Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and // `Karabiner` [3] to programmatically control the Bluetooth state. Calling the -@@ -47,6 +48,7 @@ extern "C" { +@@ -47,6 +48,7 @@ // [4] https://support.apple.com/kb/PH25091 void IOBluetoothPreferenceSetControllerPowerState(int state); } @@ -256,7 +256,7 @@ index 8b2092ec78f9f6bc1bd4c8af21ada74538f54d29..4f2ee8e2809790df68aedcee09462631 namespace { -@@ -120,8 +122,10 @@ BluetoothAdapterMac::BluetoothAdapterMac() +@@ -120,8 +122,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { controller_state_function_( base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState, base::Unretained(this))), @@ -267,7 +267,7 @@ index 8b2092ec78f9f6bc1bd4c8af21ada74538f54d29..4f2ee8e2809790df68aedcee09462631 should_update_name_(true), classic_discovery_manager_( BluetoothDiscoveryManagerMac::CreateClassic(this)), -@@ -314,8 +318,12 @@ bool BluetoothAdapterMac::IsLowEnergyAvailable() { +@@ -314,8 +318,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) { } bool BluetoothAdapterMac::SetPoweredImpl(bool powered) { diff --git a/patches/common/chromium/mediacontrols_disconnect_observers_when_controls_are_hidden.patch b/patches/common/chromium/mediacontrols_disconnect_observers_when_controls_are_hidden.patch new file mode 100644 index 0000000000000..82601324c12bb --- /dev/null +++ b/patches/common/chromium/mediacontrols_disconnect_observers_when_controls_are_hidden.patch @@ -0,0 +1,148 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Michael Lippautz +Date: Wed, 26 Jun 2019 20:21:46 +0000 +Subject: MediaControls: Disconnect observers when controls are hidden + +Disconnect ResizeObserver from media controls when the controls are +hidden. Otherwise, the obervsers are have pending activities (are +observed) which makes them roots for the object graph, ultimately +keeping elements (including e.g. HTMLVideoElement) and nodes alive. + +Bug: 969049 +Change-Id: I07a4470170f187631db307188f6cbe0052aa7d8c +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1677053 +Commit-Queue: Michael Lippautz +Reviewed-by: Tommy Steimel +Reviewed-by: Kentaro Hara +Cr-Commit-Position: refs/heads/master@{#672629} + +diff --git a/third_party/blink/renderer/modules/media_controls/elements/media_control_slider_element.cc b/third_party/blink/renderer/modules/media_controls/elements/media_control_slider_element.cc +index e1f55e00cafbfbca376092e8e332ca68f14954b7..15ab3cbe33da36dffb1ee1cda4031a020362eef0 100644 +--- a/third_party/blink/renderer/modules/media_controls/elements/media_control_slider_element.cc ++++ b/third_party/blink/renderer/modules/media_controls/elements/media_control_slider_element.cc +@@ -91,7 +91,7 @@ MediaControlSliderElement::MediaControlSliderElement( + new MediaControlSliderElementResizeObserverDelegate(this))) { + setType(InputTypeNames::range); + setAttribute(HTMLNames::stepAttr, "any"); +- resize_observer_->observe(this); ++ OnControlsShown(); + } + + Element& MediaControlSliderElement::GetTrackElement() { +@@ -172,4 +172,12 @@ void MediaControlSliderElement::Trace(blink::Visitor* visitor) { + MediaControlInputElement::Trace(visitor); + } + ++void MediaControlSliderElement::OnControlsShown() { ++ resize_observer_->observe(this); ++} ++ ++void MediaControlSliderElement::OnControlsHidden() { ++ resize_observer_->disconnect(); ++} ++ + } // namespace blink +diff --git a/third_party/blink/renderer/modules/media_controls/elements/media_control_slider_element.h b/third_party/blink/renderer/modules/media_controls/elements/media_control_slider_element.h +index 8f5a631fa87e5f6ce9c94f8f8eefcd4152df1c1f..228886cfb1f1bbb244350e9c52f247bf41d6dbfc 100644 +--- a/third_party/blink/renderer/modules/media_controls/elements/media_control_slider_element.h ++++ b/third_party/blink/renderer/modules/media_controls/elements/media_control_slider_element.h +@@ -33,6 +33,9 @@ class MODULES_EXPORT MediaControlSliderElement + // simplicity; deliberately ignores pinch zoom's pageScaleFactor). + int TrackWidth(); + ++ void OnControlsShown(); ++ void OnControlsHidden(); ++ + protected: + class MediaControlSliderElementResizeObserverDelegate; + +diff --git a/third_party/blink/renderer/modules/media_controls/elements/media_control_timeline_element.cc b/third_party/blink/renderer/modules/media_controls/elements/media_control_timeline_element.cc +index 62ef007e5f6d5bbe3cae8ab7760251256ce57efb..4022da87d0ad39e34f05423990a9df598955ed50 100644 +--- a/third_party/blink/renderer/modules/media_controls/elements/media_control_timeline_element.cc ++++ b/third_party/blink/renderer/modules/media_controls/elements/media_control_timeline_element.cc +@@ -272,10 +272,12 @@ void MediaControlTimelineElement::OnControlsHidden() { + + // End scrubbing state. + is_touching_ = false; ++ MediaControlSliderElement::OnControlsHidden(); + } + + void MediaControlTimelineElement::OnControlsShown() { + controls_hidden_ = false; ++ MediaControlSliderElement::OnControlsShown(); + } + + bool MediaControlTimelineElement::EndScrubbingEvent(Event& event) { +diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc b/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc +index 5ca3a5f8314bc67d498b3c1d8306f550223781d3..37321c8331d80899afa632327540fd2199fc0907 100644 +--- a/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc ++++ b/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc +@@ -911,6 +911,8 @@ void MediaControlsImpl::MaybeShow() { + loading_panel_->OnControlsShown(); + + timeline_->OnControlsShown(); ++ if (volume_slider_) ++ volume_slider_->OnControlsShown(); + UpdateCSSClassFromState(); + UpdateActingAsAudioControls(); + } +@@ -936,6 +938,8 @@ void MediaControlsImpl::Hide() { + EndScrubbing(); + } + timeline_->OnControlsHidden(); ++ if (volume_slider_) ++ volume_slider_->OnControlsHidden(); + + UpdateCSSClassFromState(); + +diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc b/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc +index 4bd7baed6c95deccfea6ac1f7c8998ad64c64e05..15a786c21b7f84d12e5ac87705b8ff0f54127765 100644 +--- a/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc ++++ b/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc +@@ -14,10 +14,12 @@ + #include "third_party/blink/public/platform/web_mouse_event.h" + #include "third_party/blink/public/platform/web_screen_info.h" + #include "third_party/blink/public/platform/web_size.h" ++#include "third_party/blink/renderer/bindings/core/v8/v8_gc_controller.h" + #include "third_party/blink/renderer/core/css/css_property_value_set.h" + #include "third_party/blink/renderer/core/css/document_style_environment_variables.h" + #include "third_party/blink/renderer/core/css/style_engine.h" + #include "third_party/blink/renderer/core/dom/document.h" ++#include "third_party/blink/renderer/core/dom/document_parser.h" + #include "third_party/blink/renderer/core/dom/element_traversal.h" + #include "third_party/blink/renderer/core/dom/events/event.h" + #include "third_party/blink/renderer/core/dom/text.h" +@@ -1159,6 +1161,33 @@ TEST_F(MediaControlsImplTest, + EXPECT_EQ(nullptr, weak_persistent_video); + } + ++TEST_F(MediaControlsImplTest, ++ RemovingFromDocumentWhenResettingSrcAllowsReclamation) { ++ // Regression test: https://crbug.com/918064 ++ // ++ // Test ensures that unified heap garbage collections are able to collect ++ // detached HTMLVideoElements. The tricky part is that ResizeObserver's are ++ // treated as roots as long as they have observations which prevent the video ++ // element from being collected. ++ ++ auto page_holder = std::make_unique(); ++ page_holder->GetDocument().write("