Compare commits

...

14 Commits

Author SHA1 Message Date
John Kleinschmidt
c9b92aebd3 Bump v2.0.0-beta.2 2018-03-05 13:14:27 -05:00
Cheng Zhao
6d3f60374e Merge pull request #12087 from electron/fix-dock-menu-gc-2-0-x
Fix crash when setting dock menu (2.0.x)
2018-03-02 08:39:03 +09:00
Cheng Zhao
8703298e9d spec: Test garbage collecting dock menu 2018-03-01 09:48:39 +09:00
Cheng Zhao
a42057aabd Fix dockMenu not being referenced in JavaScript 2018-03-01 09:48:39 +09:00
Cheng Zhao
bd2ab27c25 Merge pull request #12053 from electron/network-delegate-race
Fix network delegate race condition in 2-0-x
2018-02-27 08:47:20 +09:00
Cheng Zhao
1e6d7295cf Move the arguments instead of const referrencing
Safer and more efficient.
2018-02-26 09:34:49 -08:00
Cheng Zhao
1918da7c2e Remove the evil URLRequestContextGetter::network_delegate 2018-02-26 09:34:40 -08:00
Cheng Zhao
38345c7267 Fix race condition when getting network delegate 2018-02-26 09:34:32 -08:00
shelley vohr
c4742df1ee Merge pull request #12016 from electron/backport-release-updates
Backport fixes from running 2.0.0-beta.1 release to 2-0-x
2018-02-22 15:27:05 -05:00
John Kleinschmidt
5fc485043b Fixes from running 2.0.0-beta.1 release
This provides the following fixes:
1. Remove logic to delete release branch because that branch is no longer used.
2. Fix --validateRelease to not verifyShasums when release is in draft mode.

(cherry picked from commit fa6510a90c)
2018-02-22 11:26:30 -05:00
shelley vohr
967dcd3471 Merge pull request #12014 from electron/backport-version-fix
Fix deprecated API in tools/dump-version-info.js for 2-0-x
2018-02-22 09:28:52 -05:00
John Kleinschmidt
96f800552c Fix deprecated API in tools/dump-version-info.js 2018-02-22 09:00:37 -05:00
John Kleinschmidt
afcbb589b6 Bump v2.0.0-beta.1 2018-02-21 14:45:36 -05:00
John Kleinschmidt
4159103467 Use new release job 2018-02-21 14:41:18 -05:00
15 changed files with 89 additions and 75 deletions

View File

@@ -441,13 +441,14 @@ void DownloadIdCallback(content::DownloadManager* download_manager,
} }
void SetDevToolsNetworkEmulationClientIdInIO( void SetDevToolsNetworkEmulationClientIdInIO(
brightray::URLRequestContextGetter* context_getter, brightray::URLRequestContextGetter* url_request_context_getter,
const std::string& client_id) { const std::string& client_id) {
if (!context_getter) if (!url_request_context_getter)
return; return;
auto network_delegate = net::URLRequestContext* context =
static_cast<AtomNetworkDelegate*>(context_getter->network_delegate()); url_request_context_getter->GetURLRequestContext();
if (network_delegate) AtomNetworkDelegate* network_delegate =
static_cast<AtomNetworkDelegate*>(context->network_delegate());
network_delegate->SetDevToolsNetworkEmulationClientId(client_id); network_delegate->SetDevToolsNetworkEmulationClientId(client_id);
} }

View File

@@ -37,6 +37,26 @@ namespace atom {
namespace api { namespace api {
namespace {
template<typename Method, typename Event, typename Listener>
void CallNetworkDelegateMethod(
brightray::URLRequestContextGetter* url_request_context_getter,
Method method,
Event type,
URLPatterns patterns,
Listener listener) {
// Force creating network delegate.
net::URLRequestContext* context =
url_request_context_getter->GetURLRequestContext();
// Then call the method.
AtomNetworkDelegate* network_delegate =
static_cast<AtomNetworkDelegate*>(context->network_delegate());
(network_delegate->*method)(type, std::move(patterns), std::move(listener));
}
} // namespace
WebRequest::WebRequest(v8::Isolate* isolate, WebRequest::WebRequest(v8::Isolate* isolate,
AtomBrowserContext* browser_context) AtomBrowserContext* browser_context)
: browser_context_(browser_context) { : browser_context_(browser_context) {
@@ -74,16 +94,15 @@ void WebRequest::SetListener(Method method, Event type, mate::Arguments* args) {
return; return;
} }
auto url_request_context_getter = brightray::URLRequestContextGetter* url_request_context_getter =
browser_context_->url_request_context_getter(); browser_context_->url_request_context_getter();
if (!url_request_context_getter) if (!url_request_context_getter)
return; return;
BrowserThread::PostTask( BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, BrowserThread::IO, FROM_HERE,
base::Bind(method, base::Bind(&CallNetworkDelegateMethod<Method, Event, Listener>,
base::Unretained(static_cast<AtomNetworkDelegate*>( base::RetainedRef(url_request_context_getter),
url_request_context_getter->network_delegate())), method, type, std::move(patterns), std::move(listener)));
type, patterns, listener));
} }
// static // static

View File

@@ -227,22 +227,22 @@ AtomNetworkDelegate::~AtomNetworkDelegate() {
void AtomNetworkDelegate::SetSimpleListenerInIO( void AtomNetworkDelegate::SetSimpleListenerInIO(
SimpleEvent type, SimpleEvent type,
const URLPatterns& patterns, URLPatterns patterns,
const SimpleListener& callback) { SimpleListener callback) {
if (callback.is_null()) if (callback.is_null())
simple_listeners_.erase(type); simple_listeners_.erase(type);
else else
simple_listeners_[type] = { patterns, callback }; simple_listeners_[type] = { std::move(patterns), std::move(callback) };
} }
void AtomNetworkDelegate::SetResponseListenerInIO( void AtomNetworkDelegate::SetResponseListenerInIO(
ResponseEvent type, ResponseEvent type,
const URLPatterns& patterns, URLPatterns patterns,
const ResponseListener& callback) { ResponseListener callback) {
if (callback.is_null()) if (callback.is_null())
response_listeners_.erase(type); response_listeners_.erase(type);
else else
response_listeners_[type] = { patterns, callback }; response_listeners_[type] = { std::move(patterns), std::move(callback) };
} }
void AtomNetworkDelegate::SetDevToolsNetworkEmulationClientId( void AtomNetworkDelegate::SetDevToolsNetworkEmulationClientId(

View File

@@ -62,11 +62,11 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate {
~AtomNetworkDelegate() override; ~AtomNetworkDelegate() override;
void SetSimpleListenerInIO(SimpleEvent type, void SetSimpleListenerInIO(SimpleEvent type,
const URLPatterns& patterns, URLPatterns patterns,
const SimpleListener& callback); SimpleListener callback);
void SetResponseListenerInIO(ResponseEvent type, void SetResponseListenerInIO(ResponseEvent type,
const URLPatterns& patterns, URLPatterns patterns,
const ResponseListener& callback); ResponseListener callback);
void SetDevToolsNetworkEmulationClientId(const std::string& client_id); void SetDevToolsNetworkEmulationClientId(const std::string& client_id);

View File

@@ -17,9 +17,9 @@
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>electron.icns</string> <string>electron.icns</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.8.2</string> <string>2.0.0</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.8.2</string> <string>2.0.0</string>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string> <string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>

View File

@@ -56,8 +56,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,8,2,2 FILEVERSION 2,0,0,2
PRODUCTVERSION 1,8,2,2 PRODUCTVERSION 2,0,0,2
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@@ -74,12 +74,12 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "GitHub, Inc." VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Electron" VALUE "FileDescription", "Electron"
VALUE "FileVersion", "1.8.2" VALUE "FileVersion", "2.0.0"
VALUE "InternalName", "electron.exe" VALUE "InternalName", "electron.exe"
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "electron.exe" VALUE "OriginalFilename", "electron.exe"
VALUE "ProductName", "Electron" VALUE "ProductName", "Electron"
VALUE "ProductVersion", "1.8.2" VALUE "ProductVersion", "2.0.0"
VALUE "SquirrelAwareVersion", "1" VALUE "SquirrelAwareVersion", "1"
END END
END END

View File

@@ -5,9 +5,9 @@
#ifndef ATOM_COMMON_ATOM_VERSION_H_ #ifndef ATOM_COMMON_ATOM_VERSION_H_
#define ATOM_COMMON_ATOM_VERSION_H_ #define ATOM_COMMON_ATOM_VERSION_H_
#define ATOM_MAJOR_VERSION 1 #define ATOM_MAJOR_VERSION 2
#define ATOM_MINOR_VERSION 8 #define ATOM_MINOR_VERSION 0
#define ATOM_PATCH_VERSION 2 #define ATOM_PATCH_VERSION 0
#define ATOM_PRE_RELEASE_VERSION -beta.2 #define ATOM_PRE_RELEASE_VERSION -beta.2
#ifndef ATOM_STRINGIFY #ifndef ATOM_STRINGIFY

View File

@@ -80,11 +80,6 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
net::HostResolver* host_resolver(); net::HostResolver* host_resolver();
net::URLRequestJobFactory* job_factory() const { return job_factory_; } net::URLRequestJobFactory* job_factory() const { return job_factory_; }
net::NetworkDelegate* network_delegate() const {
if (url_request_context_)
return url_request_context_->network_delegate();
return nullptr;
}
private: private:
Delegate* delegate_; Delegate* delegate_;

View File

@@ -4,7 +4,7 @@
'product_name%': 'Electron', 'product_name%': 'Electron',
'company_name%': 'GitHub, Inc', 'company_name%': 'GitHub, Inc',
'company_abbr%': 'github', 'company_abbr%': 'github',
'version%': '1.8.2-beta.2', 'version%': '2.0.0-beta.2',
'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c', 'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c',
}, },
'includes': [ 'includes': [

View File

@@ -10,6 +10,8 @@ const electron = require('electron')
const {deprecate, Menu} = electron const {deprecate, Menu} = electron
const {EventEmitter} = require('events') const {EventEmitter} = require('events')
let dockMenu = null
// App is an EventEmitter. // App is an EventEmitter.
Object.setPrototypeOf(App.prototype, EventEmitter.prototype) Object.setPrototypeOf(App.prototype, EventEmitter.prototype)
EventEmitter.call(app) EventEmitter.call(app)
@@ -49,7 +51,13 @@ if (process.platform === 'darwin') {
hide: bindings.dockHide, hide: bindings.dockHide,
show: bindings.dockShow, show: bindings.dockShow,
isVisible: bindings.dockIsVisible, isVisible: bindings.dockIsVisible,
setMenu: bindings.dockSetMenu, setMenu (menu) {
dockMenu = menu
bindings.dockSetMenu(menu)
},
getMenu () {
return dockMenu
},
setIcon: bindings.dockSetIcon setIcon: bindings.dockSetIcon
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "electron", "name": "electron",
"version": "1.8.2-beta.2", "version": "2.0.0-beta.2",
"repository": "https://github.com/electron/electron", "repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS", "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": { "devDependencies": {

View File

@@ -12,8 +12,7 @@ const circleCIJobs = [
] ]
const jenkinsJobs = [ const jenkinsJobs = [
'electron-mas-x64-release', 'electron-release'
'electron-osx-x64-release'
] ]
async function makeRequest (requestOptions, parseResponse) { async function makeRequest (requestOptions, parseResponse) {

View File

@@ -6,7 +6,6 @@ const assert = require('assert')
const fs = require('fs') const fs = require('fs')
const { execSync } = require('child_process') const { execSync } = require('child_process')
const GitHub = require('github') const GitHub = require('github')
const { GitProcess } = require('dugite')
const nugget = require('nugget') const nugget = require('nugget')
const pkg = require('../package.json') const pkg = require('../package.json')
const pkgVersion = `v${pkg.version}` const pkgVersion = `v${pkg.version}`
@@ -24,7 +23,6 @@ const github = new GitHub({
followRedirects: false followRedirects: false
}) })
github.authenticate({type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN}) github.authenticate({type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN})
const gitDir = path.resolve(__dirname, '..')
async function getDraftRelease (version, skipValidation) { async function getDraftRelease (version, skipValidation) {
let releaseInfo = await github.repos.getReleases({owner: 'electron', repo: 'electron'}) let releaseInfo = await github.repos.getReleases({owner: 'electron', repo: 'electron'})
@@ -62,6 +60,7 @@ async function validateReleaseAssets (release, validatingRelease) {
}) })
check((failureCount === 0), `All required GitHub assets exist for release`, true) check((failureCount === 0), `All required GitHub assets exist for release`, true)
if (!validatingRelease || !release.draft) {
if (release.draft) { if (release.draft) {
await verifyAssets(release) await verifyAssets(release)
} else { } else {
@@ -73,6 +72,7 @@ async function validateReleaseAssets (release, validatingRelease) {
const s3Urls = s3UrlsForVersion(release.tag_name) const s3Urls = s3UrlsForVersion(release.tag_name)
await verifyShasums(s3Urls, true) await verifyShasums(s3Urls, true)
} }
}
function check (condition, statement, exitIfFail = false) { function check (condition, statement, exitIfFail = false) {
if (condition) { if (condition) {
@@ -276,7 +276,6 @@ async function makeRelease (releaseToValidate) {
draftRelease = await getDraftRelease(pkgVersion, true) draftRelease = await getDraftRelease(pkgVersion, true)
await validateReleaseAssets(draftRelease) await validateReleaseAssets(draftRelease)
await publishRelease(draftRelease) await publishRelease(draftRelease)
await cleanupReleaseBranch()
console.log(`${pass} SUCCESS!!! Release has been published. Please run ` + console.log(`${pass} SUCCESS!!! Release has been published. Please run ` +
`"npm run publish-to-npm" to publish release to npm.`) `"npm run publish-to-npm" to publish release to npm.`)
} }
@@ -444,25 +443,4 @@ async function validateChecksums (validationArgs) {
`shasums defined in ${validationArgs.shaSumFile}.`) `shasums defined in ${validationArgs.shaSumFile}.`)
} }
async function cleanupReleaseBranch () {
console.log(`Cleaning up release branch.`)
let errorMessage = `Could not delete local release branch.`
let successMessage = `Successfully deleted local release branch.`
await callGit(['branch', '-D', 'release'], errorMessage, successMessage)
errorMessage = `Could not delete remote release branch.`
successMessage = `Successfully deleted remote release branch.`
return callGit(['push', 'origin', ':release'], errorMessage, successMessage)
}
async function callGit (args, errorMessage, successMessage) {
let gitResult = await GitProcess.exec(args, gitDir)
if (gitResult.exitCode === 0) {
console.log(`${pass} ${successMessage}`)
return true
} else {
console.log(`${fail} ${errorMessage} ${gitResult.stderr}`)
process.exit(1)
}
}
makeRelease(args.validateRelease) makeRelease(args.validateRelease)

View File

@@ -7,7 +7,7 @@ const path = require('path')
const {ipcRenderer, remote} = require('electron') const {ipcRenderer, remote} = require('electron')
const {closeWindow} = require('./window-helpers') const {closeWindow} = require('./window-helpers')
const {app, BrowserWindow, ipcMain} = remote const {app, BrowserWindow, Menu, ipcMain} = remote
const isCI = remote.getGlobal('isCi') const isCI = remote.getGlobal('isCi')
@@ -881,4 +881,18 @@ describe('app module', () => {
}, /before app is ready/) }, /before app is ready/)
}) })
}) })
describe('dock.setMenu', () => {
before(function () {
if (process.platform !== 'darwin') {
this.skip()
}
})
it('keeps references to the menu', () => {
app.dock.setMenu(new Menu())
const v8Util = process.atomBinding('v8_util')
v8Util.requestGarbageCollectionForTesting()
})
})
}) })

View File

@@ -16,7 +16,7 @@ function getDate () {
function getInfoForCurrentVersion () { function getInfoForCurrentVersion () {
var json = {} var json = {}
json.version = process.versions['atom-shell'] json.version = process.versions.electron
json.date = getDate() json.date = getDate()
var names = ['node', 'v8', 'uv', 'zlib', 'openssl', 'modules', 'chrome'] var names = ['node', 'v8', 'uv', 'zlib', 'openssl', 'modules', 'chrome']