From 6d5b225ac51b8217d993af48153e476a27b5dde9 Mon Sep 17 00:00:00 2001 From: Heilig Benedek Date: Tue, 29 Jan 2019 23:58:45 +0100 Subject: [PATCH 01/72] feat: add registerAccelerator flag to allow menu items to optionally skip accelerator registration (backport: 3-1-x) (#15892) * feat: add registerAccelerator flag to allow menu items to skip registration * docs: add docs for registerAccelerator --- atom/browser/api/atom_api_menu.cc | 8 ++++++++ atom/browser/api/atom_api_menu.h | 2 ++ atom/browser/ui/accelerator_util.cc | 8 +++++--- atom/browser/ui/atom_menu_model.cc | 8 ++++++++ atom/browser/ui/atom_menu_model.h | 4 ++++ docs/api/menu-item.md | 2 ++ lib/browser/api/menu-item-roles.js | 16 ++++++++++++---- lib/browser/api/menu-item.js | 1 + lib/browser/api/menu.js | 1 + 9 files changed, 43 insertions(+), 7 deletions(-) diff --git a/atom/browser/api/atom_api_menu.cc b/atom/browser/api/atom_api_menu.cc index 1c4f4fcf41e55..48b1917b92f6e 100644 --- a/atom/browser/api/atom_api_menu.cc +++ b/atom/browser/api/atom_api_menu.cc @@ -41,6 +41,8 @@ void Menu::AfterInit(v8::Isolate* isolate) { delegate.Get("isCommandIdEnabled", &is_enabled_); delegate.Get("isCommandIdVisible", &is_visible_); delegate.Get("getAcceleratorForCommandId", &get_accelerator_); + delegate.Get("shouldRegisterAcceleratorForCommandId", + &should_register_accelerator_); delegate.Get("executeCommand", &execute_command_); delegate.Get("menuWillShow", &menu_will_show_); } @@ -74,6 +76,12 @@ bool Menu::GetAcceleratorForCommandIdWithParams( return mate::ConvertFromV8(isolate(), val, accelerator); } +bool Menu::ShouldRegisterAcceleratorForCommandId(int command_id) const { + v8::Locker locker(isolate()); + v8::HandleScope handle_scope(isolate()); + return should_register_accelerator_.Run(GetWrapper(), command_id); +} + void Menu::ExecuteCommand(int command_id, int flags) { v8::Locker locker(isolate()); v8::HandleScope handle_scope(isolate()); diff --git a/atom/browser/api/atom_api_menu.h b/atom/browser/api/atom_api_menu.h index 26f2b679b6b7f..0f45774f1cf0f 100644 --- a/atom/browser/api/atom_api_menu.h +++ b/atom/browser/api/atom_api_menu.h @@ -51,6 +51,7 @@ class Menu : public mate::TrackableObject, int command_id, bool use_default_accelerator, ui::Accelerator* accelerator) const override; + bool ShouldRegisterAcceleratorForCommandId(int command_id) const override; void ExecuteCommand(int command_id, int event_flags) override; void MenuWillShow(ui::SimpleMenuModel* source) override; @@ -101,6 +102,7 @@ class Menu : public mate::TrackableObject, base::Callback, int)> is_visible_; base::Callback(v8::Local, int, bool)> get_accelerator_; + base::Callback, int)> should_register_accelerator_; base::Callback, v8::Local, int)> execute_command_; base::Callback)> menu_will_show_; diff --git a/atom/browser/ui/accelerator_util.cc b/atom/browser/ui/accelerator_util.cc index 8a8067c5a7887..4f13038cc2545 100644 --- a/atom/browser/ui/accelerator_util.cc +++ b/atom/browser/ui/accelerator_util.cc @@ -78,9 +78,11 @@ void GenerateAcceleratorTable(AcceleratorTable* table, GenerateAcceleratorTable(table, submodel); } else { ui::Accelerator accelerator; - if (model->GetAcceleratorAtWithParams(i, true, &accelerator)) { - MenuItem item = {i, model}; - (*table)[accelerator] = item; + if (model->ShouldRegisterAcceleratorAt(i)) { + if (model->GetAcceleratorAtWithParams(i, true, &accelerator)) { + MenuItem item = {i, model}; + (*table)[accelerator] = item; + } } } } diff --git a/atom/browser/ui/atom_menu_model.cc b/atom/browser/ui/atom_menu_model.cc index 83e23c42ed898..ba75c51dd96dd 100644 --- a/atom/browser/ui/atom_menu_model.cc +++ b/atom/browser/ui/atom_menu_model.cc @@ -43,6 +43,14 @@ bool AtomMenuModel::GetAcceleratorAtWithParams( return false; } +bool AtomMenuModel::ShouldRegisterAcceleratorAt(int index) const { + if (delegate_) { + return delegate_->ShouldRegisterAcceleratorForCommandId( + GetCommandIdAt(index)); + } + return true; +} + void AtomMenuModel::MenuWillClose() { ui::SimpleMenuModel::MenuWillClose(); for (Observer& observer : observers_) { diff --git a/atom/browser/ui/atom_menu_model.h b/atom/browser/ui/atom_menu_model.h index efdd8ec9d8834..6b3e2e57a373b 100644 --- a/atom/browser/ui/atom_menu_model.h +++ b/atom/browser/ui/atom_menu_model.h @@ -23,6 +23,9 @@ class AtomMenuModel : public ui::SimpleMenuModel { bool use_default_accelerator, ui::Accelerator* accelerator) const = 0; + virtual bool ShouldRegisterAcceleratorForCommandId( + int command_id) const = 0; + private: // ui::SimpleMenuModel::Delegate: bool GetAcceleratorForCommandId( @@ -52,6 +55,7 @@ class AtomMenuModel : public ui::SimpleMenuModel { bool GetAcceleratorAtWithParams(int index, bool use_default_accelerator, ui::Accelerator* accelerator) const; + bool ShouldRegisterAcceleratorAt(int index) const; // ui::SimpleMenuModel: void MenuWillClose() override; diff --git a/docs/api/menu-item.md b/docs/api/menu-item.md index c291fc03b0649..24e1a7981d0eb 100644 --- a/docs/api/menu-item.md +++ b/docs/api/menu-item.md @@ -27,6 +27,8 @@ See [`Menu`](menu.md) for examples. * `visible` Boolean (optional) - If false, the menu item will be entirely hidden. * `checked` Boolean (optional) - Should only be specified for `checkbox` or `radio` type menu items. + * `registerAccelerator` Boolean (optional) - If false, the accelerator won't be registered + with the system, but it will still be displayed. Defaults to true. * `submenu` (MenuItemConstructorOptions[] | [Menu](menu.md)) (optional) - Should be specified for `submenu` type menu items. If `submenu` is specified, the `type: 'submenu'` can be omitted. If the value is not a [`Menu`](menu.md) then it will be automatically converted to one using diff --git a/lib/browser/api/menu-item-roles.js b/lib/browser/api/menu-item-roles.js index 3518796a53ebb..3b5b302eab245 100644 --- a/lib/browser/api/menu-item-roles.js +++ b/lib/browser/api/menu-item-roles.js @@ -14,12 +14,14 @@ const roles = { copy: { label: 'Copy', accelerator: 'CommandOrControl+C', - webContentsMethod: 'copy' + webContentsMethod: 'copy', + registerAccelerator: false }, cut: { label: 'Cut', accelerator: 'CommandOrControl+X', - webContentsMethod: 'cut' + webContentsMethod: 'cut', + registerAccelerator: false }, delete: { label: 'Delete', @@ -57,12 +59,14 @@ const roles = { paste: { label: 'Paste', accelerator: 'CommandOrControl+V', - webContentsMethod: 'paste' + webContentsMethod: 'paste', + registerAccelerator: false }, pasteandmatchstyle: { label: 'Paste and Match Style', accelerator: 'Shift+CommandOrControl+V', - webContentsMethod: 'pasteAndMatchStyle' + webContentsMethod: 'pasteAndMatchStyle', + registerAccelerator: false }, quit: { get label () { @@ -241,6 +245,10 @@ exports.getDefaultAccelerator = (role) => { if (roles.hasOwnProperty(role)) return roles[role].accelerator } +exports.shouldRegisterAccelerator = (role) => { + return roles.hasOwnProperty(role) ? roles[role].registerAccelerator : true +} + exports.getDefaultSubmenu = (role) => { if (!roles.hasOwnProperty(role)) return diff --git a/lib/browser/api/menu-item.js b/lib/browser/api/menu-item.js index 1f97541607bfe..42cc556eda40f 100644 --- a/lib/browser/api/menu-item.js +++ b/lib/browser/api/menu-item.js @@ -36,6 +36,7 @@ const MenuItem = function (options) { this.overrideProperty('enabled', true) this.overrideProperty('visible', true) this.overrideProperty('checked', false) + this.overrideProperty('registerAccelerator', roles.shouldRegisterAccelerator(this.role)) if (!MenuItem.types.includes(this.type)) { throw new Error(`Unknown menu item type: ${this.type}`) diff --git a/lib/browser/api/menu.js b/lib/browser/api/menu.js index dcc446587913f..b92ea24e785bf 100644 --- a/lib/browser/api/menu.js +++ b/lib/browser/api/menu.js @@ -24,6 +24,7 @@ const delegate = { if (command.accelerator != null) return command.accelerator if (useDefaultAccelerator) return command.getDefaultRoleAccelerator() }, + shouldRegisterAcceleratorForCommandId: (menu, id) => menu.commandsMap[id] ? menu.commandsMap[id].registerAccelerator : undefined, executeCommand: (menu, event, id) => { const command = menu.commandsMap[id] if (!command) return From ce33169b713869fcc16aadedbaf82fbb30f321a1 Mon Sep 17 00:00:00 2001 From: Nitish Sakhawalkar Date: Tue, 29 Jan 2019 15:58:59 -0800 Subject: [PATCH 02/72] fix: correctly destroy spellcheck client (#16526) * fix: Destroy spellcheck client * Address review comments --- atom/renderer/api/atom_api_web_frame.cc | 32 +++++++++++++++++++++---- atom/renderer/api/atom_api_web_frame.h | 4 ---- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/atom/renderer/api/atom_api_web_frame.cc b/atom/renderer/api/atom_api_web_frame.cc index f0f7ef249d738..ca906920a6280 100644 --- a/atom/renderer/api/atom_api_web_frame.cc +++ b/atom/renderer/api/atom_api_web_frame.cc @@ -4,6 +4,8 @@ #include "atom/renderer/api/atom_api_web_frame.h" +#include + #include "atom/common/api/api_messages.h" #include "atom/common/api/event_emitter_caller.h" #include "atom/common/native_mate_converters/blink_converter.h" @@ -135,6 +137,26 @@ class FrameSpellChecker : public content::RenderFrameVisitor { } // namespace +class AtomWebFrameObserver : public content::RenderFrameObserver { + public: + explicit AtomWebFrameObserver( + content::RenderFrame* render_frame, + std::unique_ptr spell_check_client) + : content::RenderFrameObserver(render_frame), + spell_check_client_(std::move(spell_check_client)) {} + ~AtomWebFrameObserver() final {} + + // RenderFrameObserver implementation. + void OnDestruct() final { + spell_check_client_.reset(); + // Frame observers should delete themselves + delete this; + } + + private: + std::unique_ptr spell_check_client_; +}; + WebFrame::WebFrame(v8::Isolate* isolate) : web_frame_(blink::WebLocalFrame::FrameForCurrentContext()) { Init(isolate); @@ -222,15 +244,15 @@ void WebFrame::SetSpellCheckProvider(mate::Arguments* args, return; } - auto client = std::make_unique( + auto spell_check_client = std::make_unique( language, auto_spell_correct_turned_on, args->isolate(), provider); // Set spellchecker for all live frames in the same process or // in the sandbox mode for all live sub frames to this WebFrame. - FrameSpellChecker spell_checker( - client.get(), content::RenderFrame::FromWebFrame(web_frame_)); + auto* render_frame = content::RenderFrame::FromWebFrame(web_frame_); + FrameSpellChecker spell_checker(spell_check_client.get(), render_frame); content::RenderFrame::ForEach(&spell_checker); - spell_check_client_.swap(client); - web_frame_->SetSpellCheckPanelHostClient(spell_check_client_.get()); + web_frame_->SetSpellCheckPanelHostClient(spell_check_client.get()); + new AtomWebFrameObserver(render_frame, std::move(spell_check_client)); } void WebFrame::RegisterURLSchemeAsBypassingCSP(const std::string& scheme) { diff --git a/atom/renderer/api/atom_api_web_frame.h b/atom/renderer/api/atom_api_web_frame.h index 4cc6386abcb41..3b57d663b5ea1 100644 --- a/atom/renderer/api/atom_api_web_frame.h +++ b/atom/renderer/api/atom_api_web_frame.h @@ -26,8 +26,6 @@ namespace atom { namespace api { -class SpellCheckClient; - class WebFrame : public mate::Wrappable { public: static mate::Handle Create(v8::Isolate* isolate); @@ -99,8 +97,6 @@ class WebFrame : public mate::Wrappable { v8::Local FindFrameByRoutingId(int routing_id) const; v8::Local RoutingId() const; - std::unique_ptr spell_check_client_; - blink::WebLocalFrame* web_frame_; DISALLOW_COPY_AND_ASSIGN(WebFrame); From 3b61384c264b39b4c290057b23283aef89b6538c Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Tue, 29 Jan 2019 22:11:47 -0800 Subject: [PATCH 03/72] fix: register accelerator if role has no registerAccelerator (backport: 3-1-x) (#16598) * fix: register accelerator if role has no registerAccelerator * ensure roles[role].registerAccelerator is defined --- lib/browser/api/menu-item-roles.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/browser/api/menu-item-roles.js b/lib/browser/api/menu-item-roles.js index 3b5b302eab245..2c278a17275be 100644 --- a/lib/browser/api/menu-item-roles.js +++ b/lib/browser/api/menu-item-roles.js @@ -246,7 +246,8 @@ exports.getDefaultAccelerator = (role) => { } exports.shouldRegisterAccelerator = (role) => { - return roles.hasOwnProperty(role) ? roles[role].registerAccelerator : true + const hasRoleRegister = roles.hasOwnProperty(role) && roles[role].registerAccelerator !== undefined + return hasRoleRegister ? roles[role].registerAccelerator : true } exports.getDefaultSubmenu = (role) => { From 440a3fa6d8b1cec13d6ee7090514386636fb9e29 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 30 Jan 2019 19:12:48 -0600 Subject: [PATCH 04/72] fix: move open handling to web-contents.js (#16628) --- lib/browser/api/browser-window.js | 64 +------------------------- lib/browser/api/web-contents.js | 74 +++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 63 deletions(-) diff --git a/lib/browser/api/browser-window.js b/lib/browser/api/browser-window.js index 8d5bc84449998..d27573659ba1b 100644 --- a/lib/browser/api/browser-window.js +++ b/lib/browser/api/browser-window.js @@ -1,9 +1,8 @@ 'use strict' const electron = require('electron') -const {ipcMain, WebContentsView, TopLevelWindow} = electron +const {WebContentsView, TopLevelWindow} = electron const {BrowserWindow} = process.atomBinding('window') -const v8Util = process.atomBinding('v8_util') Object.setPrototypeOf(BrowserWindow.prototype, TopLevelWindow.prototype) @@ -17,67 +16,6 @@ BrowserWindow.prototype._init = function () { // Create WebContentsView. this.setContentView(new WebContentsView(this.webContents)) - // Make new windows requested by links behave like "window.open" - this.webContents.on('-new-window', (event, url, frameName, disposition, - additionalFeatures, postData, - referrer) => { - const options = { - show: true, - width: 800, - height: 600 - } - ipcMain.emit('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', - event, url, referrer, frameName, disposition, - options, additionalFeatures, postData) - }) - - this.webContents.on('-web-contents-created', (event, webContents, url, - frameName) => { - v8Util.setHiddenValue(webContents, 'url-framename', {url, frameName}) - }) - - // Create a new browser window for the native implementation of - // "window.open", used in sandbox and nativeWindowOpen mode - this.webContents.on('-add-new-contents', (event, webContents, disposition, - userGesture, left, top, width, - height) => { - let urlFrameName = v8Util.getHiddenValue(webContents, 'url-framename') - if ((disposition !== 'foreground-tab' && disposition !== 'new-window' && - disposition !== 'background-tab') || !urlFrameName) { - event.preventDefault() - return - } - - if (webContents.getLastWebPreferences().nodeIntegration === true) { - const message = - 'Enabling Node.js integration in child windows opened with the ' + - '"nativeWindowOpen" option will cause memory leaks, please turn off ' + - 'the "nodeIntegration" option.\\n' + - 'See https://github.com/electron/electron/pull/15076 for more.' - // console is only available after DOM is created. - const printWarning = () => this.webContents.executeJavaScript(`console.warn('${message}')`) - if (this.webContents.isDomReady()) { - printWarning() - } else { - this.webContents.once('dom-ready', printWarning) - } - } - - let {url, frameName} = urlFrameName - v8Util.deleteHiddenValue(webContents, 'url-framename') - const options = { - show: true, - x: left, - y: top, - width: width || 800, - height: height || 600, - webContents: webContents - } - const referrer = { url: '', policy: 'default' } - ipcMain.emit('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', - event, url, referrer, frameName, disposition, options) - }) - // window.resizeTo(...) // window.moveTo(...) this.webContents.on('move', (event, size) => { diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js index 8f5bd037b14d0..433fd3338222f 100644 --- a/lib/browser/api/web-contents.js +++ b/lib/browser/api/web-contents.js @@ -5,6 +5,7 @@ const electron = require('electron') const path = require('path') const url = require('url') const {app, ipcMain, session, NavigationController, deprecate} = electron +const v8Util = process.atomBinding('v8_util') // session is not used here, the purpose is to make sure session is initalized // before the webContents module. @@ -313,6 +314,79 @@ WebContents.prototype._init = function () { this.reload() }) + // Handle window.open for BrowserWindow and BrowserView. + if (['browserView', 'window'].includes(this.getType())) { + // Make new windows requested by links behave like "window.open" + this.on('-new-window', (event, url, frameName, disposition, + additionalFeatures, postData, + referrer) => { + const options = { + show: true, + width: 800, + height: 600 + } + ipcMain.emit('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', + event, url, referrer, frameName, disposition, + options, additionalFeatures, postData) + }) + + this.on('-web-contents-created', (event, webContents, url, + frameName) => { + v8Util.setHiddenValue(webContents, 'url-framename', { + url, + frameName + }) + }) + + // Create a new browser window for the native implementation of + // "window.open", used in sandbox and nativeWindowOpen mode + this.on('-add-new-contents', (event, webContents, disposition, + userGesture, left, top, width, + height) => { + let urlFrameName = v8Util.getHiddenValue(webContents, 'url-framename') + if ((disposition !== 'foreground-tab' && disposition !== 'new-window' && + disposition !== 'background-tab') || !urlFrameName) { + event.preventDefault() + return + } + + if (webContents.getLastWebPreferences().nodeIntegration === true) { + const message = + 'Enabling Node.js integration in child windows opened with the ' + + '"nativeWindowOpen" option will cause memory leaks, please turn off ' + + 'the "nodeIntegration" option.\\n' + + 'See https://github.com/electron/electron/pull/15076 for more.' + // console is only available after DOM is created. + const printWarning = () => this.webContents.executeJavaScript(`console.warn('${message}')`) + if (this.webContents.isDomReady()) { + printWarning() + } else { + this.webContents.once('dom-ready', printWarning) + } + } + + let { + url, + frameName + } = urlFrameName + v8Util.deleteHiddenValue(webContents, 'url-framename') + const options = { + show: true, + x: left, + y: top, + width: width || 800, + height: height || 600, + webContents: webContents + } + const referrer = { + url: '', + policy: 'default' + } + ipcMain.emit('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', + event, url, referrer, frameName, disposition, options) + }) + } + app.emit('web-contents-created', {}, this) } From 8ab13092156eb1421ac878fbc9496a7ba61ea95e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 31 Jan 2019 20:19:21 +0900 Subject: [PATCH 05/72] fix: return pointer instead of pointer's content (#16641) --- atom/browser/api/atom_api_top_level_window.cc | 4 +- atom/browser/native_window.h | 8 +- atom/browser/native_window_mac.h | 2 +- atom/browser/native_window_mac.mm | 5 +- atom/browser/native_window_views.cc | 5 +- atom/browser/native_window_views.h | 2 +- spec/.hash | 2 + spec/api-browser-window-spec.js | 13 + spec/package-lock.json | 626 +++++++++--------- spec/package.json | 1 + 10 files changed, 344 insertions(+), 324 deletions(-) create mode 100644 spec/.hash diff --git a/atom/browser/api/atom_api_top_level_window.cc b/atom/browser/api/atom_api_top_level_window.cc index a334dd9a143d7..8e9b5f90d5c64 100644 --- a/atom/browser/api/atom_api_top_level_window.cc +++ b/atom/browser/api/atom_api_top_level_window.cc @@ -667,8 +667,8 @@ v8::Local TopLevelWindow::GetNativeWindowHandle() { // TODO(MarshallOfSound): Replace once // https://chromium-review.googlesource.com/c/chromium/src/+/1253094/ has // landed - auto handle = window_->GetNativeWindowHandlePointer(); - return ToBuffer(isolate(), std::get<0>(handle), std::get<1>(handle)); + NativeWindowHandle handle = window_->GetNativeWindowHandle(); + return ToBuffer(isolate(), &handle, sizeof(handle)); } void TopLevelWindow::SetProgressBar(double progress, mate::Arguments* args) { diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index 23ec5e0c42811..7845a9ae16107 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -45,6 +45,12 @@ class NativeBrowserView; struct DraggableRegion; +#if defined(OS_MACOSX) +typedef NSView* NativeWindowHandle; +#else +typedef gfx::AcceleratedWidget NativeWindowHandle; +#endif + class NativeWindow : public base::SupportsUserData, public views::WidgetDelegate { public: @@ -151,7 +157,7 @@ class NativeWindow : public base::SupportsUserData, virtual gfx::NativeView GetNativeView() const = 0; virtual gfx::NativeWindow GetNativeWindow() const = 0; virtual gfx::AcceleratedWidget GetAcceleratedWidget() const = 0; - virtual std::tuple GetNativeWindowHandlePointer() const = 0; + virtual NativeWindowHandle GetNativeWindowHandle() const = 0; // Taskbar/Dock APIs. enum ProgressState { diff --git a/atom/browser/native_window_mac.h b/atom/browser/native_window_mac.h index 716c1c881e729..053fa5abeb1ed 100644 --- a/atom/browser/native_window_mac.h +++ b/atom/browser/native_window_mac.h @@ -104,7 +104,7 @@ class NativeWindowMac : public NativeWindow { gfx::NativeView GetNativeView() const override; gfx::NativeWindow GetNativeWindow() const override; gfx::AcceleratedWidget GetAcceleratedWidget() const override; - std::tuple GetNativeWindowHandlePointer() const override; + NativeWindowHandle GetNativeWindowHandle() const override; void SetProgressBar(double progress, const ProgressState state) override; void SetOverlayIcon(const gfx::Image& overlay, const std::string& description) override; diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 595018a395c6e..bb7fed9c3d5cd 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -1081,9 +1081,8 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { return gfx::kNullAcceleratedWidget; } -std::tuple NativeWindowMac::GetNativeWindowHandlePointer() const { - NSView* view = [window_ contentView]; - return std::make_tuple(static_cast(view), sizeof(view)); +NativeWindowHandle NativeWindowMac::GetNativeWindowHandle() const { + return [window_ contentView]; } void NativeWindowMac::SetProgressBar(double progress, diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 03c2c7543cc03..05dc4c9d50eee 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -1047,9 +1047,8 @@ gfx::AcceleratedWidget NativeWindowViews::GetAcceleratedWidget() const { return GetNativeWindow()->GetHost()->GetAcceleratedWidget(); } -std::tuple NativeWindowViews::GetNativeWindowHandlePointer() const { - gfx::AcceleratedWidget handle = GetAcceleratedWidget(); - return std::make_tuple(static_cast(&handle), sizeof(handle)); +NativeWindowHandle NativeWindowViews::GetNativeWindowHandle() const { + return GetAcceleratedWidget(); } gfx::Rect NativeWindowViews::ContentBoundsToWindowBounds( diff --git a/atom/browser/native_window_views.h b/atom/browser/native_window_views.h index 05954cfde4afc..8b50e707da840 100644 --- a/atom/browser/native_window_views.h +++ b/atom/browser/native_window_views.h @@ -124,7 +124,7 @@ class NativeWindowViews : public NativeWindow, bool IsVisibleOnAllWorkspaces() override; gfx::AcceleratedWidget GetAcceleratedWidget() const override; - std::tuple GetNativeWindowHandlePointer() const override; + NativeWindowHandle GetNativeWindowHandle() const override; gfx::Rect ContentBoundsToWindowBounds(const gfx::Rect& bounds) const override; gfx::Rect WindowBoundsToContentBounds(const gfx::Rect& bounds) const override; diff --git a/spec/.hash b/spec/.hash new file mode 100644 index 0000000000000..cac3ed15db040 --- /dev/null +++ b/spec/.hash @@ -0,0 +1,2 @@ +24d8222313d02ffe2a2181b9c82fbfa5ab8372aec6442839302622fbf45cbe47 +null \ No newline at end of file diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 3230e1d2287ca..0802e5302d48a 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -2790,6 +2790,19 @@ describe('BrowserWindow module', () => { }) }) + describe('window.getNativeWindowHandle()', () => { + if (!nativeModulesEnabled) { + this.skip() + } + + it('returns valid handle', () => { + // The module's source code is hosted at + // https://github.com/electron/node-is-valid-window + const isValidWindow = remote.require('is-valid-window') + assert.ok(isValidWindow(w.getNativeWindowHandle())) + }) + }) + describe('extensions and dev tools extensions', () => { let showPanelTimeoutId diff --git a/spec/package-lock.json b/spec/package-lock.json index 1e96408beac58..8b897bcedd825 100644 --- a/spec/package-lock.json +++ b/spec/package-lock.json @@ -16,22 +16,21 @@ } }, "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true + "optional": true }, "are-we-there-yet": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "dev": true, + "optional": true, "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -56,43 +55,38 @@ "dev": true }, "basic-auth": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz", - "integrity": "sha1-AV2z81PgLlY3d1X5YnQuiYHnu7o=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", "dev": true, "requires": { - "safe-buffer": "5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true - } + "safe-buffer": "5.1.2" } }, "bindings": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", - "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.4.0.tgz", + "integrity": "sha512-7znEVX22Djn+nYjxCWKDne0RRloa9XfYa84yk3s+HkE3LpDYZmhArYr9O9huBoHY3/oXispx5LorIX7Sl2CgSQ==", "dev": true, - "optional": true + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } }, "bl": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", - "dev": true, + "optional": true, "requires": { "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" } }, "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", + "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==", "dev": true }, "brace-expansion": { @@ -115,7 +109,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "dev": true, + "optional": true, "requires": { "buffer-alloc-unsafe": "^1.1.0", "buffer-fill": "^1.0.0" @@ -125,13 +119,13 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", - "dev": true + "optional": true }, "buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", - "dev": true + "optional": true }, "camelcase": { "version": "4.1.0", @@ -140,17 +134,17 @@ "dev": true }, "chai": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz", - "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", "dev": true, "requires": { - "assertion-error": "^1.0.1", - "check-error": "^1.0.1", - "deep-eql": "^3.0.0", + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", "get-func-name": "^2.0.0", - "pathval": "^1.0.0", - "type-detect": "^4.0.0" + "pathval": "^1.1.0", + "type-detect": "^4.0.5" } }, "chai-as-promised": { @@ -178,7 +172,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", - "dev": true + "optional": true }, "cliui": { "version": "4.1.0", @@ -189,13 +183,45 @@ "string-width": "^2.1.1", "strip-ansi": "^4.0.0", "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "coffee-script": { "version": "1.12.7", @@ -218,14 +244,12 @@ "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cross-spawn": { "version": "5.1.0", @@ -261,9 +285,9 @@ } }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" @@ -279,7 +303,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dev": true, + "optional": true, "requires": { "mimic-response": "^1.0.0" } @@ -297,13 +321,13 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true + "optional": true }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true + "optional": true }, "depd": { "version": "1.1.2", @@ -321,7 +345,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "dev": true + "optional": true }, "diff": { "version": "3.5.0", @@ -357,7 +381,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, "requires": { "once": "^1.4.0" } @@ -381,18 +404,18 @@ "dev": true }, "event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.5.tgz", + "integrity": "sha512-vyibDcu5JL20Me1fP734QBH/kenBGLZap2n0+XXM7mvuUPzJ20Ydqj1aKcIeMdri1p+PU+4yAKugjN8KCVst+g==", "dev": true, "requires": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" + "duplexer": "^0.1.1", + "from": "^0.1.7", + "map-stream": "0.0.7", + "pause-stream": "^0.0.11", + "split": "^1.0.1", + "stream-combiner": "^0.2.2", + "through": "^2.3.8" } }, "execa": { @@ -414,17 +437,24 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.1.1.tgz", "integrity": "sha512-cebqLtV8KOZfw0UI8TEFWxtczxxC1jvyUvx6H4fyp1K1FN7A4Q+uggVUlOsI1K8AGU0rwOGqP8nCapdrw8CYQg==", - "dev": true + "optional": true }, "fd-slicer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", - "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "dev": true, "requires": { "pend": "~1.2.0" } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -450,7 +480,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true + "optional": true }, "fs.realpath": { "version": "1.0.0", @@ -462,7 +492,7 @@ "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, + "optional": true, "requires": { "aproba": "^1.0.3", "console-control-strings": "^1.0.0", @@ -472,49 +502,12 @@ "string-width": "^1.0.1", "strip-ansi": "^3.0.1", "wide-align": "^1.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } } }, "get-caller-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, "get-func-name": { @@ -533,7 +526,7 @@ "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", - "dev": true + "optional": true }, "glob": { "version": "7.1.2", @@ -550,9 +543,9 @@ } }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, "growl": { @@ -571,7 +564,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true + "optional": true }, "he": { "version": "1.1.1", @@ -586,15 +579,16 @@ "dev": true }, "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.1.tgz", + "integrity": "sha512-jWEUgtZWGSMba9I1N3gc1HmvpBUaNC9vDdA46yScAdp+C5rdEuKWUBLWTQpW9FwSWSbYYs++b6SDCxf9UEJzfw==", "dev": true, "requires": { "depd": "~1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" } }, "inflight": { @@ -610,14 +604,13 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true + "optional": true }, "invert-kv": { "version": "1.0.0", @@ -632,10 +625,12 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } }, "is-stream": { "version": "1.1.0", @@ -643,11 +638,19 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-valid-window": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/is-valid-window/-/is-valid-window-0.0.3.tgz", + "integrity": "sha512-7JkdRuLfEEYhb3eMcMeivn0UYpiXqwFoKxAefCfqRItCsElu4MGTnGtwqcMA3LwKhpCzcuYOLLcUH4PdEbW8fQ==", + "dev": true, + "requires": { + "nan": "2.x" + } + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isexe": { "version": "2.0.0", @@ -674,12 +677,6 @@ "path-exists": "^3.0.0" } }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - }, "long": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", @@ -687,9 +684,9 @@ "dev": true }, "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "requires": { "pseudomap": "^1.0.2", @@ -697,9 +694,9 @@ } }, "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", + "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", "dev": true }, "md5": { @@ -738,7 +735,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true + "optional": true }, "minimatch": { "version": "3.0.4", @@ -750,16 +747,14 @@ } }, "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, "requires": { "minimist": "0.0.8" }, @@ -767,8 +762,7 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" } } }, @@ -789,23 +783,12 @@ "minimatch": "3.0.4", "mkdirp": "0.5.1", "supports-color": "5.4.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } } }, "mocha-junit-reporter": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-1.17.0.tgz", - "integrity": "sha1-LlFJ7UD8XS48px5C21qx/snG2Fw=", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-1.18.0.tgz", + "integrity": "sha512-y3XuqKa2+HRYtg0wYyhW/XsLm2Ps+pqf9HaTAt7+MVUAKFJaNAHOrNseTZo9KCxjfIbxUWwckP5qCDDPUmjSWA==", "dev": true, "requires": { "debug": "^2.2.0", @@ -813,32 +796,31 @@ "mkdirp": "~0.5.1", "strip-ansi": "^4.0.0", "xml": "^1.0.0" - } - }, - "mocha-multi-reporters": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/mocha-multi-reporters/-/mocha-multi-reporters-1.1.7.tgz", - "integrity": "sha1-zH8/TTL0eFIJQdhSq7ZNmYhYfYI=", - "dev": true, - "requires": { - "debug": "^3.1.0", - "lodash": "^4.16.4" }, "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, "debug": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz", - "integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.0.0" } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } } } }, @@ -849,26 +831,27 @@ "dev": true }, "multiparty": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-4.1.4.tgz", - "integrity": "sha1-TJbcvcEeP3kX4WFeZAtLUCK+ZP0=", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-4.2.1.tgz", + "integrity": "sha512-AvESCnNoQlZiOfP9R4mxN8M9csy2L16EIbWIkt3l4FuGti9kXBS8QVzlfyg4HEnarJhrzZilgNFlZtqmoiAIIA==", "dev": true, "requires": { - "fd-slicer": "~1.0.1", - "safe-buffer": "5.1.2" + "fd-slicer": "1.1.0", + "http-errors": "~1.7.0", + "safe-buffer": "5.1.2", + "uid-safe": "2.1.5" } }, "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", - "dev": true + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", + "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" }, "node-abi": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.4.4.tgz", - "integrity": "sha512-DQ9Mo2mf/XectC+s6+grPPRQ1Z9gI3ZbrGv6nyXRkjwT3HrE0xvtvrfnH7YHYBLgC/KLadg+h3XHnhZw1sv88A==", - "dev": true, + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.6.0.tgz", + "integrity": "sha512-kCnEh6af6Z6DB7RFI/7LHNwqRjvJW7rgrv3lhIFoQ/+XhLPI/lJYwsk5vzvkldPWWgqnAMcuPF5S8/jj56kVOA==", + "optional": true, "requires": { "semver": "^5.4.1" } @@ -877,7 +860,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", - "dev": true + "optional": true }, "npm-run-path": { "version": "2.0.2", @@ -892,7 +875,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, + "optional": true, "requires": { "are-we-there-yet": "~1.1.2", "console-control-strings": "~1.1.0", @@ -903,14 +886,13 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true + "optional": true }, "on-finished": { "version": "2.3.0", @@ -925,7 +907,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -938,13 +919,21 @@ "requires": { "minimist": "~0.0.1", "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + } } }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true + "optional": true }, "os-locale": { "version": "2.1.0", @@ -1036,7 +1025,7 @@ "version": "2.5.3", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-2.5.3.tgz", "integrity": "sha512-/rI36cN2g7vDQnKWN8Uzupi++KjyqS9iS+/fpwG4Ea8d0Pip0PQ5bshUNzVwt+/D2MRfhVAplYMMvWLqWrCF/g==", - "dev": true, + "optional": true, "requires": { "detect-libc": "^1.0.3", "expand-template": "^1.0.2", @@ -1053,21 +1042,12 @@ "tar-fs": "^1.13.0", "tunnel-agent": "^0.6.0", "which-pm-runs": "^1.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } } }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "pseudomap": { "version": "1.0.2", @@ -1079,7 +1059,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, + "optional": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -1097,6 +1077,12 @@ "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", "dev": true }, + "random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=", + "dev": true + }, "range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", @@ -1107,27 +1093,18 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, + "optional": true, "requires": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } } }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -1160,7 +1137,7 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/robotjs/-/robotjs-0.5.1.tgz", "integrity": "sha512-5qKsJs+0rI94WZRr3S0TleDGaiK9yeQ8PIDHwJUXWWnaHuTrbOluvw/WwSm3V7LfeLNcOHcsorP4umgmYzPLFw==", - "dev": true, + "optional": true, "requires": { "nan": "^2.2.1", "prebuild-install": "^2.1.1" @@ -1170,7 +1147,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/runas/-/runas-3.1.1.tgz", "integrity": "sha1-Ut1TjbDkF0U5lTWjRwkbpFzA6rA=", - "dev": true, + "optional": true, "requires": { "nan": "2.x" } @@ -1178,8 +1155,7 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "sax": { "version": "1.2.4", @@ -1188,10 +1164,10 @@ "dev": true }, "semver": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", - "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", - "dev": true + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "optional": true }, "send": { "version": "0.16.2", @@ -1222,14 +1198,31 @@ "requires": { "ms": "2.0.0" } + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "dev": true } } }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "setprototypeof": { "version": "1.1.0", @@ -1255,20 +1248,19 @@ "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "simple-concat": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", - "dev": true + "optional": true }, "simple-get": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", - "dev": true, + "optional": true, "requires": { "decompress-response": "^3.3.0", "once": "^1.3.1", @@ -1276,55 +1268,54 @@ } }, "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", "dev": true, "requires": { "through": "2" } }, "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", "dev": true }, "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", + "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", "dev": true, "requires": { - "duplexer": "~0.1.1" + "duplexer": "~0.1.1", + "through": "~2.3.4" } }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, "requires": { "safe-buffer": "~5.1.0" } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^2.0.0" } }, "strip-eof": { @@ -1337,7 +1328,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true + "optional": true }, "supports-color": { "version": "5.4.0", @@ -1352,7 +1343,7 @@ "version": "1.16.3", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", - "dev": true, + "optional": true, "requires": { "chownr": "^1.0.1", "mkdirp": "^0.5.1", @@ -1364,7 +1355,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "dev": true, + "optional": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -1376,7 +1367,7 @@ "version": "1.6.2", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "dev": true, + "optional": true, "requires": { "bl": "^1.0.0", "buffer-alloc": "^1.2.0", @@ -1407,13 +1398,19 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", + "optional": true + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.0.1" } @@ -1424,11 +1421,19 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, + "uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "dev": true, + "requires": { + "random-bytes": "~1.0.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "walkdir": { "version": "0.0.12", @@ -1455,13 +1460,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", - "dev": true + "optional": true }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, + "optional": true, "requires": { "string-width": "^1.0.2 || 2" } @@ -1486,55 +1491,17 @@ "requires": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "ws": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.0.tgz", - "integrity": "sha512-c18dMeW+PEQdDFzkhDsnBAlS4Z8KGStBQQUcQ5mf7Nf689jyGk0594L+i9RaQuf4gog6SvWLJorz2NfSaqxZ7w==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", "dev": true, "requires": { "async-limiter": "~1.0.0" @@ -1559,7 +1526,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true + "optional": true }, "y18n": { "version": "3.2.1", @@ -1574,9 +1541,9 @@ "dev": true }, "yargs": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.0.0.tgz", - "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", "dev": true, "requires": { "cliui": "^4.0.0", @@ -1591,6 +1558,39 @@ "which-module": "^2.0.0", "y18n": "^3.2.1", "yargs-parser": "^9.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "yargs-parser": { diff --git a/spec/package.json b/spec/package.json index a81fda3cc6a2e..e5f83b7a2bc2d 100644 --- a/spec/package.json +++ b/spec/package.json @@ -15,6 +15,7 @@ "dbus-native": "^0.2.5", "dirty-chai": "^2.0.1", "graceful-fs": "^4.1.11", + "is-valid-window": "^0.0.3", "mkdirp": "^0.5.1", "mocha": "^5.2.0", "mocha-junit-reporter": "^1.17.0", From 34a68725a0a0cd7effac65a63ba80fdc0e438d79 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 31 Jan 2019 08:27:26 -0800 Subject: [PATCH 06/72] Bump v3.1.3 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index b63089d554d8b..965bbb836f775 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.2 + 3.1.3 CFBundleShortVersionString - 3.1.2 + 3.1.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 8bfdd79689e4b..70cf6a4f80cc8 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,2,0 - PRODUCTVERSION 3,1,2,0 + FILEVERSION 3,1,3,0 + PRODUCTVERSION 3,1,3,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.2" + VALUE "FileVersion", "3.1.3" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.2" + VALUE "ProductVersion", "3.1.3" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index a9ccebf280bfe..a05475205fb8a 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 2 +#define ATOM_PATCH_VERSION 3 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index edf08d2add191..8cef1e8a27bea 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.2', + 'version%': '3.1.3', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index de48f6da2b2da..f05cdddf3392d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.1", + "version": "3.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index df7d60dcfd25a..a8101f03b9c70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.2", + "version": "3.1.3", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 753683ad22b30b6c3bf2e71e54b3bbca862165ff Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 31 Jan 2019 08:44:50 -0800 Subject: [PATCH 07/72] Revert "Bump v3.1.3" This reverts commit 34a68725a0a0cd7effac65a63ba80fdc0e438d79. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 965bbb836f775..b63089d554d8b 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.3 + 3.1.2 CFBundleShortVersionString - 3.1.3 + 3.1.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 70cf6a4f80cc8..8bfdd79689e4b 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,3,0 - PRODUCTVERSION 3,1,3,0 + FILEVERSION 3,1,2,0 + PRODUCTVERSION 3,1,2,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.3" + VALUE "FileVersion", "3.1.2" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.3" + VALUE "ProductVersion", "3.1.2" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index a05475205fb8a..a9ccebf280bfe 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 3 +#define ATOM_PATCH_VERSION 2 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 8cef1e8a27bea..edf08d2add191 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.3', + 'version%': '3.1.2', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index f05cdddf3392d..de48f6da2b2da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.2", + "version": "3.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a8101f03b9c70..df7d60dcfd25a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.3", + "version": "3.1.2", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From b450e513195b1bc0effdeb155bdc18688489a466 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 31 Jan 2019 10:02:53 -0800 Subject: [PATCH 08/72] Bump v3.1.3 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index b63089d554d8b..965bbb836f775 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.2 + 3.1.3 CFBundleShortVersionString - 3.1.2 + 3.1.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 8bfdd79689e4b..70cf6a4f80cc8 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,2,0 - PRODUCTVERSION 3,1,2,0 + FILEVERSION 3,1,3,0 + PRODUCTVERSION 3,1,3,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.2" + VALUE "FileVersion", "3.1.3" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.2" + VALUE "ProductVersion", "3.1.3" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index a9ccebf280bfe..a05475205fb8a 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 2 +#define ATOM_PATCH_VERSION 3 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index edf08d2add191..8cef1e8a27bea 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.2', + 'version%': '3.1.3', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index de48f6da2b2da..f05cdddf3392d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.1", + "version": "3.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index df7d60dcfd25a..a8101f03b9c70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.2", + "version": "3.1.3", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From c0c179fad05ee9c7626abb4b764130e6fe4c8293 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 31 Jan 2019 10:30:40 -0800 Subject: [PATCH 09/72] Revert "Bump v3.1.3" This reverts commit b450e513195b1bc0effdeb155bdc18688489a466. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 965bbb836f775..b63089d554d8b 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.3 + 3.1.2 CFBundleShortVersionString - 3.1.3 + 3.1.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 70cf6a4f80cc8..8bfdd79689e4b 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,3,0 - PRODUCTVERSION 3,1,3,0 + FILEVERSION 3,1,2,0 + PRODUCTVERSION 3,1,2,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.3" + VALUE "FileVersion", "3.1.2" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.3" + VALUE "ProductVersion", "3.1.2" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index a05475205fb8a..a9ccebf280bfe 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 3 +#define ATOM_PATCH_VERSION 2 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 8cef1e8a27bea..edf08d2add191 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.3', + 'version%': '3.1.2', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index f05cdddf3392d..de48f6da2b2da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.2", + "version": "3.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a8101f03b9c70..df7d60dcfd25a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.3", + "version": "3.1.2", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 72ff292302f95bfe5b4e02085a7be56254b42b0e Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 31 Jan 2019 13:13:54 -0800 Subject: [PATCH 10/72] Bump v3.1.3 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index b63089d554d8b..965bbb836f775 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.2 + 3.1.3 CFBundleShortVersionString - 3.1.2 + 3.1.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 8bfdd79689e4b..70cf6a4f80cc8 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,2,0 - PRODUCTVERSION 3,1,2,0 + FILEVERSION 3,1,3,0 + PRODUCTVERSION 3,1,3,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.2" + VALUE "FileVersion", "3.1.3" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.2" + VALUE "ProductVersion", "3.1.3" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index a9ccebf280bfe..a05475205fb8a 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 2 +#define ATOM_PATCH_VERSION 3 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index edf08d2add191..8cef1e8a27bea 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.2', + 'version%': '3.1.3', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index de48f6da2b2da..f05cdddf3392d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.1", + "version": "3.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index df7d60dcfd25a..a8101f03b9c70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.2", + "version": "3.1.3", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 98d7b61a4a559802726623569b387d2eee7a9af7 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Tue, 5 Feb 2019 08:09:08 -0800 Subject: [PATCH 11/72] fix: crash when calling setProgressBar on macOS (backport: 3-1-x) (#16726) * fix: correctly check whether dock has progress bar * fix: do not leak memory when setting dockTile --- atom/browser/native_window_mac.mm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index bb7fed9c3d5cd..2db097072ab94 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -1089,17 +1089,23 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { const NativeWindow::ProgressState state) { NSDockTile* dock_tile = [NSApp dockTile]; + // Sometimes macOS would install a default contentView for dock, we must + // verify whether NSProgressIndicator has been installed. + bool first_time = !dock_tile.contentView || + [[dock_tile.contentView subviews] count] == 0 || + ![[[dock_tile.contentView subviews] lastObject] + isKindOfClass:[NSProgressIndicator class]]; + // For the first time API invoked, we need to create a ContentView in // DockTile. - if (dock_tile.contentView == nullptr) { - NSImageView* image_view = [[NSImageView alloc] init]; + if (first_time) { + NSImageView* image_view = [[[NSImageView alloc] init] autorelease]; [image_view setImage:[NSApp applicationIconImage]]; [dock_tile setContentView:image_view]; - } - if ([[dock_tile.contentView subviews] count] == 0) { - NSProgressIndicator* progress_indicator = [[AtomProgressBar alloc] - initWithFrame:NSMakeRect(0.0f, 0.0f, dock_tile.size.width, 15.0)]; + NSRect frame = NSMakeRect(0.0f, 0.0f, dock_tile.size.width, 15.0); + NSProgressIndicator* progress_indicator = + [[[AtomProgressBar alloc] initWithFrame:frame] autorelease]; [progress_indicator setStyle:NSProgressIndicatorBarStyle]; [progress_indicator setIndeterminate:NO]; [progress_indicator setBezeled:YES]; @@ -1110,7 +1116,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { } NSProgressIndicator* progress_indicator = static_cast( - [[[dock_tile contentView] subviews] objectAtIndex:0]); + [[[dock_tile contentView] subviews] lastObject]); if (progress < 0) { [progress_indicator setHidden:YES]; } else if (progress > 1) { From cdb7eed21d10ba870f1eb63c328c76c665b588ec Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Tue, 5 Feb 2019 15:01:20 -0800 Subject: [PATCH 12/72] build: ensure index.json is actually valid JSON before uploading (backport: 3-1-x) (#16752) * build: ensure index.json is actually valid JSON before uploading * chore: fix py linting for validation of index.json --- script/upload-index-json.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/script/upload-index-json.py b/script/upload-index-json.py index 55d0675d0707d..c6418133a18b0 100755 --- a/script/upload-index-json.py +++ b/script/upload-index-json.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import json import os import sys import urllib2 @@ -15,6 +16,13 @@ version = sys.argv[1] authToken = os.getenv('META_DUMPER_AUTH_HEADER') +def is_json(myjson): + try: + json.loads(myjson) + except ValueError: + return False + return True + def get_content(retry_count = 5): try: request = urllib2.Request( @@ -22,9 +30,14 @@ def get_content(retry_count = 5): headers={"Authorization" : authToken} ) - return urllib2.urlopen( + proposed_content = urllib2.urlopen( request ).read() + + if is_json(proposed_content): + return proposed_content + print("bad attempt") + raise Exception("Failed to fetch valid JSON from the metadumper service") except Exception as e: if retry_count == 0: raise e From 438a7d8e1e7ea694f1caf06e62c82eb0932cce99 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Fri, 8 Feb 2019 14:07:29 -0800 Subject: [PATCH 13/72] chore: disable get/setLoginItemSettings specs (#16843) --- spec/api-app-spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/api-app-spec.js b/spec/api-app-spec.js index da978ceefb1f3..a86c750c4ee2a 100644 --- a/spec/api-app-spec.js +++ b/spec/api-app-spec.js @@ -443,7 +443,7 @@ describe('app module', () => { ] before(function () { - if (process.platform === 'linux') this.skip() + if (process.platform === 'linux' || process.mas) this.skip() }) beforeEach(() => { From 94a53cdb30e631ed972898a36bdb4b350b56d768 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Wed, 13 Feb 2019 12:10:54 -0500 Subject: [PATCH 14/72] build: ensure that the uploaded symbol path is correct for our symbol server (#16914) --- script/upload-symbols.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/upload-symbols.py b/script/upload-symbols.py index ca1a393339a41..fb641754ccf6c 100755 --- a/script/upload-symbols.py +++ b/script/upload-symbols.py @@ -34,6 +34,11 @@ def main(): files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb') else: files = glob.glob(SYMBOLS_DIR + '/*/*/*.sym') + + # The file upload needs to be atom-shell/symbols/:symbol_name/:hash/:symbol + os.chdir(SYMBOLS_DIR) + files = [os.path.relpath(f, os.getcwd()) for f in files] + # The symbol server needs lowercase paths, it will fail otherwise # So lowercase all the file paths here files = [f.lower() for f in files] From b398305cdd39a7e65a5358b876804c05296e3a90 Mon Sep 17 00:00:00 2001 From: Roller Bot <42361097+roller-bot@users.noreply.github.com> Date: Thu, 14 Feb 2019 14:22:00 -0800 Subject: [PATCH 15/72] chore: bump libcc (3-1-x) (#16971) * chore: bump libcc submodule to cd7a2326b0668f24b83d568eccab16ee9ba8dc9a * chore: bump libcc in DEPS to cd7a2326b0668f24b83d568eccab16ee9ba8dc9a --- DEPS | 2 +- vendor/libchromiumcontent | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f87f06d7b5665..3e4ad8a696667 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ vars = { 'chromium_version': '63.0.3239.150', 'libchromiumcontent_revision': - '7ea271f92018b1eeb8e70ec6de8c29f9758a0c05', + 'cd7a2326b0668f24b83d568eccab16ee9ba8dc9a', 'node_version': 'v9.7.0-33-g538a5023af', 'native_mate_revision': diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 7ea271f92018b..cd7a2326b0668 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 7ea271f92018b1eeb8e70ec6de8c29f9758a0c05 +Subproject commit cd7a2326b0668f24b83d568eccab16ee9ba8dc9a From 0082e8083cd4506be9841fc339f5547c8f85e9c5 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 14 Feb 2019 15:06:46 -0800 Subject: [PATCH 16/72] Bump v3.1.4 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 965bbb836f775..afa45f0429348 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.3 + 3.1.4 CFBundleShortVersionString - 3.1.3 + 3.1.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 70cf6a4f80cc8..7aab0a2040c0c 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,3,0 - PRODUCTVERSION 3,1,3,0 + FILEVERSION 3,1,4,0 + PRODUCTVERSION 3,1,4,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.3" + VALUE "FileVersion", "3.1.4" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.3" + VALUE "ProductVersion", "3.1.4" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index a05475205fb8a..3cb579a2e3762 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 3 +#define ATOM_PATCH_VERSION 4 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 8cef1e8a27bea..ae3faf87b403a 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.3', + 'version%': '3.1.4', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index f05cdddf3392d..0435bcf110c36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.2", + "version": "3.1.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a8101f03b9c70..2f24f7a5543a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.3", + "version": "3.1.4", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From dd4b688b5f39e50ba36eb2be25744a4c445ba28c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 15 Feb 2019 18:22:41 +0000 Subject: [PATCH 17/72] Fix memory leak when using webFrame and spell checker (3-1-x) (#16771) * fix: do not create native api::WebFrame in webFrame When reloading a page without restarting renderer process (for example sandbox mode), the blink::WebFrame is not destroyed, but api::WebFrame is always recreated for the new page context. This leaves a leak of api::WebFrame. * fix: remove spell checker when page context is released --- atom/renderer/api/atom_api_web_frame.cc | 454 +++++++++++++----------- atom/renderer/api/atom_api_web_frame.h | 109 ------ filenames.gypi | 1 - lib/renderer/api/web-frame.js | 70 +++- spec/api-web-frame-spec.js | 24 ++ 5 files changed, 332 insertions(+), 326 deletions(-) delete mode 100644 atom/renderer/api/atom_api_web_frame.h diff --git a/atom/renderer/api/atom_api_web_frame.cc b/atom/renderer/api/atom_api_web_frame.cc index ca906920a6280..ee6e342472384 100644 --- a/atom/renderer/api/atom_api_web_frame.cc +++ b/atom/renderer/api/atom_api_web_frame.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "atom/renderer/api/atom_api_web_frame.h" - +#include +#include #include +#include #include "atom/common/api/api_messages.h" #include "atom/common/api/event_emitter_caller.h" @@ -111,15 +112,15 @@ class ScriptExecutionCallback : public blink::WebScriptExecutionCallback { DISALLOW_COPY_AND_ASSIGN(ScriptExecutionCallback); }; -class FrameSpellChecker : public content::RenderFrameVisitor { +class FrameSetSpellChecker : public content::RenderFrameVisitor { public: - explicit FrameSpellChecker(SpellCheckClient* spell_check_client, - content::RenderFrame* main_frame) - : spell_check_client_(spell_check_client), main_frame_(main_frame) {} - ~FrameSpellChecker() override { - spell_check_client_ = nullptr; - main_frame_ = nullptr; + FrameSetSpellChecker(SpellCheckClient* spell_check_client, + content::RenderFrame* main_frame) + : spell_check_client_(spell_check_client), main_frame_(main_frame) { + content::RenderFrame::ForEach(this); + main_frame->GetWebFrame()->SetSpellCheckPanelHostClient(spell_check_client); } + bool Visit(content::RenderFrame* render_frame) override { auto* view = render_frame->GetRenderView(); if (view->GetMainRenderFrame() == main_frame_ || @@ -132,91 +133,128 @@ class FrameSpellChecker : public content::RenderFrameVisitor { private: SpellCheckClient* spell_check_client_; content::RenderFrame* main_frame_; - DISALLOW_COPY_AND_ASSIGN(FrameSpellChecker); -}; -} // namespace + DISALLOW_COPY_AND_ASSIGN(FrameSetSpellChecker); +}; -class AtomWebFrameObserver : public content::RenderFrameObserver { +class SpellCheckerHolder : public content::RenderFrameObserver { public: - explicit AtomWebFrameObserver( - content::RenderFrame* render_frame, - std::unique_ptr spell_check_client) + // Find existing holder for the |render_frame|. + static SpellCheckerHolder* FromRenderFrame( + content::RenderFrame* render_frame) { + for (auto* holder : instances_) { + if (holder->render_frame() == render_frame) + return holder; + } + return nullptr; + } + + SpellCheckerHolder(content::RenderFrame* render_frame, + std::unique_ptr spell_check_client) : content::RenderFrameObserver(render_frame), - spell_check_client_(std::move(spell_check_client)) {} - ~AtomWebFrameObserver() final {} + spell_check_client_(std::move(spell_check_client)) { + DCHECK(!FromRenderFrame(render_frame)); + instances_.insert(this); + } + + ~SpellCheckerHolder() final { instances_.erase(this); } + + void UnsetAndDestroy() { + FrameSetSpellChecker set_spell_checker(nullptr, render_frame()); + delete this; + } // RenderFrameObserver implementation. void OnDestruct() final { - spell_check_client_.reset(); - // Frame observers should delete themselves + // Since we delete this in WillReleaseScriptContext, this method is unlikely + // to be called, but override anyway since I'm not sure if there are some + // corner cases. + // + // Note that while there are two "delete this", it is totally fine as the + // observer unsubscribes automatically in destructor and the other one won't + // be called. + // + // Also note that we should not call UnsetAndDestroy here, as the render + // frame is going to be destroyed. delete this; } + void WillReleaseScriptContext(v8::Local context, + int world_id) final { + // Unset spell checker when the script context is going to be released, as + // the spell check implementation lives there. + UnsetAndDestroy(); + } + private: + static std::set instances_; + std::unique_ptr spell_check_client_; }; -WebFrame::WebFrame(v8::Isolate* isolate) - : web_frame_(blink::WebLocalFrame::FrameForCurrentContext()) { - Init(isolate); -} - -WebFrame::WebFrame(v8::Isolate* isolate, blink::WebLocalFrame* blink_frame) - : web_frame_(blink_frame) { - Init(isolate); -} +} // namespace -WebFrame::~WebFrame() {} +// static +std::set SpellCheckerHolder::instances_; -void WebFrame::SetName(const std::string& name) { - web_frame_->SetName(blink::WebString::FromUTF8(name)); +void SetName(v8::Local window, const std::string& name) { + GetRenderFrame(window)->GetWebFrame()->SetName( + blink::WebString::FromUTF8(name)); } -double WebFrame::SetZoomLevel(double level) { +double SetZoomLevel(v8::Local window, double level) { double result = 0.0; - content::RenderFrame* render_frame = - content::RenderFrame::FromWebFrame(web_frame_); + content::RenderFrame* render_frame = GetRenderFrame(window); render_frame->Send(new AtomFrameHostMsg_SetTemporaryZoomLevel( render_frame->GetRoutingID(), level, &result)); return result; } -double WebFrame::GetZoomLevel() const { +double GetZoomLevel(v8::Local window) { double result = 0.0; - content::RenderFrame* render_frame = - content::RenderFrame::FromWebFrame(web_frame_); + content::RenderFrame* render_frame = GetRenderFrame(window); render_frame->Send( new AtomFrameHostMsg_GetZoomLevel(render_frame->GetRoutingID(), &result)); return result; } -double WebFrame::SetZoomFactor(double factor) { +double SetZoomFactor(v8::Local window, double factor) { return blink::WebView::ZoomLevelToZoomFactor( - SetZoomLevel(blink::WebView::ZoomFactorToZoomLevel(factor))); + SetZoomLevel(window, blink::WebView::ZoomFactorToZoomLevel(factor))); } -double WebFrame::GetZoomFactor() const { - return blink::WebView::ZoomLevelToZoomFactor(GetZoomLevel()); +double GetZoomFactor(v8::Local window) { + return blink::WebView::ZoomLevelToZoomFactor(GetZoomLevel(window)); } -void WebFrame::SetVisualZoomLevelLimits(double min_level, double max_level) { - web_frame_->View()->SetDefaultPageScaleLimits(min_level, max_level); - web_frame_->View()->SetIgnoreViewportTagScaleLimits(true); +void SetVisualZoomLevelLimits(v8::Local window, + double min_level, + double max_level) { + blink::WebFrame* web_frame = GetRenderFrame(window)->GetWebFrame(); + web_frame->View()->SetDefaultPageScaleLimits(min_level, max_level); + web_frame->View()->SetIgnoreViewportTagScaleLimits(true); } -void WebFrame::SetLayoutZoomLevelLimits(double min_level, double max_level) { - web_frame_->View()->ZoomLimitsChanged(min_level, max_level); +void SetLayoutZoomLevelLimits(v8::Local window, + double min_level, + double max_level) { + blink::WebFrame* web_frame = GetRenderFrame(window)->GetWebFrame(); + web_frame->View()->ZoomLimitsChanged(min_level, max_level); } -v8::Local WebFrame::RegisterEmbedderCustomElement( +v8::Local RegisterEmbedderCustomElement( + v8::Local window, const base::string16& name, v8::Local options) { - return web_frame_->GetDocument().RegisterEmbedderCustomElement( - blink::WebString::FromUTF16(name), options); + return GetRenderFrame(window) + ->GetWebFrame() + ->GetDocument() + .RegisterEmbedderCustomElement(blink::WebString::FromUTF16(name), + options); } -int WebFrame::GetWebFrameId(v8::Local content_window) { +int GetWebFrameId(v8::Local window, + v8::Local content_window) { // Get the WebLocalFrame before (possibly) executing any user-space JS while // getting the |params|. We track the status of the RenderFrame via an // observer in case it is deleted during user code execution. @@ -235,34 +273,42 @@ int WebFrame::GetWebFrameId(v8::Local content_window) { return render_frame->GetRoutingID(); } -void WebFrame::SetSpellCheckProvider(mate::Arguments* args, - const std::string& language, - bool auto_spell_correct_turned_on, - v8::Local provider) { +void SetSpellCheckProvider(mate::Arguments* args, + v8::Local window, + const std::string& language, + bool auto_spell_correct_turned_on, + v8::Local provider) { if (!provider->Has(mate::StringToV8(args->isolate(), "spellCheck"))) { args->ThrowError("\"spellCheck\" has to be defined"); return; } - auto spell_check_client = std::make_unique( - language, auto_spell_correct_turned_on, args->isolate(), provider); + // Remove the old client. + content::RenderFrame* render_frame = GetRenderFrame(window); + auto* existing = SpellCheckerHolder::FromRenderFrame(render_frame); + if (existing) + existing->UnsetAndDestroy(); + // Set spellchecker for all live frames in the same process or // in the sandbox mode for all live sub frames to this WebFrame. - auto* render_frame = content::RenderFrame::FromWebFrame(web_frame_); - FrameSpellChecker spell_checker(spell_check_client.get(), render_frame); - content::RenderFrame::ForEach(&spell_checker); - web_frame_->SetSpellCheckPanelHostClient(spell_check_client.get()); - new AtomWebFrameObserver(render_frame, std::move(spell_check_client)); + auto spell_check_client = std::make_unique( + language, auto_spell_correct_turned_on, args->isolate(), provider); + FrameSetSpellChecker spell_checker(spell_check_client.get(), render_frame); + + // Attach the spell checker to RenderFrame. + new SpellCheckerHolder(render_frame, std::move(spell_check_client)); } -void WebFrame::RegisterURLSchemeAsBypassingCSP(const std::string& scheme) { +void RegisterURLSchemeAsBypassingCSP(v8::Local window, + const std::string& scheme) { // Register scheme to bypass pages's Content Security Policy. blink::SchemeRegistry::RegisterURLSchemeAsBypassingContentSecurityPolicy( WTF::String::FromUTF8(scheme.data(), scheme.length())); } -void WebFrame::RegisterURLSchemeAsPrivileged(const std::string& scheme, - mate::Arguments* args) { +void RegisterURLSchemeAsPrivileged(v8::Local window, + const std::string& scheme, + mate::Arguments* args) { // TODO(deepak1556): blink::SchemeRegistry methods should be called // before any renderer threads are created. Fixing this would break // current api. Change it with 2.0. @@ -273,7 +319,7 @@ void WebFrame::RegisterURLSchemeAsPrivileged(const std::string& scheme, bool allowServiceWorkers = true; bool supportFetchAPI = true; bool corsEnabled = true; - if (args->Length() == 2) { + if (args->Length() == 3) { mate::Dictionary options; if (args->GetNext(&options)) { options.Get("secure", &secure); @@ -303,30 +349,42 @@ void WebFrame::RegisterURLSchemeAsPrivileged(const std::string& scheme, } } -void WebFrame::InsertText(const std::string& text) { - web_frame_->FrameWidget()->GetActiveWebInputMethodController()->CommitText( - blink::WebString::FromUTF8(text), - blink::WebVector(), blink::WebRange(), 0); +void InsertText(v8::Local window, const std::string& text) { + blink::WebFrame* web_frame = GetRenderFrame(window)->GetWebFrame(); + if (web_frame->IsWebLocalFrame()) { + web_frame->ToWebLocalFrame() + ->FrameWidget() + ->GetActiveWebInputMethodController() + ->CommitText(blink::WebString::FromUTF8(text), + blink::WebVector(), + blink::WebRange(), 0); + } } -void WebFrame::InsertCSS(const std::string& css) { - web_frame_->GetDocument().InsertStyleSheet(blink::WebString::FromUTF8(css)); +void InsertCSS(v8::Local window, const std::string& css) { + blink::WebFrame* web_frame = GetRenderFrame(window)->GetWebFrame(); + if (web_frame->IsWebLocalFrame()) { + web_frame->ToWebLocalFrame()->GetDocument().InsertStyleSheet( + blink::WebString::FromUTF8(css)); + } } -void WebFrame::ExecuteJavaScript(const base::string16& code, - mate::Arguments* args) { +void ExecuteJavaScript(v8::Local window, + const base::string16& code, + mate::Arguments* args) { bool has_user_gesture = false; args->GetNext(&has_user_gesture); ScriptExecutionCallback::CompletionCallback completion_callback; args->GetNext(&completion_callback); std::unique_ptr callback( new ScriptExecutionCallback(completion_callback)); - web_frame_->RequestExecuteScriptAndReturnValue( + GetRenderFrame(window)->GetWebFrame()->RequestExecuteScriptAndReturnValue( blink::WebScriptSource(blink::WebString::FromUTF16(code)), has_user_gesture, callback.release()); } -void WebFrame::ExecuteJavaScriptInIsolatedWorld( +void ExecuteJavaScriptInIsolatedWorld( + v8::Local window, int world_id, const std::vector& scripts, mate::Arguments* args) { @@ -361,186 +419,131 @@ void WebFrame::ExecuteJavaScriptInIsolatedWorld( std::unique_ptr callback( new ScriptExecutionCallback(completion_callback)); - web_frame_->RequestExecuteScriptInIsolatedWorld( + GetRenderFrame(window)->GetWebFrame()->RequestExecuteScriptInIsolatedWorld( world_id, &sources.front(), sources.size(), has_user_gesture, scriptExecutionType, callback.release()); } -void WebFrame::SetIsolatedWorldSecurityOrigin(int world_id, - const std::string& origin_url) { - web_frame_->SetIsolatedWorldSecurityOrigin( +void SetIsolatedWorldSecurityOrigin(v8::Local window, + int world_id, + const std::string& origin_url) { + GetRenderFrame(window)->GetWebFrame()->SetIsolatedWorldSecurityOrigin( world_id, blink::WebSecurityOrigin::CreateFromString( blink::WebString::FromUTF8(origin_url))); } -void WebFrame::SetIsolatedWorldContentSecurityPolicy( - int world_id, - const std::string& security_policy) { - web_frame_->SetIsolatedWorldContentSecurityPolicy( +void SetIsolatedWorldContentSecurityPolicy(v8::Local window, + int world_id, + const std::string& security_policy) { + GetRenderFrame(window)->GetWebFrame()->SetIsolatedWorldContentSecurityPolicy( world_id, blink::WebString::FromUTF8(security_policy)); } -void WebFrame::SetIsolatedWorldHumanReadableName(int world_id, - const std::string& name) { - web_frame_->SetIsolatedWorldHumanReadableName( +void SetIsolatedWorldHumanReadableName(v8::Local window, + int world_id, + const std::string& name) { + GetRenderFrame(window)->GetWebFrame()->SetIsolatedWorldHumanReadableName( world_id, blink::WebString::FromUTF8(name)); } -// static -mate::Handle WebFrame::Create(v8::Isolate* isolate) { - return mate::CreateHandle(isolate, new WebFrame(isolate)); -} - -blink::WebCache::ResourceTypeStats WebFrame::GetResourceUsage( - v8::Isolate* isolate) { +blink::WebCache::ResourceTypeStats GetResourceUsage(v8::Isolate* isolate) { blink::WebCache::ResourceTypeStats stats; blink::WebCache::GetResourceTypeStats(&stats); return stats; } -void WebFrame::ClearCache(v8::Isolate* isolate) { +void ClearCache(v8::Isolate* isolate) { isolate->IdleNotificationDeadline(0.5); blink::WebCache::Clear(); base::MemoryPressureListener::NotifyMemoryPressure( base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL); } -v8::Local WebFrame::Opener() const { - blink::WebFrame* frame = web_frame_->Opener(); - if (frame && frame->IsWebLocalFrame()) - return mate::CreateHandle(isolate(), - new WebFrame(isolate(), frame->ToWebLocalFrame())) - .ToV8(); +v8::Local FindFrameByRoutingId(v8::Isolate* isolate, + v8::Local window, + int routing_id) { + content::RenderFrame* render_frame = + content::RenderFrame::FromRoutingID(routing_id); + if (render_frame) + return render_frame->GetWebFrame()->MainWorldScriptContext()->Global(); else - return v8::Null(isolate()); + return v8::Null(isolate); } -v8::Local WebFrame::Parent() const { - blink::WebFrame* frame = web_frame_->Parent(); +v8::Local GetOpener(v8::Isolate* isolate, + v8::Local window) { + blink::WebFrame* frame = GetRenderFrame(window)->GetWebFrame()->Opener(); if (frame && frame->IsWebLocalFrame()) - return mate::CreateHandle(isolate(), - new WebFrame(isolate(), frame->ToWebLocalFrame())) - .ToV8(); + return frame->ToWebLocalFrame()->MainWorldScriptContext()->Global(); else - return v8::Null(isolate()); + return v8::Null(isolate); } -v8::Local WebFrame::Top() const { - blink::WebFrame* frame = web_frame_->Top(); +v8::Local GetFrameParent(v8::Isolate* isolate, + v8::Local window) { + blink::WebFrame* frame = GetRenderFrame(window)->GetWebFrame()->Parent(); if (frame && frame->IsWebLocalFrame()) - return mate::CreateHandle(isolate(), - new WebFrame(isolate(), frame->ToWebLocalFrame())) - .ToV8(); + return frame->ToWebLocalFrame()->MainWorldScriptContext()->Global(); else - return v8::Null(isolate()); + return v8::Null(isolate); } -v8::Local WebFrame::FirstChild() const { - blink::WebFrame* frame = web_frame_->FirstChild(); +v8::Local GetTop(v8::Isolate* isolate, v8::Local window) { + blink::WebFrame* frame = GetRenderFrame(window)->GetWebFrame()->Top(); if (frame && frame->IsWebLocalFrame()) - return mate::CreateHandle(isolate(), - new WebFrame(isolate(), frame->ToWebLocalFrame())) - .ToV8(); + return frame->ToWebLocalFrame()->MainWorldScriptContext()->Global(); else - return v8::Null(isolate()); + return v8::Null(isolate); } -v8::Local WebFrame::NextSibling() const { - blink::WebFrame* frame = web_frame_->NextSibling(); +v8::Local GetFirstChild(v8::Isolate* isolate, + v8::Local window) { + blink::WebFrame* frame = GetRenderFrame(window)->GetWebFrame()->FirstChild(); if (frame && frame->IsWebLocalFrame()) - return mate::CreateHandle(isolate(), - new WebFrame(isolate(), frame->ToWebLocalFrame())) - .ToV8(); - else - return v8::Null(isolate()); -} - -v8::Local WebFrame::GetFrameForSelector( - const std::string& selector) const { - blink::WebElement element = web_frame_->GetDocument().QuerySelector( - blink::WebString::FromUTF8(selector)); - blink::WebLocalFrame* element_frame = - blink::WebLocalFrame::FromFrameOwnerElement(element); - if (element_frame) - return mate::CreateHandle(isolate(), new WebFrame(isolate(), element_frame)) - .ToV8(); + return frame->ToWebLocalFrame()->MainWorldScriptContext()->Global(); else - return v8::Null(isolate()); + return v8::Null(isolate); } -v8::Local WebFrame::FindFrameByName(const std::string& name) const { - blink::WebLocalFrame* local_frame = - web_frame_->FindFrameByName(blink::WebString::FromUTF8(name)) - ->ToWebLocalFrame(); - if (local_frame) - return mate::CreateHandle(isolate(), new WebFrame(isolate(), local_frame)) - .ToV8(); +v8::Local GetNextSibling(v8::Isolate* isolate, + v8::Local window) { + blink::WebFrame* frame = GetRenderFrame(window)->GetWebFrame()->NextSibling(); + if (frame && frame->IsWebLocalFrame()) + return frame->ToWebLocalFrame()->MainWorldScriptContext()->Global(); else - return v8::Null(isolate()); + return v8::Null(isolate); } -v8::Local WebFrame::FindFrameByRoutingId(int routing_id) const { - content::RenderFrame* render_frame = - content::RenderFrame::FromRoutingID(routing_id); - blink::WebLocalFrame* local_frame = nullptr; - if (render_frame) - local_frame = render_frame->GetWebFrame(); - if (local_frame) - return mate::CreateHandle(isolate(), new WebFrame(isolate(), local_frame)) - .ToV8(); +v8::Local GetFrameForSelector(v8::Isolate* isolate, + v8::Local window, + const std::string& selector) { + blink::WebElement element = + GetRenderFrame(window)->GetWebFrame()->GetDocument().QuerySelector( + blink::WebString::FromUTF8(selector)); + if (element.IsNull()) // not found + return v8::Null(isolate); + + blink::WebFrame* frame = blink::WebFrame::FromFrameOwnerElement(element); + if (frame && frame->IsWebLocalFrame()) + return frame->ToWebLocalFrame()->MainWorldScriptContext()->Global(); else - return v8::Null(isolate()); + return v8::Null(isolate); } -v8::Local WebFrame::RoutingId() const { - int routing_id = content::RenderFrame::GetRoutingIdForWebFrame(web_frame_); - return v8::Number::New(isolate(), routing_id); +v8::Local FindFrameByName(v8::Isolate* isolate, + v8::Local window, + const std::string& name) { + blink::WebFrame* frame = + GetRenderFrame(window)->GetWebFrame()->FindFrameByName( + blink::WebString::FromUTF8(name)); + if (frame && frame->IsWebLocalFrame()) + return frame->ToWebLocalFrame()->MainWorldScriptContext()->Global(); + else + return v8::Null(isolate); } -// static -void WebFrame::BuildPrototype(v8::Isolate* isolate, - v8::Local prototype) { - prototype->SetClassName(mate::StringToV8(isolate, "WebFrame")); - mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate()) - .SetMethod("setName", &WebFrame::SetName) - .SetMethod("setZoomLevel", &WebFrame::SetZoomLevel) - .SetMethod("getZoomLevel", &WebFrame::GetZoomLevel) - .SetMethod("setZoomFactor", &WebFrame::SetZoomFactor) - .SetMethod("getZoomFactor", &WebFrame::GetZoomFactor) - .SetMethod("setVisualZoomLevelLimits", - &WebFrame::SetVisualZoomLevelLimits) - .SetMethod("setLayoutZoomLevelLimits", - &WebFrame::SetLayoutZoomLevelLimits) - .SetMethod("registerEmbedderCustomElement", - &WebFrame::RegisterEmbedderCustomElement) - .SetMethod("getWebFrameId", &WebFrame::GetWebFrameId) - .SetMethod("setSpellCheckProvider", &WebFrame::SetSpellCheckProvider) - .SetMethod("registerURLSchemeAsBypassingCSP", - &WebFrame::RegisterURLSchemeAsBypassingCSP) - .SetMethod("registerURLSchemeAsPrivileged", - &WebFrame::RegisterURLSchemeAsPrivileged) - .SetMethod("insertText", &WebFrame::InsertText) - .SetMethod("insertCSS", &WebFrame::InsertCSS) - .SetMethod("executeJavaScript", &WebFrame::ExecuteJavaScript) - .SetMethod("executeJavaScriptInIsolatedWorld", - &WebFrame::ExecuteJavaScriptInIsolatedWorld) - .SetMethod("setIsolatedWorldSecurityOrigin", - &WebFrame::SetIsolatedWorldSecurityOrigin) - .SetMethod("setIsolatedWorldContentSecurityPolicy", - &WebFrame::SetIsolatedWorldContentSecurityPolicy) - .SetMethod("setIsolatedWorldHumanReadableName", - &WebFrame::SetIsolatedWorldHumanReadableName) - .SetMethod("getResourceUsage", &WebFrame::GetResourceUsage) - .SetMethod("clearCache", &WebFrame::ClearCache) - .SetMethod("getFrameForSelector", &WebFrame::GetFrameForSelector) - .SetMethod("findFrameByName", &WebFrame::FindFrameByName) - .SetProperty("opener", &WebFrame::Opener) - .SetProperty("parent", &WebFrame::Parent) - .SetProperty("top", &WebFrame::Top) - .SetProperty("firstChild", &WebFrame::FirstChild) - .SetProperty("nextSibling", &WebFrame::NextSibling) - .SetProperty("routingId", &WebFrame::RoutingId) - .SetMethod("findFrameByRoutingId", &WebFrame::FindFrameByRoutingId); +int GetRoutingId(v8::Local window) { + return GetRenderFrame(window)->GetRoutingID(); } } // namespace api @@ -549,16 +552,51 @@ void WebFrame::BuildPrototype(v8::Isolate* isolate, namespace { -using atom::api::WebFrame; - void Initialize(v8::Local exports, v8::Local unused, v8::Local context, void* priv) { + using namespace atom::api; // NOLINT(build/namespaces) + v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); - dict.Set("webFrame", WebFrame::Create(isolate)); - dict.Set("WebFrame", WebFrame::GetConstructor(isolate)->GetFunction()); + dict.SetMethod("setName", &SetName); + dict.SetMethod("setZoomLevel", &SetZoomLevel); + dict.SetMethod("getZoomLevel", &GetZoomLevel); + dict.SetMethod("setZoomFactor", &SetZoomFactor); + dict.SetMethod("getZoomFactor", &GetZoomFactor); + dict.SetMethod("setVisualZoomLevelLimits", &SetVisualZoomLevelLimits); + dict.SetMethod("setLayoutZoomLevelLimits", &SetLayoutZoomLevelLimits); + dict.SetMethod("registerEmbedderCustomElement", + &RegisterEmbedderCustomElement); + dict.SetMethod("getWebFrameId", &GetWebFrameId); + dict.SetMethod("setSpellCheckProvider", &SetSpellCheckProvider); + dict.SetMethod("registerURLSchemeAsBypassingCSP", + &RegisterURLSchemeAsBypassingCSP); + dict.SetMethod("registerURLSchemeAsPrivileged", + &RegisterURLSchemeAsPrivileged); + dict.SetMethod("insertText", &InsertText); + dict.SetMethod("insertCSS", &InsertCSS); + dict.SetMethod("executeJavaScript", &ExecuteJavaScript); + dict.SetMethod("executeJavaScriptInIsolatedWorld", + &ExecuteJavaScriptInIsolatedWorld); + dict.SetMethod("setIsolatedWorldSecurityOrigin", + &SetIsolatedWorldSecurityOrigin); + dict.SetMethod("setIsolatedWorldContentSecurityPolicy", + &SetIsolatedWorldContentSecurityPolicy); + dict.SetMethod("setIsolatedWorldHumanReadableName", + &SetIsolatedWorldHumanReadableName); + dict.SetMethod("getResourceUsage", &GetResourceUsage); + dict.SetMethod("clearCache", &ClearCache); + dict.SetMethod("_findFrameByRoutingId", &FindFrameByRoutingId); + dict.SetMethod("_getFrameForSelector", &GetFrameForSelector); + dict.SetMethod("_findFrameByName", &FindFrameByName); + dict.SetMethod("_getOpener", &GetOpener); + dict.SetMethod("_getParent", &GetFrameParent); + dict.SetMethod("_getTop", &GetTop); + dict.SetMethod("_getFirstChild", &GetFirstChild); + dict.SetMethod("_getNextSibling", &GetNextSibling); + dict.SetMethod("_getRoutingId", &GetRoutingId); } } // namespace diff --git a/atom/renderer/api/atom_api_web_frame.h b/atom/renderer/api/atom_api_web_frame.h deleted file mode 100644 index 3b57d663b5ea1..0000000000000 --- a/atom/renderer/api/atom_api_web_frame.h +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) 2014 GitHub, Inc. -// Use of this source code is governed by the MIT license that can be -// found in the LICENSE file. - -#ifndef ATOM_RENDERER_API_ATOM_API_WEB_FRAME_H_ -#define ATOM_RENDERER_API_ATOM_API_WEB_FRAME_H_ - -#include -#include -#include - -#include "native_mate/handle.h" -#include "native_mate/wrappable.h" -#include "third_party/WebKit/public/platform/WebCache.h" - -namespace blink { -class WebLocalFrame; -} - -namespace mate { -class Dictionary; -class Arguments; -} // namespace mate - -namespace atom { - -namespace api { - -class WebFrame : public mate::Wrappable { - public: - static mate::Handle Create(v8::Isolate* isolate); - - static void BuildPrototype(v8::Isolate* isolate, - v8::Local prototype); - - private: - explicit WebFrame(v8::Isolate* isolate); - explicit WebFrame(v8::Isolate* isolate, blink::WebLocalFrame* blink_frame); - ~WebFrame() override; - - void SetName(const std::string& name); - - double SetZoomLevel(double level); - double GetZoomLevel() const; - double SetZoomFactor(double factor); - double GetZoomFactor() const; - - void SetVisualZoomLevelLimits(double min_level, double max_level); - void SetLayoutZoomLevelLimits(double min_level, double max_level); - - v8::Local RegisterEmbedderCustomElement( - const base::string16& name, - v8::Local options); - int GetWebFrameId(v8::Local content_window); - - // Set the provider that will be used by SpellCheckClient for spell check. - void SetSpellCheckProvider(mate::Arguments* args, - const std::string& language, - bool auto_spell_correct_turned_on, - v8::Local provider); - - void RegisterURLSchemeAsBypassingCSP(const std::string& scheme); - void RegisterURLSchemeAsPrivileged(const std::string& scheme, - mate::Arguments* args); - - // Editing. - void InsertText(const std::string& text); - void InsertCSS(const std::string& css); - - // Executing scripts. - void ExecuteJavaScript(const base::string16& code, mate::Arguments* args); - void ExecuteJavaScriptInIsolatedWorld( - int world_id, - const std::vector& scripts, - mate::Arguments* args); - - // Isolated world related methods - void SetIsolatedWorldSecurityOrigin(int world_id, - const std::string& origin_url); - void SetIsolatedWorldContentSecurityPolicy( - int world_id, - const std::string& security_policy); - void SetIsolatedWorldHumanReadableName(int world_id, const std::string& name); - - // Resource related methods - blink::WebCache::ResourceTypeStats GetResourceUsage(v8::Isolate* isolate); - void ClearCache(v8::Isolate* isolate); - - // Frame navigation - v8::Local Opener() const; - v8::Local Parent() const; - v8::Local Top() const; - v8::Local FirstChild() const; - v8::Local NextSibling() const; - v8::Local GetFrameForSelector(const std::string& selector) const; - v8::Local FindFrameByName(const std::string& name) const; - v8::Local FindFrameByRoutingId(int routing_id) const; - v8::Local RoutingId() const; - - blink::WebLocalFrame* web_frame_; - - DISALLOW_COPY_AND_ASSIGN(WebFrame); -}; - -} // namespace api - -} // namespace atom - -#endif // ATOM_RENDERER_API_ATOM_API_WEB_FRAME_H_ diff --git a/filenames.gypi b/filenames.gypi index fd90119491fe8..789aad67d8ac9 100644 --- a/filenames.gypi +++ b/filenames.gypi @@ -537,7 +537,6 @@ 'atom/renderer/api/atom_api_spell_check_client.cc', 'atom/renderer/api/atom_api_spell_check_client.h', 'atom/renderer/api/atom_api_web_frame.cc', - 'atom/renderer/api/atom_api_web_frame.h', 'atom/renderer/atom_autofill_agent.cc', 'atom/renderer/atom_autofill_agent.h', 'atom/renderer/atom_render_frame_observer.cc', diff --git a/lib/renderer/api/web-frame.js b/lib/renderer/api/web-frame.js index 3241858cfaccf..534a98a28b1ce 100644 --- a/lib/renderer/api/web-frame.js +++ b/lib/renderer/api/web-frame.js @@ -1,13 +1,67 @@ 'use strict' -const {EventEmitter} = require('events') -const {webFrame, WebFrame} = process.atomBinding('web_frame') +const { EventEmitter } = require('events') +const binding = process.atomBinding('web_frame') -// WebFrame is an EventEmitter. -Object.setPrototypeOf(WebFrame.prototype, EventEmitter.prototype) -EventEmitter.call(webFrame) +class WebFrame extends EventEmitter { + constructor (context) { + super() -// Lots of webview would subscribe to webFrame's events. -webFrame.setMaxListeners(0) + this.context = context + // Lots of webview would subscribe to webFrame's events. + this.setMaxListeners(0) + } -module.exports = webFrame + findFrameByRoutingId (...args) { + return getWebFrame(binding._findFrameByRoutingId(this.context, ...args)) + } + + getFrameForSelector (...args) { + return getWebFrame(binding._getFrameForSelector(this.context, ...args)) + } + + findFrameByName (...args) { + return getWebFrame(binding._findFrameByName(this.context, ...args)) + } + + get opener () { + return getWebFrame(binding._getOpener(this.context)) + } + + get parent () { + return getWebFrame(binding._getParent(this.context)) + } + + get top () { + return getWebFrame(binding._getTop(this.context)) + } + + get firstChild () { + return getWebFrame(binding._getFirstChild(this.context)) + } + + get nextSibling () { + return getWebFrame(binding._getNextSibling(this.context)) + } + + get routingId () { + return binding._getRoutingId(this.context) + } +} + +// Populate the methods. +for (const name in binding) { + if (!name.startsWith('_')) { // some methods are manully populated above + WebFrame.prototype[name] = function (...args) { + return binding[name](this.context, ...args) + } + } +} + +// Helper to return WebFrame or null depending on context. +// TODO(zcbenz): Consider returning same WebFrame for the same context. +function getWebFrame (context) { + return context ? new WebFrame(context) : null +} + +module.exports = new WebFrame(window) diff --git a/spec/api-web-frame-spec.js b/spec/api-web-frame-spec.js index b8fd10b5d3f13..2a4a41fe4a129 100644 --- a/spec/api-web-frame-spec.js +++ b/spec/api-web-frame-spec.js @@ -158,4 +158,28 @@ describe('webFrame module', function () { const [, text] = await spellCheckerFeedback expect(text).to.equal(misspelledWord) }) + + it('top is self for top frame', () => { + expect(webFrame.top.context).to.equal(webFrame.context) + }) + + it('opener is null for top frame', () => { + expect(webFrame.opener).to.be.null() + }) + + it('firstChild is null for top frame', () => { + expect(webFrame.firstChild).to.be.null() + }) + + it('getFrameForSelector() does not crash when not found', () => { + expect(webFrame.getFrameForSelector('unexist-selector')).to.be.null() + }) + + it('findFrameByName() does not crash when not found', () => { + expect(webFrame.findFrameByName('unexist-name')).to.be.null() + }) + + it('findFrameByRoutingId() does not crash when not found', () => { + expect(webFrame.findFrameByRoutingId(-1)).to.be.null() + }) }) From 439e9d61d6afaf6688ac7114983b5420f054e58f Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Fri, 15 Feb 2019 11:02:31 -0800 Subject: [PATCH 18/72] Revert "Bump v3.1.4" This reverts commit 0082e8083cd4506be9841fc339f5547c8f85e9c5. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index afa45f0429348..965bbb836f775 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.4 + 3.1.3 CFBundleShortVersionString - 3.1.4 + 3.1.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 7aab0a2040c0c..70cf6a4f80cc8 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,4,0 - PRODUCTVERSION 3,1,4,0 + FILEVERSION 3,1,3,0 + PRODUCTVERSION 3,1,3,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.4" + VALUE "FileVersion", "3.1.3" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.4" + VALUE "ProductVersion", "3.1.3" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 3cb579a2e3762..a05475205fb8a 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 4 +#define ATOM_PATCH_VERSION 3 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index ae3faf87b403a..8cef1e8a27bea 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.4', + 'version%': '3.1.3', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 0435bcf110c36..f05cdddf3392d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.3", + "version": "3.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2f24f7a5543a8..a8101f03b9c70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.4", + "version": "3.1.3", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 08d8c1672009f584051cd412c5df2cbe8b0fa2eb Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Fri, 15 Feb 2019 11:06:36 -0800 Subject: [PATCH 19/72] Bump v3.1.4 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 965bbb836f775..afa45f0429348 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.3 + 3.1.4 CFBundleShortVersionString - 3.1.3 + 3.1.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 70cf6a4f80cc8..7aab0a2040c0c 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,3,0 - PRODUCTVERSION 3,1,3,0 + FILEVERSION 3,1,4,0 + PRODUCTVERSION 3,1,4,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.3" + VALUE "FileVersion", "3.1.4" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.3" + VALUE "ProductVersion", "3.1.4" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index a05475205fb8a..3cb579a2e3762 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 3 +#define ATOM_PATCH_VERSION 4 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 8cef1e8a27bea..ae3faf87b403a 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.3', + 'version%': '3.1.4', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index f05cdddf3392d..0435bcf110c36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.2", + "version": "3.1.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a8101f03b9c70..2f24f7a5543a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.3", + "version": "3.1.4", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 36f7974e188a649d0a9a27fd1d242454d8ff17d1 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Wed, 27 Feb 2019 10:10:18 -0800 Subject: [PATCH 20/72] fix: set cancelId to 1 when defaultId == 0 and no 'cancel' button (#17149) --- lib/browser/api/dialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/browser/api/dialog.js b/lib/browser/api/dialog.js index d7545a7687a6c..279f1cd848f94 100644 --- a/lib/browser/api/dialog.js +++ b/lib/browser/api/dialog.js @@ -263,7 +263,8 @@ module.exports = { // Choose a default button to get selected when dialog is cancelled. if (cancelId == null) { - cancelId = 0 + // If the defaultId is set to 0, ensure the cancel button is a different index (1) + cancelId = (defaultId === 0 && buttons.length > 1) ? 1 : 0 for (let i = 0; i < buttons.length; i++) { const text = buttons[i].toLowerCase() if (text === 'cancel' || text === 'no') { From b37884cb5e55af74d0455bd1b7f1795d5f11539d Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 4 Mar 2019 14:53:46 -0800 Subject: [PATCH 21/72] Bump v3.1.5 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index afa45f0429348..677ec8d937dd0 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.4 + 3.1.5 CFBundleShortVersionString - 3.1.4 + 3.1.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 7aab0a2040c0c..3c759538e10de 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,4,0 - PRODUCTVERSION 3,1,4,0 + FILEVERSION 3,1,5,0 + PRODUCTVERSION 3,1,5,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.4" + VALUE "FileVersion", "3.1.5" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.4" + VALUE "ProductVersion", "3.1.5" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 3cb579a2e3762..b238fd4f121b8 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 4 +#define ATOM_PATCH_VERSION 5 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index ae3faf87b403a..08e73ed90a4f2 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.4', + 'version%': '3.1.5', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 0435bcf110c36..0a5079b1ee34b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.3", + "version": "3.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2f24f7a5543a8..1f4fe6435c6eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.4", + "version": "3.1.5", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 4ff0b8d6b5cd70c979fd67975de73da10f1cd640 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 4 Mar 2019 14:58:08 -0800 Subject: [PATCH 22/72] Revert "Bump v3.1.5" This reverts commit b37884cb5e55af74d0455bd1b7f1795d5f11539d. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 677ec8d937dd0..afa45f0429348 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.5 + 3.1.4 CFBundleShortVersionString - 3.1.5 + 3.1.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 3c759538e10de..7aab0a2040c0c 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,5,0 - PRODUCTVERSION 3,1,5,0 + FILEVERSION 3,1,4,0 + PRODUCTVERSION 3,1,4,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.5" + VALUE "FileVersion", "3.1.4" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.5" + VALUE "ProductVersion", "3.1.4" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index b238fd4f121b8..3cb579a2e3762 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 5 +#define ATOM_PATCH_VERSION 4 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 08e73ed90a4f2..ae3faf87b403a 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.5', + 'version%': '3.1.4', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 0a5079b1ee34b..0435bcf110c36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.4", + "version": "3.1.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1f4fe6435c6eb..2f24f7a5543a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.5", + "version": "3.1.4", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 60d85d03a4aa46f4c440e04ac6ea3020c1adf541 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Mon, 4 Mar 2019 15:05:36 -0800 Subject: [PATCH 23/72] Bump v3.1.5 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index afa45f0429348..677ec8d937dd0 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.4 + 3.1.5 CFBundleShortVersionString - 3.1.4 + 3.1.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 7aab0a2040c0c..3c759538e10de 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,4,0 - PRODUCTVERSION 3,1,4,0 + FILEVERSION 3,1,5,0 + PRODUCTVERSION 3,1,5,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.4" + VALUE "FileVersion", "3.1.5" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.4" + VALUE "ProductVersion", "3.1.5" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 3cb579a2e3762..b238fd4f121b8 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 4 +#define ATOM_PATCH_VERSION 5 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index ae3faf87b403a..08e73ed90a4f2 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.4', + 'version%': '3.1.5', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 0435bcf110c36..0a5079b1ee34b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.3", + "version": "3.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2f24f7a5543a8..1f4fe6435c6eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.4", + "version": "3.1.5", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From d29afb5f491739b7feae4f589da3dfb39e9b8dc5 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Thu, 7 Mar 2019 17:45:20 -0500 Subject: [PATCH 24/72] build: Fix windows test hang (#17271) * Try to track down test hangs * Run tests with cmd instead of powershell * Fix skip condition * Update libcc to latest * Turn off verbose logging on tests * Revert "Update libcc to latest" This reverts commit 972bbe0f3f7af709246441ff0c97cf6693e7ee5f. --- appveyor.yml | 17 ++++------------- spec/api-browser-window-spec.js | 8 +++++--- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index da63f4018483f..1310b77c79b9f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ build_script: echo "Build worker image $env:APPVEYOR_BUILD_WORKER_IMAGE" &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" - + if($env:SKIP_GYP_BUILD -eq "true") { Write-warning "Skipping debug build for older branch"; Exit-AppveyorBuild } elseif(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) { @@ -43,20 +43,11 @@ test_script: if (Test-Path Env:\ELECTRON_RELEASE) { Write-Output "Skipping tests for release build" } else { + $env:RUN_TESTS="true" Write-Output "Running tests for debug build" - python script\test.py --ci --rebuild_native_modules - if ($LASTEXITCODE -ne '0') { - throw "Tests failed with exit code $LASTEXITCODE" - } else { - Write-Output "Tests succeeded." - } - python script\verify-ffmpeg.py - if ($LASTEXITCODE -ne '0') { - throw "Verify ffmpeg failed with exit code $LASTEXITCODE" - } else { - "Verify ffmpeg succeeded." - } } +- if "%RUN_TESTS%"=="true" ( echo Running test suite & python script\test.py --ci --rebuild_native_modules) +- if "%RUN_TESTS%"=="true" ( echo Running verify ffmpeg & python script\verify-ffmpeg.py) artifacts: - path: test-results.xml name: test-results.xml diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 0802e5302d48a..4f59ff410e0bc 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -2791,9 +2791,11 @@ describe('BrowserWindow module', () => { }) describe('window.getNativeWindowHandle()', () => { - if (!nativeModulesEnabled) { - this.skip() - } + before(function () { + if (!nativeModulesEnabled) { + this.skip() + } + }) it('returns valid handle', () => { // The module's source code is hosted at From 94f7cbe1dc450e3492f3f231e9b3075c766682f1 Mon Sep 17 00:00:00 2001 From: Roller Bot <42361097+roller-bot@users.noreply.github.com> Date: Thu, 7 Mar 2019 16:08:38 -0800 Subject: [PATCH 25/72] chore: bump libcc (3-1-x) (#17273) * chore: bump libcc submodule to 5ff272e25eb552d8c0e7f07f919ed0bad804500b * chore: bump libcc in DEPS to 5ff272e25eb552d8c0e7f07f919ed0bad804500b --- DEPS | 2 +- vendor/libchromiumcontent | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3e4ad8a696667..9e85f71493e02 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ vars = { 'chromium_version': '63.0.3239.150', 'libchromiumcontent_revision': - 'cd7a2326b0668f24b83d568eccab16ee9ba8dc9a', + '5ff272e25eb552d8c0e7f07f919ed0bad804500b', 'node_version': 'v9.7.0-33-g538a5023af', 'native_mate_revision': diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index cd7a2326b0668..5ff272e25eb55 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit cd7a2326b0668f24b83d568eccab16ee9ba8dc9a +Subproject commit 5ff272e25eb552d8c0e7f07f919ed0bad804500b From 1d93989d268bddb3e5bb759744fe3a1815bdd5d4 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 7 Mar 2019 16:38:09 -0800 Subject: [PATCH 26/72] Bump v3.1.6 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 677ec8d937dd0..37cb92b4236b4 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.5 + 3.1.6 CFBundleShortVersionString - 3.1.5 + 3.1.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 3c759538e10de..2152c9f4382f7 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,5,0 - PRODUCTVERSION 3,1,5,0 + FILEVERSION 3,1,6,0 + PRODUCTVERSION 3,1,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.5" + VALUE "FileVersion", "3.1.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.5" + VALUE "ProductVersion", "3.1.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index b238fd4f121b8..7490f826b1a07 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 5 +#define ATOM_PATCH_VERSION 6 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 08e73ed90a4f2..07b098b693eda 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.5', + 'version%': '3.1.6', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 0a5079b1ee34b..1619ddd954e00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.4", + "version": "3.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1f4fe6435c6eb..30ff85927ff36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.5", + "version": "3.1.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 9e6219771365caf07d1ec8db119773284935e1e1 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Thu, 7 Mar 2019 19:03:37 -0800 Subject: [PATCH 27/72] Revert "Bump v3.1.6" This reverts commit 1d93989d268bddb3e5bb759744fe3a1815bdd5d4. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 37cb92b4236b4..677ec8d937dd0 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.6 + 3.1.5 CFBundleShortVersionString - 3.1.6 + 3.1.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 2152c9f4382f7..3c759538e10de 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,6,0 - PRODUCTVERSION 3,1,6,0 + FILEVERSION 3,1,5,0 + PRODUCTVERSION 3,1,5,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.6" + VALUE "FileVersion", "3.1.5" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.6" + VALUE "ProductVersion", "3.1.5" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 7490f826b1a07..b238fd4f121b8 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 5 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 07b098b693eda..08e73ed90a4f2 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.6', + 'version%': '3.1.5', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 1619ddd954e00..0a5079b1ee34b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.5", + "version": "3.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 30ff85927ff36..1f4fe6435c6eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.5", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 73158a6419a3e2da9e4d523e1131052abd28fbbb Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 7 Mar 2019 19:15:50 -0800 Subject: [PATCH 28/72] Bump v3.1.6 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 677ec8d937dd0..37cb92b4236b4 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.5 + 3.1.6 CFBundleShortVersionString - 3.1.5 + 3.1.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 3c759538e10de..2152c9f4382f7 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,5,0 - PRODUCTVERSION 3,1,5,0 + FILEVERSION 3,1,6,0 + PRODUCTVERSION 3,1,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.5" + VALUE "FileVersion", "3.1.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.5" + VALUE "ProductVersion", "3.1.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index b238fd4f121b8..7490f826b1a07 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 5 +#define ATOM_PATCH_VERSION 6 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 08e73ed90a4f2..07b098b693eda 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.5', + 'version%': '3.1.6', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 0a5079b1ee34b..1619ddd954e00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.4", + "version": "3.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1f4fe6435c6eb..30ff85927ff36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.5", + "version": "3.1.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 93eef7dca0675332947736949e079b86a3a46398 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Mon, 11 Mar 2019 15:41:20 -0400 Subject: [PATCH 29/72] build: move macos release builds to CircleCI (3-1-x) (#17277) --- .circleci/config.yml | 4 ++ script/ci-release-build.js | 82 ++------------------------------------ vsts.yml | 51 ------------------------ 3 files changed, 8 insertions(+), 129 deletions(-) delete mode 100644 vsts.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c5bd4dfcc450..b6a02947b9a53 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -263,6 +263,7 @@ jobs: TARGET_ARCH: x64 RUN_TESTS: true INSTALL_MACOS_NODE: true + resource_class: large macos: xcode: "8.3.3" <<: *build-steps @@ -272,6 +273,7 @@ jobs: TARGET_ARCH: x64 RUN_RELEASE_BUILD: true INSTALL_MACOS_NODE: true + resource_class: large macos: xcode: "8.3.3" <<: *build-steps @@ -282,6 +284,7 @@ jobs: MAS_BUILD: 1 RUN_TESTS: true INSTALL_MACOS_NODE: true + resource_class: large macos: xcode: "8.3.3" <<: *build-steps @@ -292,6 +295,7 @@ jobs: MAS_BUILD: 1 RUN_RELEASE_BUILD: true INSTALL_MACOS_NODE: true + resource_class: large macos: xcode: "8.3.3" <<: *build-steps diff --git a/script/ci-release-build.js b/script/ci-release-build.js index 4403bd7f74c17..5b3c17946bc4f 100644 --- a/script/ci-release-build.js +++ b/script/ci-release-build.js @@ -3,7 +3,6 @@ require('dotenv-safe').load() const assert = require('assert') const request = require('request') const buildAppVeyorURL = 'https://windows-ci.electronjs.org/api/builds' -const vstsURL = 'https://github.visualstudio.com/electron/_apis/build' const appVeyorJobs = { 'electron-x64': 'electron', @@ -14,13 +13,9 @@ const circleCIJobs = [ 'electron-linux-arm', 'electron-linux-arm64', 'electron-linux-ia32', -// 'electron-linux-mips64el', - 'electron-linux-x64' -] - -const vstsJobs = [ - 'electron-release-mas-x64', - 'electron-release-osx-x64' + 'electron-linux-x64', + 'electron-osx-x64', + 'electron-mas-x64' ] async function makeRequest (requestOptions, parseResponse) { @@ -139,70 +134,6 @@ function buildCircleCI (targetBranch, options) { } } -async function buildVSTS (targetBranch, options) { - if (options.job) { - assert(vstsJobs.includes(options.job), `Unknown VSTS CI job name: ${options.job}. Valid values are: ${vstsJobs}.`) - } - console.log(`Triggering VSTS to run build on branch: ${targetBranch} with release flag.`) - let environmentVariables = {} - - if (!options.ghRelease) { - environmentVariables.UPLOAD_TO_S3 = 1 - } - - if (options.automaticRelease) { - environmentVariables.AUTO_RELEASE = 'true' - } - - let requestOpts = { - url: `${vstsURL}/definitions?api-version=4.1`, - auth: { - user: '', - password: process.env.VSTS_TOKEN - }, - headers: { - 'Content-Type': 'application/json' - } - } - let vstsResponse = await makeRequest(requestOpts, true).catch(err => { - console.log('Error calling VSTS to get build definitions:', err) - }) - let buildsToRun = [] - if (options.job) { - buildsToRun = vstsResponse.value.filter(build => build.name === options.job) - } else { - buildsToRun = vstsResponse.value.filter(build => vstsJobs.includes(build.name)) - } - buildsToRun.forEach((build) => callVSTSBuild(build, targetBranch, environmentVariables)) -} - -async function callVSTSBuild (build, targetBranch, environmentVariables) { - let buildBody = { - definition: build, - sourceBranch: targetBranch, - priority: 'high' - } - if (Object.keys(environmentVariables).length !== 0) { - buildBody.parameters = JSON.stringify(environmentVariables) - } - let requestOpts = { - url: `${vstsURL}/builds?api-version=4.1`, - auth: { - user: '', - password: process.env.VSTS_TOKEN - }, - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(buildBody), - method: 'POST' - } - let vstsResponse = await makeRequest(requestOpts, true).catch(err => { - console.log(`Error calling VSTS for job ${build.name}`, err) - }) - console.log(`VSTS release build request for ${build.name} successful. Check ${vstsResponse._links.web.href} for status.`) -} - function runRelease (targetBranch, options) { if (options.ci) { switch (options.ci) { @@ -214,10 +145,6 @@ function runRelease (targetBranch, options) { buildAppVeyor(targetBranch, options) break } - case 'VSTS': { - buildVSTS(targetBranch, options) - break - } default: { console.log(`Error! Unknown CI: ${options.ci}.`) process.exit(1) @@ -226,7 +153,6 @@ function runRelease (targetBranch, options) { } else { buildCircleCI(targetBranch, options) buildAppVeyor(targetBranch, options) - buildVSTS(targetBranch, options) } } @@ -239,7 +165,7 @@ if (require.main === module) { const targetBranch = args._[0] if (args._.length < 1) { console.log(`Trigger CI to build release builds of electron. - Usage: ci-release-build.js [--job=CI_JOB_NAME] [--ci=CircleCI|AppVeyor|VSTS] [--ghRelease] [--automaticRelease] TARGET_BRANCH + Usage: ci-release-build.js [--job=CI_JOB_NAME] [--ci=CircleCI|AppVeyor] [--ghRelease] [--automaticRelease] TARGET_BRANCH `) process.exit(0) } diff --git a/vsts.yml b/vsts.yml deleted file mode 100644 index ef76840517595..0000000000000 --- a/vsts.yml +++ /dev/null @@ -1,51 +0,0 @@ -resources: -- repo: self -steps: -- bash: | - echo 'Non release VSTS builds do not run on older branches' - displayName: Skip build on older branch - condition: ne(variables['ELECTRON_RELEASE'], '1') - -- bash: | - git clean -fdx - displayName: Clean unneeded git directories - timeoutInMinutes: 2 - condition: eq(variables['ELECTRON_RELEASE'], '1') - -- bash: | - echo 'Bootstrapping Electron for release build' - script/bootstrap.py --target_arch=$TARGET_ARCH - name: Bootstrap - condition: eq(variables['ELECTRON_RELEASE'], '1') - -- bash: | - echo 'Building Electron for release' - script/build.py -c R - name: Build - condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1')) - -- bash: | - echo 'Creating Electron release distribution' - script/create-dist.py - name: Create_distribution - condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1')) - -- bash: | - if [ "$UPLOAD_TO_S3" != "1" ]; then - echo 'Uploading Electron release distribution to github releases' - ELECTRON_S3_BUCKET="$(s3_bucket)" ELECTRON_S3_ACCESS_KEY="$(s3_access_key)" ELECTRON_S3_SECRET_KEY="$(s3_secret_key)" ELECTRON_GITHUB_TOKEN="$(github_token)" script/upload.py - else - echo 'Uploading Electron release distribution to s3' - ELECTRON_S3_BUCKET="$(s3_bucket)" ELECTRON_S3_ACCESS_KEY="$(s3_access_key)" ELECTRON_S3_SECRET_KEY="$(s3_secret_key)" ELECTRON_GITHUB_TOKEN="$(github_token)" script/upload.py --upload_to_s3 - fi - name: Upload_distribution - condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1')) - -- task: PublishBuildArtifacts@1 - displayName: Publish Build Artifacts - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/out' - ArtifactName: out - condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1')) - -- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 From e0519dad72690bd55863b9b588c2160dd03c14d1 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Mon, 11 Mar 2019 17:19:57 -0700 Subject: [PATCH 30/72] fix: remove label/image from segment if they are mutated to undefined/null (#17336) --- atom/browser/ui/cocoa/atom_touch_bar.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/atom/browser/ui/cocoa/atom_touch_bar.mm b/atom/browser/ui/cocoa/atom_touch_bar.mm index 72777c491f8a6..44ae7d4f3ea19 100644 --- a/atom/browser/ui/cocoa/atom_touch_bar.mm +++ b/atom/browser/ui/cocoa/atom_touch_bar.mm @@ -623,9 +623,14 @@ - (void)updateSegmentedControl:(NSCustomTouchBarItem*)item segments[i].Get("enabled", &enabled); if (segments[i].Get("label", &label)) { [control setLabel:base::SysUTF8ToNSString(label) forSegment:i]; - } else if (segments[i].Get("icon", &image)) { + } else { + [control setLabel:@"" forSegment:i]; + } + if (segments[i].Get("icon", &image)) { [control setImage:image.AsNSImage() forSegment:i]; [control setImageScaling:NSImageScaleProportionallyUpOrDown forSegment:i]; + } else { + [control setImage:nil forSegment:i]; } [control setEnabled:enabled forSegment:i]; } From 02d357619e4831943489b6b8306531261c6bb3e8 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Wed, 13 Mar 2019 18:21:07 -0700 Subject: [PATCH 31/72] fix: don't crash when nativeImage.createFromBuffer() called with invalid buffer (#17372) --- atom/common/api/atom_api_native_image.cc | 5 +++++ spec/api-native-image-spec.js | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index 7b274b38cae7e..1356e4eb589c5 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -508,6 +508,11 @@ mate::Handle NativeImage::CreateFromPath( mate::Handle NativeImage::CreateFromBuffer( mate::Arguments* args, v8::Local buffer) { + if (!node::Buffer::HasInstance(buffer)) { + args->ThrowError("buffer must be a node Buffer"); + return mate::Handle(); + } + int width = 0; int height = 0; double scale_factor = 1.; diff --git a/spec/api-native-image-spec.js b/spec/api-native-image-spec.js index 87399921ff14a..a2876d732a54d 100644 --- a/spec/api-native-image-spec.js +++ b/spec/api-native-image-spec.js @@ -125,7 +125,7 @@ describe('nativeImage module', () => { }) }) - describe('createFromBuffer(buffer, scaleFactor)', () => { + describe('createFromBuffer(buffer, options)', () => { it('returns an empty image when the buffer is empty', () => { expect(nativeImage.createFromBuffer(Buffer.from([])).isEmpty()) }) @@ -163,6 +163,11 @@ describe('nativeImage module', () => { {width: 538, height: 190, scaleFactor: 2.0}) expect(imageI.getSize()).to.deep.equal({width: 269, height: 95}) }) + + it('throws on invalid arguments', () => { + expect(() => nativeImage.createFromBuffer(null)).to.throw('buffer must be a node Buffer') + expect(() => nativeImage.createFromBuffer([12, 14, 124, 12])).to.throw('buffer must be a node Buffer') + }) }) describe('createFromDataURL(dataURL)', () => { From fd60283dbc50974d96abbfbf3eb47a74f542de69 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Wed, 20 Mar 2019 11:19:15 -0700 Subject: [PATCH 32/72] fix: use a more unique identifier for NSUserNotification instances (#17482) So although apple has it documented that notifications with duplicate identifiers in the same session won't be presented. They apparently forgot to mention that macOS also non-deterministically and without any errors, logs or warnings will also not present some notifications in future sessions if they have a previously used identifier. As such, we're going to truly randomize these identifiers so they are unique between apps and sessions. The identifier now consists of a randomly generated UUID and the app bundle id. --- brightray/browser/mac/cocoa_notification.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brightray/browser/mac/cocoa_notification.mm b/brightray/browser/mac/cocoa_notification.mm index 6b576497d41a9..154d00f87a571 100644 --- a/brightray/browser/mac/cocoa_notification.mm +++ b/brightray/browser/mac/cocoa_notification.mm @@ -13,8 +13,6 @@ namespace brightray { -int g_identifier_ = 1; - CocoaNotification::CocoaNotification(NotificationDelegate* delegate, NotificationPresenter* presenter) : Notification(delegate, presenter) {} @@ -29,7 +27,9 @@ notification_.reset([[NSUserNotification alloc] init]); NSString* identifier = - [NSString stringWithFormat:@"ElectronNotification%d", g_identifier_++]; + [NSString stringWithFormat:@"%@:notification:%@", + [[NSBundle mainBundle] bundleIdentifier], + [[[NSUUID alloc] init] UUIDString]]; [notification_ setTitle:base::SysUTF16ToNSString(options.title)]; [notification_ setSubtitle:base::SysUTF16ToNSString(options.subtitle)]; From d048024876cebbf88cbdbd55b11e1fd8238bc299 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 20 Mar 2019 13:50:24 -0700 Subject: [PATCH 33/72] Bump v3.1.7 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 37cb92b4236b4..f45bee5e31db3 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.6 + 3.1.7 CFBundleShortVersionString - 3.1.6 + 3.1.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 2152c9f4382f7..dc535208e697f 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,6,0 - PRODUCTVERSION 3,1,6,0 + FILEVERSION 3,1,7,0 + PRODUCTVERSION 3,1,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.6" + VALUE "FileVersion", "3.1.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.6" + VALUE "ProductVersion", "3.1.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 7490f826b1a07..d5696f66a6f38 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 7 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 07b098b693eda..d38e73f6df34e 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.6', + 'version%': '3.1.7', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 1619ddd954e00..d225f77bce56e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.5", + "version": "3.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 30ff85927ff36..882909361bb28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From ab1e5fd476752af00bd8dcb27bffc55b7c3c3f5c Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 20 Mar 2019 14:13:17 -0700 Subject: [PATCH 34/72] Revert "Bump v3.1.7" This reverts commit d048024876cebbf88cbdbd55b11e1fd8238bc299. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index f45bee5e31db3..37cb92b4236b4 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.7 + 3.1.6 CFBundleShortVersionString - 3.1.7 + 3.1.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 dc535208e697f..2152c9f4382f7 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,7,0 - PRODUCTVERSION 3,1,7,0 + FILEVERSION 3,1,6,0 + PRODUCTVERSION 3,1,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.7" + VALUE "FileVersion", "3.1.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.7" + VALUE "ProductVersion", "3.1.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index d5696f66a6f38..7490f826b1a07 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 7 +#define ATOM_PATCH_VERSION 6 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index d38e73f6df34e..07b098b693eda 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.7', + 'version%': '3.1.6', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index d225f77bce56e..1619ddd954e00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 882909361bb28..30ff85927ff36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.7", + "version": "3.1.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From b34c6425f70a0f088417aac13d10b46d4abb5aa4 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 20 Mar 2019 14:19:14 -0700 Subject: [PATCH 35/72] Bump v3.1.7 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 37cb92b4236b4..f45bee5e31db3 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.6 + 3.1.7 CFBundleShortVersionString - 3.1.6 + 3.1.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 2152c9f4382f7..dc535208e697f 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,6,0 - PRODUCTVERSION 3,1,6,0 + FILEVERSION 3,1,7,0 + PRODUCTVERSION 3,1,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.6" + VALUE "FileVersion", "3.1.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.6" + VALUE "ProductVersion", "3.1.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 7490f826b1a07..d5696f66a6f38 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 7 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 07b098b693eda..d38e73f6df34e 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.6', + 'version%': '3.1.7', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 1619ddd954e00..d225f77bce56e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.5", + "version": "3.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 30ff85927ff36..882909361bb28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 1ba66805e827848041312b8b4e9d6296680b36e8 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 20 Mar 2019 14:26:26 -0700 Subject: [PATCH 36/72] Revert "Bump v3.1.7" This reverts commit b34c6425f70a0f088417aac13d10b46d4abb5aa4. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index f45bee5e31db3..37cb92b4236b4 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.7 + 3.1.6 CFBundleShortVersionString - 3.1.7 + 3.1.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 dc535208e697f..2152c9f4382f7 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,7,0 - PRODUCTVERSION 3,1,7,0 + FILEVERSION 3,1,6,0 + PRODUCTVERSION 3,1,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.7" + VALUE "FileVersion", "3.1.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.7" + VALUE "ProductVersion", "3.1.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index d5696f66a6f38..7490f826b1a07 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 7 +#define ATOM_PATCH_VERSION 6 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index d38e73f6df34e..07b098b693eda 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.7', + 'version%': '3.1.6', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index d225f77bce56e..1619ddd954e00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 882909361bb28..30ff85927ff36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.7", + "version": "3.1.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From c242974f4a12ba469480b18741e30b6c93970e66 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 20 Mar 2019 14:32:50 -0700 Subject: [PATCH 37/72] Bump v3.1.7 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 37cb92b4236b4..f45bee5e31db3 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.6 + 3.1.7 CFBundleShortVersionString - 3.1.6 + 3.1.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 2152c9f4382f7..dc535208e697f 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,6,0 - PRODUCTVERSION 3,1,6,0 + FILEVERSION 3,1,7,0 + PRODUCTVERSION 3,1,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.6" + VALUE "FileVersion", "3.1.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.6" + VALUE "ProductVersion", "3.1.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 7490f826b1a07..d5696f66a6f38 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 7 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 07b098b693eda..d38e73f6df34e 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.6', + 'version%': '3.1.7', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 1619ddd954e00..d225f77bce56e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.5", + "version": "3.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 30ff85927ff36..882909361bb28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 054152610429dda7370b8a177351c6657425f0bf Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 20 Mar 2019 15:26:03 -0700 Subject: [PATCH 38/72] Revert "Bump v3.1.7" This reverts commit c242974f4a12ba469480b18741e30b6c93970e66. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index f45bee5e31db3..37cb92b4236b4 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.7 + 3.1.6 CFBundleShortVersionString - 3.1.7 + 3.1.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 dc535208e697f..2152c9f4382f7 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,7,0 - PRODUCTVERSION 3,1,7,0 + FILEVERSION 3,1,6,0 + PRODUCTVERSION 3,1,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.7" + VALUE "FileVersion", "3.1.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.7" + VALUE "ProductVersion", "3.1.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index d5696f66a6f38..7490f826b1a07 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 7 +#define ATOM_PATCH_VERSION 6 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index d38e73f6df34e..07b098b693eda 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.7', + 'version%': '3.1.6', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index d225f77bce56e..1619ddd954e00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 882909361bb28..30ff85927ff36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.7", + "version": "3.1.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 078d8c1451f386cbcac0e728c7bc9a68886752f4 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 20 Mar 2019 15:28:15 -0700 Subject: [PATCH 39/72] Bump v3.1.7 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 37cb92b4236b4..f45bee5e31db3 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.6 + 3.1.7 CFBundleShortVersionString - 3.1.6 + 3.1.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 2152c9f4382f7..dc535208e697f 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,6,0 - PRODUCTVERSION 3,1,6,0 + FILEVERSION 3,1,7,0 + PRODUCTVERSION 3,1,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.6" + VALUE "FileVersion", "3.1.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.6" + VALUE "ProductVersion", "3.1.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 7490f826b1a07..d5696f66a6f38 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 7 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 07b098b693eda..d38e73f6df34e 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.6', + 'version%': '3.1.7', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 1619ddd954e00..d225f77bce56e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.5", + "version": "3.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 30ff85927ff36..882909361bb28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 59b06a0d044bf573c5a27f8d4313d57bcc310640 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Thu, 21 Mar 2019 12:27:33 -0700 Subject: [PATCH 40/72] Revert "Bump v3.1.7" This reverts commit 078d8c1451f386cbcac0e728c7bc9a68886752f4. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index f45bee5e31db3..37cb92b4236b4 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.7 + 3.1.6 CFBundleShortVersionString - 3.1.7 + 3.1.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 dc535208e697f..2152c9f4382f7 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,7,0 - PRODUCTVERSION 3,1,7,0 + FILEVERSION 3,1,6,0 + PRODUCTVERSION 3,1,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.7" + VALUE "FileVersion", "3.1.6" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.7" + VALUE "ProductVersion", "3.1.6" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index d5696f66a6f38..7490f826b1a07 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 7 +#define ATOM_PATCH_VERSION 6 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index d38e73f6df34e..07b098b693eda 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.7', + 'version%': '3.1.6', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index d225f77bce56e..1619ddd954e00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 882909361bb28..30ff85927ff36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.7", + "version": "3.1.6", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 400f0548e5dd063d55c59d4a1130349d09f1bece Mon Sep 17 00:00:00 2001 From: Roller Bot <42361097+roller-bot@users.noreply.github.com> Date: Thu, 21 Mar 2019 13:02:26 -0700 Subject: [PATCH 41/72] chore: bump libcc (3-1-x) (#17503) * chore: bump libcc submodule to bdb1c8e9d2f184ebeb75a25824aca0be27aa879b * chore: bump libcc in DEPS to bdb1c8e9d2f184ebeb75a25824aca0be27aa879b --- DEPS | 2 +- vendor/libchromiumcontent | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9e85f71493e02..d3d520fd92744 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ vars = { 'chromium_version': '63.0.3239.150', 'libchromiumcontent_revision': - '5ff272e25eb552d8c0e7f07f919ed0bad804500b', + 'bdb1c8e9d2f184ebeb75a25824aca0be27aa879b', 'node_version': 'v9.7.0-33-g538a5023af', 'native_mate_revision': diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 5ff272e25eb55..bdb1c8e9d2f18 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 5ff272e25eb552d8c0e7f07f919ed0bad804500b +Subproject commit bdb1c8e9d2f184ebeb75a25824aca0be27aa879b From e964d346c544939516770ecc7a7d856b9a933ff8 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 21 Mar 2019 13:05:34 -0700 Subject: [PATCH 42/72] Bump v3.1.7 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 37cb92b4236b4..f45bee5e31db3 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.6 + 3.1.7 CFBundleShortVersionString - 3.1.6 + 3.1.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 2152c9f4382f7..dc535208e697f 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,6,0 - PRODUCTVERSION 3,1,6,0 + FILEVERSION 3,1,7,0 + PRODUCTVERSION 3,1,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.6" + VALUE "FileVersion", "3.1.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.6" + VALUE "ProductVersion", "3.1.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 7490f826b1a07..d5696f66a6f38 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 6 +#define ATOM_PATCH_VERSION 7 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 07b098b693eda..d38e73f6df34e 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.6', + 'version%': '3.1.7', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 1619ddd954e00..d225f77bce56e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.5", + "version": "3.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 30ff85927ff36..882909361bb28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From a4bea62b98ba8d4db0b15fa91d17fdd304b6f174 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Wed, 27 Mar 2019 11:35:01 -0700 Subject: [PATCH 43/72] fix: add missing buffer size check in nativeImage (#17569) --- atom/common/api/atom_api_native_image.cc | 130 ++++++++++++++--------- spec/api-native-image-spec.js | 17 +++ 2 files changed, 94 insertions(+), 53 deletions(-) diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index 1356e4eb589c5..84253ed5c93ba 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -79,49 +79,71 @@ float GetScaleFactorFromOptions(mate::Arguments* args) { return scale_factor; } -bool AddImageSkiaRep(gfx::ImageSkia* image, - const unsigned char* data, - size_t size, - int width, - int height, - double scale_factor) { - auto decoded = std::make_unique(); +bool AddImageSkiaRepFromPNG(gfx::ImageSkia* image, + const unsigned char* data, + size_t size, + double scale_factor) { + SkBitmap bitmap; + if (!gfx::PNGCodec::Decode(data, size, &bitmap)) + return false; + + image->AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor)); + return true; +} + +bool AddImageSkiaRepFromJPEG(gfx::ImageSkia* image, + const unsigned char* data, + size_t size, + double scale_factor) { + auto bitmap = gfx::JPEGCodec::Decode(data, size); + if (!bitmap) + return false; + + // `JPEGCodec::Decode()` doesn't tell `SkBitmap` instance it creates + // that all of its pixels are opaque, that's why the bitmap gets + // an alpha type `kPremul_SkAlphaType` instead of `kOpaque_SkAlphaType`. + // Let's fix it here. + // TODO(alexeykuzmin): This workaround should be removed + // when the `JPEGCodec::Decode()` code is fixed. + // See https://github.com/electron/electron/issues/11294. + bitmap->setAlphaType(SkAlphaType::kOpaque_SkAlphaType); + + image->AddRepresentation(gfx::ImageSkiaRep(*bitmap, scale_factor)); + return true; +} +bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image, + const unsigned char* data, + size_t size, + int width, + int height, + double scale_factor) { // Try PNG first. - if (!gfx::PNGCodec::Decode(data, size, decoded.get())) { - // Try JPEG. - decoded = gfx::JPEGCodec::Decode(data, size); - if (decoded) { - // `JPEGCodec::Decode()` doesn't tell `SkBitmap` instance it creates - // that all of its pixels are opaque, that's why the bitmap gets - // an alpha type `kPremul_SkAlphaType` instead of `kOpaque_SkAlphaType`. - // Let's fix it here. - // TODO(alexeykuzmin): This workaround should be removed - // when the `JPEGCodec::Decode()` code is fixed. - // See https://github.com/electron/electron/issues/11294. - decoded->setAlphaType(SkAlphaType::kOpaque_SkAlphaType); - } - } + if (AddImageSkiaRepFromPNG(image, data, size, scale_factor)) + return true; - if (!decoded) { - // Try Bitmap - if (width > 0 && height > 0) { - decoded.reset(new SkBitmap); - decoded->allocN32Pixels(width, height, false); - decoded->setPixels( - const_cast(reinterpret_cast(data))); - } else { - return false; - } - } + // Try JPEG second. + if (AddImageSkiaRepFromJPEG(image, data, size, scale_factor)) + return true; - image->AddRepresentation(gfx::ImageSkiaRep(*decoded, scale_factor)); + if (width == 0 || height == 0) + return false; + + auto info = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType); + if (size < info.computeMinByteSize()) + return false; + + SkBitmap bitmap; + bitmap.allocN32Pixels(width, height, false); + bitmap.setPixels(const_cast(reinterpret_cast(data))); + + image->AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor)); return true; } -bool AddImageSkiaRep(gfx::ImageSkia* image, - const base::FilePath& path, - double scale_factor) { +bool AddImageSkiaRepFromPath(gfx::ImageSkia* image, + const base::FilePath& path, + double scale_factor) { std::string file_contents; { base::ThreadRestrictions::ScopedAllowIO allow_io; @@ -132,7 +154,8 @@ bool AddImageSkiaRep(gfx::ImageSkia* image, const unsigned char* data = reinterpret_cast(file_contents.data()); size_t size = file_contents.size(); - return AddImageSkiaRep(image, data, size, 0, 0, scale_factor); + + return AddImageSkiaRepFromBuffer(image, data, size, 0, 0, scale_factor); } bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image, @@ -141,12 +164,12 @@ bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image, std::string filename(path.BaseName().RemoveExtension().AsUTF8Unsafe()); if (base::MatchPattern(filename, "*@*x")) // Don't search for other representations if the DPI has been specified. - return AddImageSkiaRep(image, path, GetScaleFactorFromPath(path)); + return AddImageSkiaRepFromPath(image, path, GetScaleFactorFromPath(path)); else - succeed |= AddImageSkiaRep(image, path, 1.0f); + succeed |= AddImageSkiaRepFromPath(image, path, 1.0f); for (const ScaleFactorPair& pair : kScaleFactorPairs) - succeed |= AddImageSkiaRep( + succeed |= AddImageSkiaRepFromPath( image, path.InsertBeforeExtensionASCII(pair.name), pair.scale); return succeed; } @@ -422,19 +445,20 @@ void NativeImage::AddRepresentation(const mate::Dictionary& options) { v8::Local buffer; GURL url; if (options.Get("buffer", &buffer) && node::Buffer::HasInstance(buffer)) { - AddImageSkiaRep( - &image_skia, - reinterpret_cast(node::Buffer::Data(buffer)), - node::Buffer::Length(buffer), width, height, scale_factor); - skia_rep_added = true; + auto* data = reinterpret_cast(node::Buffer::Data(buffer)); + auto size = node::Buffer::Length(buffer); + skia_rep_added = AddImageSkiaRepFromBuffer(&image_skia, data, size, width, + height, scale_factor); } else if (options.Get("dataURL", &url)) { std::string mime_type, charset, data; if (net::DataURL::Parse(url, &mime_type, &charset, &data)) { - if (mime_type == "image/png" || mime_type == "image/jpeg") { - AddImageSkiaRep(&image_skia, - reinterpret_cast(data.c_str()), - data.size(), width, height, scale_factor); - skia_rep_added = true; + auto* data_ptr = reinterpret_cast(data.c_str()); + if (mime_type == "image/png") { + skia_rep_added = AddImageSkiaRepFromPNG(&image_skia, data_ptr, + data.size(), scale_factor); + } else if (mime_type == "image/jpeg") { + skia_rep_added = AddImageSkiaRepFromJPEG(&image_skia, data_ptr, + data.size(), scale_factor); } } } @@ -525,9 +549,9 @@ mate::Handle NativeImage::CreateFromBuffer( } gfx::ImageSkia image_skia; - AddImageSkiaRep(&image_skia, - reinterpret_cast(node::Buffer::Data(buffer)), - node::Buffer::Length(buffer), width, height, scale_factor); + AddImageSkiaRepFromBuffer( + &image_skia, reinterpret_cast(node::Buffer::Data(buffer)), + node::Buffer::Length(buffer), width, height, scale_factor); return Create(args->isolate(), gfx::Image(image_skia)); } diff --git a/spec/api-native-image-spec.js b/spec/api-native-image-spec.js index a2876d732a54d..45c061f85ed7c 100644 --- a/spec/api-native-image-spec.js +++ b/spec/api-native-image-spec.js @@ -130,6 +130,11 @@ describe('nativeImage module', () => { expect(nativeImage.createFromBuffer(Buffer.from([])).isEmpty()) }) + it('returns an empty image when the buffer is too small', () => { + const image = nativeImage.createFromBuffer(Buffer.from([1, 2, 3, 4]), { width: 100, height: 100 }) + expect(image.isEmpty()).to.be.true() + }) + it('returns an image created from the given buffer', () => { const imageA = nativeImage.createFromPath(path.join(__dirname, 'fixtures', 'assets', 'logo.png')) @@ -450,6 +455,18 @@ describe('nativeImage module', () => { }) describe('addRepresentation()', () => { + it('does not add representation when the buffer is too small', () => { + const image = nativeImage.createEmpty() + + image.addRepresentation({ + buffer: Buffer.from([1, 2, 3, 4]), + width: 100, + height: 100 + }) + + expect(image.isEmpty()).to.be.true() + }) + it('supports adding a buffer representation for a scale factor', () => { const image = nativeImage.createEmpty() From 018fd925f45a1d969dc924a6cd3ddc657e23051e Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 27 Mar 2019 11:53:42 -0700 Subject: [PATCH 44/72] chore: update package-lock.json with updated version number --- package-lock.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d225f77bce56e..cc64a38e761b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.6", + "version": "3.1.7", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -156,6 +156,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", @@ -1885,7 +1886,8 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", - "dev": true + "dev": true, + "optional": true }, "cssstyle": { "version": "0.2.37", @@ -5529,7 +5531,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", From 4e5269b07631bedc0459915ca1ab97f04bd602be Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 27 Mar 2019 14:00:31 -0700 Subject: [PATCH 45/72] Bump v3.1.8 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 7 ++----- package.json | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index f45bee5e31db3..88fca7dd0425a 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.7 + 3.1.8 CFBundleShortVersionString - 3.1.7 + 3.1.8 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index dc535208e697f..5cabbc848cb7d 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,7,0 - PRODUCTVERSION 3,1,7,0 + FILEVERSION 3,1,8,0 + PRODUCTVERSION 3,1,8,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.7" + VALUE "FileVersion", "3.1.8" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.7" + VALUE "ProductVersion", "3.1.8" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index d5696f66a6f38..b74c27b4b324c 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 7 +#define ATOM_PATCH_VERSION 8 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index d38e73f6df34e..8e5067b9353f8 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.7', + 'version%': '3.1.8', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index cc64a38e761b0..b1625deac8a18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -156,7 +156,6 @@ "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", @@ -1886,8 +1885,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", - "dev": true, - "optional": true + "dev": true }, "cssstyle": { "version": "0.2.37", @@ -5531,8 +5529,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true, - "optional": true + "dev": true }, "longest-streak": { "version": "2.0.2", diff --git a/package.json b/package.json index 882909361bb28..58c2a9652631a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.7", + "version": "3.1.8", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 5797a9d102382d38c7553296d32c368453176779 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 27 Mar 2019 14:22:02 -0700 Subject: [PATCH 46/72] Revert "Bump v3.1.8" This reverts commit 4e5269b07631bedc0459915ca1ab97f04bd602be. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 7 +++++-- package.json | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 88fca7dd0425a..f45bee5e31db3 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.8 + 3.1.7 CFBundleShortVersionString - 3.1.8 + 3.1.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 5cabbc848cb7d..dc535208e697f 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,8,0 - PRODUCTVERSION 3,1,8,0 + FILEVERSION 3,1,7,0 + PRODUCTVERSION 3,1,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.8" + VALUE "FileVersion", "3.1.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.8" + VALUE "ProductVersion", "3.1.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index b74c27b4b324c..d5696f66a6f38 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 8 +#define ATOM_PATCH_VERSION 7 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 8e5067b9353f8..d38e73f6df34e 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.8', + 'version%': '3.1.7', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index b1625deac8a18..cc64a38e761b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -156,6 +156,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", @@ -1885,7 +1886,8 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", - "dev": true + "dev": true, + "optional": true }, "cssstyle": { "version": "0.2.37", @@ -5529,7 +5531,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 58c2a9652631a..882909361bb28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.8", + "version": "3.1.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 761996ce460105209fd70bfad48cf8cafe2891ff Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 28 Mar 2019 08:59:09 -0700 Subject: [PATCH 47/72] Bump v3.1.8 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 7 ++----- package.json | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index f45bee5e31db3..88fca7dd0425a 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.7 + 3.1.8 CFBundleShortVersionString - 3.1.7 + 3.1.8 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index dc535208e697f..5cabbc848cb7d 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,7,0 - PRODUCTVERSION 3,1,7,0 + FILEVERSION 3,1,8,0 + PRODUCTVERSION 3,1,8,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.7" + VALUE "FileVersion", "3.1.8" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.7" + VALUE "ProductVersion", "3.1.8" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index d5696f66a6f38..b74c27b4b324c 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 7 +#define ATOM_PATCH_VERSION 8 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index d38e73f6df34e..8e5067b9353f8 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.7', + 'version%': '3.1.8', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index cc64a38e761b0..b1625deac8a18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -156,7 +156,6 @@ "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", @@ -1886,8 +1885,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", - "dev": true, - "optional": true + "dev": true }, "cssstyle": { "version": "0.2.37", @@ -5531,8 +5529,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true, - "optional": true + "dev": true }, "longest-streak": { "version": "2.0.2", diff --git a/package.json b/package.json index 882909361bb28..58c2a9652631a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.7", + "version": "3.1.8", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 95ed0483310adea302f6e77f046e523bac600540 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 28 Mar 2019 09:50:30 -0700 Subject: [PATCH 48/72] Revert "Bump v3.1.8" This reverts commit 761996ce460105209fd70bfad48cf8cafe2891ff. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 7 +++++-- package.json | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 88fca7dd0425a..f45bee5e31db3 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.8 + 3.1.7 CFBundleShortVersionString - 3.1.8 + 3.1.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 5cabbc848cb7d..dc535208e697f 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,8,0 - PRODUCTVERSION 3,1,8,0 + FILEVERSION 3,1,7,0 + PRODUCTVERSION 3,1,7,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.8" + VALUE "FileVersion", "3.1.7" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.8" + VALUE "ProductVersion", "3.1.7" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index b74c27b4b324c..d5696f66a6f38 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 8 +#define ATOM_PATCH_VERSION 7 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 8e5067b9353f8..d38e73f6df34e 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.8', + 'version%': '3.1.7', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index b1625deac8a18..cc64a38e761b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -156,6 +156,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", @@ -1885,7 +1886,8 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", - "dev": true + "dev": true, + "optional": true }, "cssstyle": { "version": "0.2.37", @@ -5529,7 +5531,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 58c2a9652631a..882909361bb28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.8", + "version": "3.1.7", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 7b1160443510e03b07bce148f23f83f87dac687b Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Thu, 28 Mar 2019 12:56:17 -0700 Subject: [PATCH 49/72] fix: handle a race condition between preload scripts executing and navigations (#17595) There is a race condition between DidCreateScriptContext and another navigation occuring in the main process. If the navigation occurs while the preload script is running, the same process is re-used. This ensures that any pending navigations are completely removed / ignored when we trigger a new navigation. Fixes #17576 --- atom/browser/api/atom_api_web_contents.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 183bfdee3bb1c..0c96e1b98b207 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -1150,6 +1150,9 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) { params.transition_type = ui::PAGE_TRANSITION_TYPED; params.should_clear_history_list = true; params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE; + // Discord non-committed entries to ensure that we don't re-use a pending + // entry + web_contents()->GetController().DiscardNonCommittedEntries(); web_contents()->GetController().LoadURLWithParams(params); // Set the background color of RenderWidgetHostView. From bbf5178d9f247592fb31989333bcc1032c2d4f86 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Thu, 28 Mar 2019 16:56:40 -0300 Subject: [PATCH 50/72] chore: bump node to get hotfix https://github.com/electron/node/pull/97 (#17592) --- vendor/node | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/node b/vendor/node index fcaf11a29c421..7658ffaaa38d2 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit fcaf11a29c421b0e76c9f24f5b155a53eff14e7f +Subproject commit 7658ffaaa38d2638ab3cc4c54d11349fd93c4682 From e84a6860e35e14b4031b88bb9b49841cdb89a305 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 28 Mar 2019 13:05:09 -0700 Subject: [PATCH 51/72] Bump v3.1.8 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 7 ++----- package.json | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index f45bee5e31db3..88fca7dd0425a 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.7 + 3.1.8 CFBundleShortVersionString - 3.1.7 + 3.1.8 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index dc535208e697f..5cabbc848cb7d 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,7,0 - PRODUCTVERSION 3,1,7,0 + FILEVERSION 3,1,8,0 + PRODUCTVERSION 3,1,8,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.7" + VALUE "FileVersion", "3.1.8" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.7" + VALUE "ProductVersion", "3.1.8" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index d5696f66a6f38..b74c27b4b324c 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 7 +#define ATOM_PATCH_VERSION 8 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index d38e73f6df34e..8e5067b9353f8 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.7', + 'version%': '3.1.8', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index cc64a38e761b0..b1625deac8a18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -156,7 +156,6 @@ "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", @@ -1886,8 +1885,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", - "dev": true, - "optional": true + "dev": true }, "cssstyle": { "version": "0.2.37", @@ -5531,8 +5529,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true, - "optional": true + "dev": true }, "longest-streak": { "version": "2.0.2", diff --git a/package.json b/package.json index 882909361bb28..58c2a9652631a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.7", + "version": "3.1.8", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 87a71ed1ed7059bc1f372dd8c0d02359c00f64a9 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Fri, 12 Apr 2019 19:37:53 +0200 Subject: [PATCH 52/72] fix: report module name when require fails in sandboxed renderers (#17703) --- lib/sandboxed_renderer/init.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sandboxed_renderer/init.js b/lib/sandboxed_renderer/init.js index 2acb7db386363..cdc0cc2311dc3 100644 --- a/lib/sandboxed_renderer/init.js +++ b/lib/sandboxed_renderer/init.js @@ -72,7 +72,7 @@ function preloadRequire (module) { if (remoteModules.has(module)) { return require(module) } - throw new Error('module not found') + throw new Error(`module not found: ${module}`) } if (window.location.protocol === 'chrome-devtools:') { From aaad1edfe9eddb60f71c7c6a4f7fd3eb1c505820 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 16 Apr 2019 15:52:53 -0700 Subject: [PATCH 53/72] docs: note desktop audio limitation on macOS (#17816) --- docs/api/desktop-capturer.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/api/desktop-capturer.md b/docs/api/desktop-capturer.md index 7b897f2ad1bc9..b4642fa19ab95 100644 --- a/docs/api/desktop-capturer.md +++ b/docs/api/desktop-capturer.md @@ -93,3 +93,9 @@ objects, each `DesktopCapturerSource` represents a screen or an individual windo captured. [`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia + +### Caveats + +`navigator.mediaDevices.getUserMedia` does not work on macOS for audio capture due to a fundamental limitation whereby apps that want to access the system's audio require a [signed kernel extension](https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/KernelExtensions/KernelExtensions.html). Chromium, and by extension Electron, does not provide this. + +It is possible to circumvent this limitation by capturing system audio with another macOS app like Soundflower and passing it through a virtual audio input device. This virtual device can then be queried with `navigator.mediaDevices.getUserMedia`. \ No newline at end of file From f11ab9dac5776b4647929a89a407e31feb1bd149 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 17 Apr 2019 01:23:25 +0200 Subject: [PATCH 54/72] fix: emit process 'loaded' event in sandboxed renderers (#17809) --- atom/renderer/atom_sandboxed_renderer_client.cc | 2 ++ lib/sandboxed_renderer/api/ipc-renderer.js | 4 ++++ lib/sandboxed_renderer/init.js | 1 + spec/api-browser-window-spec.js | 13 +++++++++++++ spec/fixtures/module/preload-sandbox.js | 5 +++++ 5 files changed, 25 insertions(+) diff --git a/atom/renderer/atom_sandboxed_renderer_client.cc b/atom/renderer/atom_sandboxed_renderer_client.cc index ce214162033ca..ae2412fd73974 100644 --- a/atom/renderer/atom_sandboxed_renderer_client.cc +++ b/atom/renderer/atom_sandboxed_renderer_client.cc @@ -191,6 +191,8 @@ void AtomSandboxedRendererClient::DidCreateScriptContext( // Execute the function with proper arguments ignore_result( func->Call(context, v8::Null(isolate), node::arraysize(args), args)); + + InvokeIpcCallback(context, "onLoaded", std::vector>()); } void AtomSandboxedRendererClient::WillReleaseScriptContext( diff --git a/lib/sandboxed_renderer/api/ipc-renderer.js b/lib/sandboxed_renderer/api/ipc-renderer.js index 008372b4aa076..f984fd0da4032 100644 --- a/lib/sandboxed_renderer/api/ipc-renderer.js +++ b/lib/sandboxed_renderer/api/ipc-renderer.js @@ -13,6 +13,10 @@ ipcNative.onMessage = function (channel, args) { ipcRenderer.emit(channel, {sender: ipcRenderer}, ...args) } +ipcNative.onLoaded = function () { + process.emit('loaded') +} + ipcNative.onExit = function () { process.emit('exit') } diff --git a/lib/sandboxed_renderer/init.js b/lib/sandboxed_renderer/init.js index cdc0cc2311dc3..ccb9bc8a566bf 100644 --- a/lib/sandboxed_renderer/init.js +++ b/lib/sandboxed_renderer/init.js @@ -62,6 +62,7 @@ preloadProcess.execPath = process.execPath = binding.getExecPath() preloadProcess.platform = process.platform = platform preloadProcess.env = process.env = env +process.on('loaded', () => preloadProcess.emit('loaded')) process.on('exit', () => preloadProcess.emit('exit')) // This is the `require` function that will be visible to the preload script diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 4f59ff410e0bc..ed1458150993d 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -1259,6 +1259,19 @@ describe('BrowserWindow module', () => { w.loadURL('file://' + path.join(fixtures, 'api', 'preload.html')) }) + it('exposes "loaded" event to preload script', function (done) { + w.destroy() + w = new BrowserWindow({ + show: false, + webPreferences: { + sandbox: true, + preload + } + }) + ipcMain.once('process-loaded', () => done()) + w.loadURL('about:blank') + }) + it('exposes "exit" event to preload script', function (done) { w.destroy() w = new BrowserWindow({ diff --git a/spec/fixtures/module/preload-sandbox.js b/spec/fixtures/module/preload-sandbox.js index b9042ec93c0cd..7596060e964a1 100644 --- a/spec/fixtures/module/preload-sandbox.js +++ b/spec/fixtures/module/preload-sandbox.js @@ -4,6 +4,11 @@ window.ipcRenderer = ipcRenderer window.setImmediate = setImmediate window.require = require + + process.once('loaded', () => { + ipcRenderer.send('process-loaded') + }) + if (location.protocol === 'file:') { window.test = 'preload' window.process = process From 15315ea91662768888aec45db787d52445839967 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Tue, 16 Apr 2019 16:41:29 -0700 Subject: [PATCH 55/72] fix: reset the NSUserNotication handle on dismiss (#17820) --- brightray/browser/mac/cocoa_notification.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/brightray/browser/mac/cocoa_notification.mm b/brightray/browser/mac/cocoa_notification.mm index 154d00f87a571..6f15c9b153cba 100644 --- a/brightray/browser/mac/cocoa_notification.mm +++ b/brightray/browser/mac/cocoa_notification.mm @@ -115,6 +115,8 @@ NotificationDismissed(); this->LogAction("dismissed"); + + notification_.reset(nil); } void CocoaNotification::NotificationDisplayed() { From 7897913161e3918c04eae35a802630ccd88f024b Mon Sep 17 00:00:00 2001 From: Roller Bot <42361097+roller-bot@users.noreply.github.com> Date: Thu, 18 Apr 2019 08:37:05 -0700 Subject: [PATCH 56/72] chore: bump libcc (3-1-x) (#17850) * chore: bump libcc submodule to 83fd716a064b29c7a314f4e6b3447d8144d99035 * chore: bump libcc in DEPS to 83fd716a064b29c7a314f4e6b3447d8144d99035 --- DEPS | 2 +- vendor/libchromiumcontent | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d3d520fd92744..9042e4f918964 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ vars = { 'chromium_version': '63.0.3239.150', 'libchromiumcontent_revision': - 'bdb1c8e9d2f184ebeb75a25824aca0be27aa879b', + '83fd716a064b29c7a314f4e6b3447d8144d99035', 'node_version': 'v9.7.0-33-g538a5023af', 'native_mate_revision': diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index bdb1c8e9d2f18..83fd716a064b2 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit bdb1c8e9d2f184ebeb75a25824aca0be27aa879b +Subproject commit 83fd716a064b29c7a314f4e6b3447d8144d99035 From 276ebca24cef50eb0ad405dfcc794e7738b55a01 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 18 Apr 2019 17:54:05 +0200 Subject: [PATCH 57/72] fix: copy pixels in AddImageSkiaRepFromBuffer (#17843) (#17861) --- atom/common/api/atom_api_native_image.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index 84253ed5c93ba..b8c51e5b96232 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -135,7 +135,7 @@ bool AddImageSkiaRepFromBuffer(gfx::ImageSkia* image, SkBitmap bitmap; bitmap.allocN32Pixels(width, height, false); - bitmap.setPixels(const_cast(reinterpret_cast(data))); + bitmap.writePixels({info, data, bitmap.rowBytes()}); image->AddRepresentation(gfx::ImageSkiaRep(bitmap, scale_factor)); return true; From 14660a22957807f157de3a274820ad04012e754c Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 1 May 2019 10:34:43 -0700 Subject: [PATCH 58/72] Bump v3.1.9 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 88fca7dd0425a..b680513a24273 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.8 + 3.1.9 CFBundleShortVersionString - 3.1.8 + 3.1.9 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 5cabbc848cb7d..43a3371b1b19e 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,8,0 - PRODUCTVERSION 3,1,8,0 + FILEVERSION 3,1,9,0 + PRODUCTVERSION 3,1,9,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.8" + VALUE "FileVersion", "3.1.9" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.8" + VALUE "ProductVersion", "3.1.9" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index b74c27b4b324c..b24db458956a9 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 8 +#define ATOM_PATCH_VERSION 9 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 8e5067b9353f8..73adec4982c66 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.8', + 'version%': '3.1.9', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index b1625deac8a18..3b012cdd298be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.7", + "version": "3.1.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 58c2a9652631a..9e110bc248158 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.8", + "version": "3.1.9", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 1e12291776cf2213be2bcd12feaaacd2ae236b10 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 29 May 2019 08:37:59 -0700 Subject: [PATCH 59/72] chore: bump libcc (3-1-x) (#18426) * chore: bump libcc submodule to 55625e1de5d34a815921975f4d5556133b8142af * chore: bump libcc in DEPS to 55625e1de5d34a815921975f4d5556133b8142af --- DEPS | 2 +- vendor/libchromiumcontent | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9042e4f918964..77ba367045c0f 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ vars = { 'chromium_version': '63.0.3239.150', 'libchromiumcontent_revision': - '83fd716a064b29c7a314f4e6b3447d8144d99035', + '55625e1de5d34a815921975f4d5556133b8142af', 'node_version': 'v9.7.0-33-g538a5023af', 'native_mate_revision': diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 83fd716a064b2..55625e1de5d34 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 83fd716a064b29c7a314f4e6b3447d8144d99035 +Subproject commit 55625e1de5d34a815921975f4d5556133b8142af From 5da219b14cae659fbd7a6a4a5f9bb3100694ce00 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Wed, 29 May 2019 08:40:07 -0700 Subject: [PATCH 60/72] Bump v3.1.10 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index b680513a24273..6c57b12848a79 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.9 + 3.1.10 CFBundleShortVersionString - 3.1.9 + 3.1.10 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 43a3371b1b19e..cd21c406350ec 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,9,0 - PRODUCTVERSION 3,1,9,0 + FILEVERSION 3,1,10,0 + PRODUCTVERSION 3,1,10,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.9" + VALUE "FileVersion", "3.1.10" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.9" + VALUE "ProductVersion", "3.1.10" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index b24db458956a9..a6faa3f444422 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 9 +#define ATOM_PATCH_VERSION 10 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 73adec4982c66..de0f68e08144b 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.9', + 'version%': '3.1.10', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 3b012cdd298be..5b0c232bba584 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.8", + "version": "3.1.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9e110bc248158..eca3fdeb8cc97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.9", + "version": "3.1.10", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 363d0dafc5e3fa73d5e06d269653b755b30d1521 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Thu, 30 May 2019 14:57:10 -0400 Subject: [PATCH 61/72] build: fixes for CI flakes (#18523) Turns off ELECTRON_ENABLE_LOGGING/ELECTRON_ENABLE_STACK_DUMPING in Windows as they are causing issues. In Linux, use a newer version of python-dbusmock to resolve dbusmock hanging on dbus_stop --- .circleci/config.yml | 8 +++++++- .circleci/fix-known-hosts.sh | 7 +++++++ .dockerignore | 1 + Dockerfile | 14 ++++++++++---- appveyor.yml | 2 ++ 5 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 .circleci/fix-known-hosts.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index b6a02947b9a53..02b48aff34041 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,11 @@ build-steps: &build-steps steps: + - run: + name: Fix Known Hosts on Linux + command: | + if [ "`uname`" == "Linux" ]; then + /home/builduser/fix-known-hosts.sh + fi - checkout - run: name: Install Node.js 10 on MacOS @@ -138,7 +144,7 @@ build-steps: &build-steps build-defaults: &build-defaults docker: - - image: electronbuilds/electron:0.0.8 + - image: electronbuilds/electron:0.0.8.1 <<: *build-steps version: 2 diff --git a/.circleci/fix-known-hosts.sh b/.circleci/fix-known-hosts.sh new file mode 100644 index 0000000000000..01e9ffe8abb95 --- /dev/null +++ b/.circleci/fix-known-hosts.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +mkdir -p ~/.ssh +echo "|1|cVeiko0f+NcBdQ4UQvusKHo8sOA=|VIYt+cwPlbV0iP9VItsw/wlzrEk= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== +|1|WDYl7KHWaZFGMa3eqg3iY4KmwzQ=|FWZq//rIJ3lr85ZeTr66c80iLiA= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts diff --git a/.dockerignore b/.dockerignore index 2e67a161a9804..dee39103c3ad6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ * !tools/xvfb-init.sh !tools/run-electron.sh +!.circleci/fix-known-hosts.sh diff --git a/Dockerfile b/Dockerfile index 74e5eeedea9be..6a5b5468ae3a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,7 @@ FROM electronbuilds/libchromiumcontent:0.0.4 USER root # Set up HOME directory -ENV HOME=/home -RUN chmod a+rwx /home +ENV HOME=/home/builduser # Install node.js RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - @@ -13,8 +12,9 @@ RUN apt-get install -y nodejs # Install wget used by crash reporter RUN apt-get install -y wget -# Install python-dbusmock -RUN apt-get install -y python-dbusmock +# Install python-dbus +RUN apt-get install -y python-dbus +RUN pip install python-dbusmock # Install libnotify RUN apt-get install -y libnotify-bin @@ -22,3 +22,9 @@ RUN apt-get install -y libnotify-bin # Add xvfb init script ADD tools/xvfb-init.sh /etc/init.d/xvfb RUN chmod a+x /etc/init.d/xvfb + +COPY .circleci/fix-known-hosts.sh /home/builduser/fix-known-hosts.sh +RUN chmod a+x /home/builduser/fix-known-hosts.sh + +USER builduser +WORKDIR /home/builduser diff --git a/appveyor.yml b/appveyor.yml index 1310b77c79b9f..a4fe772356d1c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -44,6 +44,8 @@ test_script: Write-Output "Skipping tests for release build" } else { $env:RUN_TESTS="true" + Remove-Item Env:\ELECTRON_ENABLE_LOGGING + Remove-Item Env:\ELECTRON_ENABLE_STACK_DUMPING Write-Output "Running tests for debug build" } - if "%RUN_TESTS%"=="true" ( echo Running test suite & python script\test.py --ci --rebuild_native_modules) From 93655d67b38697259f560208c3ca763354cc4681 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Tue, 4 Jun 2019 12:04:53 -0400 Subject: [PATCH 62/72] build: move Windows release builds to AppVeyor cloud (#18627) * build: move Windows release builds to AppVeyor cloud * Use new env variable for AppVeyor cloud server (cherry picked from commit ca712150a396021bdf04c40cce230d6e11a4ddd0) --- .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 c2af9cb1f737c..533a36ca683b4 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= diff --git a/script/ci-release-build.js b/script/ci-release-build.js index 5b3c17946bc4f..61efdfaa42c3c 100644 --- a/script/ci-release-build.js +++ b/script/ci-release-build.js @@ -2,11 +2,11 @@ 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 appVeyorJobs = { - 'electron-x64': 'electron', - 'electron-ia32': 'electron-39ng6' + 'electron-x64': 'electron-x64-release', + 'electron-ia32': 'electron-ia32-release' } const circleCIJobs = [ @@ -104,13 +104,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 @@ -120,7 +120,7 @@ async function callAppVeyor (targetBranch, job, options) { let 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 516233c0daf0ac72f627d580a07dfa04e527b25c Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 6 Jun 2019 19:11:41 +0200 Subject: [PATCH 63/72] fix: emit IPC event in correct context if isolation and sandbox enabled (#16352) (#18668) * fix: emit IPC event in correct context if isolation and sandbox enabled IPC events were not being delivered to renderer processes when both `contextIsolation` and `sandbox` were enabled. This is because the `AtomSandboxedRenderFrameObserver` class was incorrectly using the `MainWorldScriptContext`, rather than conditionally selecting the context based on if isolation was enabled. Fixes #11922 --- .../atom_sandboxed_renderer_client.cc | 4 ++- spec/api-ipc-renderer-spec.js | 35 +++++++++++++------ spec/fixtures/module/preload-inject-ipc.js | 2 -- spec/fixtures/module/preload-ipc-ping-pong.js | 5 +++ spec/fixtures/pages/ping-pong.html | 11 ------ 5 files changed, 33 insertions(+), 24 deletions(-) delete mode 100644 spec/fixtures/module/preload-inject-ipc.js create mode 100644 spec/fixtures/module/preload-ipc-ping-pong.js delete mode 100644 spec/fixtures/pages/ping-pong.html diff --git a/atom/renderer/atom_sandboxed_renderer_client.cc b/atom/renderer/atom_sandboxed_renderer_client.cc index ae2412fd73974..9784cb1ed7f85 100644 --- a/atom/renderer/atom_sandboxed_renderer_client.cc +++ b/atom/renderer/atom_sandboxed_renderer_client.cc @@ -125,8 +125,10 @@ class AtomSandboxedRenderFrameObserver : public AtomRenderFrameObserver { auto* isolate = blink::MainThreadIsolate(); v8::HandleScope handle_scope(isolate); - auto context = frame->MainWorldScriptContext(); + + auto context = renderer_client_->GetContext(frame, isolate); v8::Context::Scope context_scope(context); + v8::Local argv[] = {mate::ConvertToV8(isolate, channel), mate::ConvertToV8(isolate, args)}; renderer_client_->InvokeIpcCallback( diff --git a/spec/api-ipc-renderer-spec.js b/spec/api-ipc-renderer-spec.js index 748851ec1c0a7..411c560c20233 100644 --- a/spec/api-ipc-renderer-spec.js +++ b/spec/api-ipc-renderer-spec.js @@ -140,20 +140,35 @@ describe('ipc renderer module', () => { contents = null }) - it('sends message to WebContents', done => { - const webContentsId = remote.getCurrentWebContents().id + const generateSpecs = (description, webPreferences) => { + describe(description, () => { + it('sends message to WebContents', done => { + contents = webContents.create({ + preload: path.join(fixtures, 'module', 'preload-ipc-ping-pong.js'), + ...webPreferences + }) - ipcRenderer.once('pong', (event, id) => { - expect(webContentsId).to.equal(id) - done() - }) + const payload = 'Hello World!' + const webContentsId = remote.getCurrentWebContents().id + + ipcRenderer.once('pong', (event, data) => { + expect(payload).to.equal(data) + done() + }) - contents.once('did-finish-load', () => { - ipcRenderer.sendTo(contents.id, 'ping', webContentsId) + contents.once('did-finish-load', () => { + ipcRenderer.sendTo(contents.id, 'ping', webContentsId, payload) + }) + + contents.loadFile(path.join(fixtures, 'pages', 'base-page.html')) + }) }) + } - contents.loadURL(`file://${path.join(fixtures, 'pages', 'ping-pong.html')}`) - }) + generateSpecs('without sandbox', {}) + generateSpecs('with sandbox', { sandbox: true }) + generateSpecs('with contextIsolation', { contextIsolation: true }) + generateSpecs('with contextIsolation + sandbox', { contextIsolation: true, sandbox: true }) }) describe('remote listeners', () => { diff --git a/spec/fixtures/module/preload-inject-ipc.js b/spec/fixtures/module/preload-inject-ipc.js deleted file mode 100644 index 3475cd69a636d..0000000000000 --- a/spec/fixtures/module/preload-inject-ipc.js +++ /dev/null @@ -1,2 +0,0 @@ -const {ipcRenderer} = require('electron') -window.ipcRenderer = ipcRenderer diff --git a/spec/fixtures/module/preload-ipc-ping-pong.js b/spec/fixtures/module/preload-ipc-ping-pong.js new file mode 100644 index 0000000000000..d1ee12cc13623 --- /dev/null +++ b/spec/fixtures/module/preload-ipc-ping-pong.js @@ -0,0 +1,5 @@ +const { ipcRenderer } = require('electron') + +ipcRenderer.on('ping', function (event, senderId, payload) { + ipcRenderer.sendTo(senderId, 'pong', payload) +}) diff --git a/spec/fixtures/pages/ping-pong.html b/spec/fixtures/pages/ping-pong.html deleted file mode 100644 index d10e7898653b1..0000000000000 --- a/spec/fixtures/pages/ping-pong.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - From 024cb4afd9cebe9a1bf1976ba83c3cdce1a5afd7 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 6 Jun 2019 10:15:16 -0700 Subject: [PATCH 64/72] Bump v3.1.11 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 9 ++++++--- package.json | 2 +- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 6c57b12848a79..fbb8ebb2cdb9a 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.10 + 3.1.11 CFBundleShortVersionString - 3.1.10 + 3.1.11 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index cd21c406350ec..9f424cf3ade62 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,10,0 - PRODUCTVERSION 3,1,10,0 + FILEVERSION 3,1,11,0 + PRODUCTVERSION 3,1,11,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.10" + VALUE "FileVersion", "3.1.11" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.10" + VALUE "ProductVersion", "3.1.11" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index a6faa3f444422..6af9378c9ff70 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 10 +#define ATOM_PATCH_VERSION 11 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index de0f68e08144b..c4001eddbadfb 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.10', + 'version%': '3.1.11', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 5b0c232bba584..80e34555f575d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.9", + "version": "3.1.10", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -156,6 +156,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", @@ -1885,7 +1886,8 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", - "dev": true + "dev": true, + "optional": true }, "cssstyle": { "version": "0.2.37", @@ -5529,7 +5531,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 eca3fdeb8cc97..2724a9264b24f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.10", + "version": "3.1.11", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 77e18b546e6660015931b06cbae5d02fa0bcd509 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Sat, 15 Jun 2019 09:23:02 +0200 Subject: [PATCH 65/72] fix: crash in BrowserWindow destructor after win.webContents.destroy() (#18686) (#18796) --- 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 cab94da8a910b..930247f006b70 100644 --- a/atom/browser/api/atom_api_browser_window.cc +++ b/atom/browser/api/atom_api_browser_window.cc @@ -64,7 +64,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()); @@ -95,7 +95,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 770181f5b7f4e..6f350a5dfa2e5 100644 --- a/atom/browser/api/atom_api_browser_window.h +++ b/atom/browser/api/atom_api_browser_window.h @@ -112,7 +112,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 0c96e1b98b207..060ee46e77261 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -312,7 +312,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()); @@ -326,8 +328,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 e913c4b644e98..e832cd669548e 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 int64_t GetIDForContents(content::WebContents* web_contents); + base::WeakPtr GetWeakPtr() { return weak_factory_.GetWeakPtr(); } + // Notifies to destroy any guest web contents before destroying self. void DestroyWebContents(bool async); @@ -469,6 +471,8 @@ class WebContents : public mate::TrackableObject, // Observers of this WebContents. base::ObserverList observers_; + base::WeakPtrFactory weak_factory_; + DISALLOW_COPY_AND_ASSIGN(WebContents); }; From 4c409c4651779e57b13d1f8e7abc4523105398df Mon Sep 17 00:00:00 2001 From: Keerthi Niranjan Date: Thu, 11 Jul 2019 20:00:15 +0530 Subject: [PATCH 66/72] revert: notification handle reset on dismissal (#19163) --- brightray/browser/mac/cocoa_notification.mm | 2 -- 1 file changed, 2 deletions(-) diff --git a/brightray/browser/mac/cocoa_notification.mm b/brightray/browser/mac/cocoa_notification.mm index 6f15c9b153cba..154d00f87a571 100644 --- a/brightray/browser/mac/cocoa_notification.mm +++ b/brightray/browser/mac/cocoa_notification.mm @@ -115,8 +115,6 @@ NotificationDismissed(); this->LogAction("dismissed"); - - notification_.reset(nil); } void CocoaNotification::NotificationDisplayed() { From 18e47e7af03c9c65256209094aeeb09bd6db5822 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Thu, 11 Jul 2019 08:50:07 -0700 Subject: [PATCH 67/72] chore: update @types/node version for 3-1-x (#18283) --- npm/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/package.json b/npm/package.json index 788f4681727fa..bfa4280c8ab84 100644 --- a/npm/package.json +++ b/npm/package.json @@ -11,7 +11,7 @@ "main": "index.js", "types": "electron.d.ts", "dependencies": { - "@types/node": "^8.0.24", + "@types/node": "^10.1.4", "electron-download": "^4.1.0", "extract-zip": "^1.0.3" }, From c3ab28f71e02ec5663eaa4ddda5ed61e7061c675 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Thu, 11 Jul 2019 08:58:07 -0700 Subject: [PATCH 68/72] Bump v3.1.12 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index fbb8ebb2cdb9a..656c27962161e 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.11 + 3.1.12 CFBundleShortVersionString - 3.1.11 + 3.1.12 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 9f424cf3ade62..52dce6c19f731 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,11,0 - PRODUCTVERSION 3,1,11,0 + FILEVERSION 3,1,12,0 + PRODUCTVERSION 3,1,12,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.11" + VALUE "FileVersion", "3.1.12" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.11" + VALUE "ProductVersion", "3.1.12" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 6af9378c9ff70..9619b9e0fdb0c 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 11 +#define ATOM_PATCH_VERSION 12 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index c4001eddbadfb..8f03e92079739 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.11', + 'version%': '3.1.12', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index 80e34555f575d..ca56efac07c08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.10", + "version": "3.1.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2724a9264b24f..f403f9bd0c6f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.11", + "version": "3.1.12", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 22f18772867031b50cea42ab155713d0c11f00e5 Mon Sep 17 00:00:00 2001 From: Micha Hanselmann Date: Tue, 30 Jul 2019 08:38:13 -0700 Subject: [PATCH 69/72] docs: fix bad link in notifications tut (#19395) --- docs/tutorial/notifications.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/notifications.md b/docs/tutorial/notifications.md index 177bfa03503b5..90f11e1ab4858 100644 --- a/docs/tutorial/notifications.md +++ b/docs/tutorial/notifications.md @@ -36,7 +36,7 @@ Electron is used together with the installation and update framework Squirrel, [shortcuts will automatically be set correctly][squirrel-events]. Furthermore, Electron will detect that Squirrel was used and will automatically call `app.setAppUserModelId()` with the correct value. During development, you may have -to call [`app.setAppUserModelId()`][[set-app-user-model-id]] yourself. +to call [`app.setAppUserModelId()`][set-app-user-model-id] yourself. Furthermore, in Windows 8, the maximum length for the notification body is 250 characters, with the Windows team recommending that notifications should be kept From 3cb9d42b81bacf1315f82da963844f6d67902b77 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Tue, 30 Jul 2019 08:41:35 -0700 Subject: [PATCH 70/72] Bump v3.1.13 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 656c27962161e..c9f6d983d825d 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.12 + 3.1.13 CFBundleShortVersionString - 3.1.12 + 3.1.13 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 52dce6c19f731..8a32960e12cfc 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,12,0 - PRODUCTVERSION 3,1,12,0 + FILEVERSION 3,1,13,0 + PRODUCTVERSION 3,1,13,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.12" + VALUE "FileVersion", "3.1.13" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.12" + VALUE "ProductVersion", "3.1.13" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 9619b9e0fdb0c..c2ee8ae4d22a5 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 12 +#define ATOM_PATCH_VERSION 13 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 8f03e92079739..58cb38eefaafd 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.12', + 'version%': '3.1.13', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index ca56efac07c08..b0ee93ff4e833 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.11", + "version": "3.1.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f403f9bd0c6f6..4cdb3bcb6019c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.12", + "version": "3.1.13", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 71f65da9e6dc1ab735613152aa39b780daffac44 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Tue, 30 Jul 2019 08:57:48 -0700 Subject: [PATCH 71/72] Revert "Bump v3.1.13" This reverts commit 3cb9d42b81bacf1315f82da963844f6d67902b77. --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index c9f6d983d825d..656c27962161e 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.13 + 3.1.12 CFBundleShortVersionString - 3.1.13 + 3.1.12 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 8a32960e12cfc..52dce6c19f731 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,13,0 - PRODUCTVERSION 3,1,13,0 + FILEVERSION 3,1,12,0 + PRODUCTVERSION 3,1,12,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.13" + VALUE "FileVersion", "3.1.12" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.13" + VALUE "ProductVersion", "3.1.12" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index c2ee8ae4d22a5..9619b9e0fdb0c 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 13 +#define ATOM_PATCH_VERSION 12 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 58cb38eefaafd..8f03e92079739 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.13', + 'version%': '3.1.12', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index b0ee93ff4e833..ca56efac07c08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.12", + "version": "3.1.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4cdb3bcb6019c..f403f9bd0c6f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.13", + "version": "3.1.12", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": { From 93fdeae2e7714947318f69e702d11e96d8e1de42 Mon Sep 17 00:00:00 2001 From: Electron Bot Date: Tue, 30 Jul 2019 09:01:54 -0700 Subject: [PATCH 72/72] Bump v3.1.13 --- atom/browser/resources/mac/Info.plist | 4 ++-- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- electron.gyp | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 656c27962161e..c9f6d983d825d 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,9 +17,9 @@ CFBundleIconFile electron.icns CFBundleVersion - 3.1.12 + 3.1.13 CFBundleShortVersionString - 3.1.12 + 3.1.13 LSApplicationCategoryType public.app-category.developer-tools LSMinimumSystemVersion diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index 52dce6c19f731..8a32960e12cfc 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,12,0 - PRODUCTVERSION 3,1,12,0 + FILEVERSION 3,1,13,0 + PRODUCTVERSION 3,1,13,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "3.1.12" + VALUE "FileVersion", "3.1.13" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "3.1.12" + VALUE "ProductVersion", "3.1.13" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index 9619b9e0fdb0c..c2ee8ae4d22a5 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 3 #define ATOM_MINOR_VERSION 1 -#define ATOM_PATCH_VERSION 12 +#define ATOM_PATCH_VERSION 13 // #define ATOM_PRE_RELEASE_VERSION #ifndef ATOM_STRINGIFY diff --git a/electron.gyp b/electron.gyp index 8f03e92079739..58cb38eefaafd 100644 --- a/electron.gyp +++ b/electron.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '3.1.12', + 'version%': '3.1.13', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', }, 'includes': [ diff --git a/package-lock.json b/package-lock.json index ca56efac07c08..b0ee93ff4e833 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.11", + "version": "3.1.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f403f9bd0c6f6..4cdb3bcb6019c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "3.1.12", + "version": "3.1.13", "repository": "https://github.com/electron/electron", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "devDependencies": {