Skip to content

Commit faef453

Browse files
author
John Kleinschmidt
authored
Merge branch 'master' into expect-debugger-spec
2 parents c65844a + 0219ef0 commit faef453

File tree

257 files changed

+4725
-2529
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+4725
-2529
lines changed

.circleci/config.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
build-steps: &build-steps
22
steps:
33
- checkout
4+
- run:
5+
name: Install Node.js 10 on MacOS
6+
command: |
7+
if [ "$INSTALL_MACOS_NODE" == "true" ]; then
8+
echo 'Installing Node.js 10 for MacOS'
9+
brew update
10+
brew install node@10
11+
fi
412
- run:
513
name: Check for release
614
command: |
@@ -117,7 +125,7 @@ build-steps: &build-steps
117125

118126
build-defaults: &build-defaults
119127
docker:
120-
- image: electronbuilds/electron:0.0.7
128+
- image: electronbuilds/electron:0.0.8
121129
<<: *build-steps
122130

123131
version: 2
@@ -241,34 +249,38 @@ jobs:
241249
environment:
242250
TARGET_ARCH: x64
243251
RUN_TESTS: true
252+
INSTALL_MACOS_NODE: true
244253
macos:
245-
xcode: "9.0"
254+
xcode: "8.3.3"
246255
<<: *build-steps
247256

248257
electron-osx-x64-release-nightly:
249258
environment:
250259
TARGET_ARCH: x64
251260
RUN_RELEASE_BUILD: true
261+
INSTALL_MACOS_NODE: true
252262
macos:
253-
xcode: "9.0"
263+
xcode: "8.3.3"
254264
<<: *build-steps
255265

256266
electron-mas-x64:
257267
environment:
258268
TARGET_ARCH: x64
259269
MAS_BUILD: 1
260270
RUN_TESTS: true
271+
INSTALL_MACOS_NODE: true
261272
macos:
262-
xcode: "9.0"
273+
xcode: "8.3.3"
263274
<<: *build-steps
264275

265276
electron-mas-x64-release-nightly:
266277
environment:
267278
TARGET_ARCH: x64
268279
MAS_BUILD: 1
269280
RUN_RELEASE_BUILD: true
281+
INSTALL_MACOS_NODE: true
270282
macos:
271-
xcode: "9.0"
283+
xcode: "8.3.3"
272284
<<: *build-steps
273285

274286

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
Thank you for your Pull Request. Please provide a description above and review
33
the requirements below.
44
5-
Bug fixes and new features should include tests and possibly benchmarks.
6-
75
Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTING.md
8-
-->
6+
-->
7+
8+
##### Checklist
9+
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->
10+
11+
- [ ] PR description included and stakeholders cc'd
12+
- [ ] `npm test` passes
13+
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/master/docs/development/testing.md)
14+
- [ ] relevant documentation is changed or added
15+
- [ ] commit messages or PR title follow semantic [commit guidelines](https://github.com/electron/electron/blob/master/docs/development/pull-requests.md#commit-message-guidelines)

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ ENV HOME=/home
77
RUN chmod a+rwx /home
88

99
# Install node.js
10-
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
11-
RUN apt-get update && apt-get install -y nodejs
10+
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
11+
RUN apt-get install -y nodejs
1212

1313
# Install wget used by crash reporter
1414
RUN apt-get install -y wget

Dockerfile.circleci

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ FROM electronbuilds/libchromiumcontent:0.0.4
33
USER root
44

55
# Install node.js
6-
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
7-
RUN apt-get update && apt-get install -y nodejs
6+
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
7+
RUN apt-get install -y nodejs
88

99
# Install wget used by crash reporter
1010
RUN apt-get install -y wget

appveyor.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
version: 1.0.{build}
2+
build_cloud: electron-16
3+
image: electron-16-vs2017
4+
environment:
5+
DISABLE_CRASH_REPORTER_TESTS: true
6+
matrix:
7+
- TARGET_ARCH: ia32
8+
- TARGET_ARCH: x64
9+
build_script:
10+
- ps: >-
11+
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
12+
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
13+
14+
} else {
15+
Add-Path "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64"
16+
17+
$env:path = "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64;$env:path"
18+
19+
$Message = (git log --format=%B -n 1 HEAD) | Out-String
20+
21+
if ((Test-Path Env:\RUN_RELEASE_BUILD)) {
22+
$env:ELECTRON_RELEASE = '1'
23+
Write-Output "release build triggered from api"
24+
}
25+
26+
if ((Test-Path Env:\ELECTRON_RELEASE)) {
27+
Write-Output "Running release build"
28+
python script\bootstrap.py --target_arch=$env:TARGET_ARCH
29+
python script\build.py -c R
30+
python script\create-dist.py
31+
} else {
32+
Write-Output "Running debug build"
33+
python script\bootstrap.py --target_arch=$env:TARGET_ARCH --dev
34+
python script\build.py -c D
35+
}
36+
if ($? -ne 'True') {
37+
throw "Build failed with exit code $?"
38+
} else {
39+
"Build succeeded."
40+
}
41+
}
42+
43+
test_script:
44+
- ps: >-
45+
if (Test-Path Env:\ELECTRON_RELEASE) {
46+
Write-Output "Skipping tests for release build"
47+
} else {
48+
Write-Output "Running tests for debug build"
49+
python script\test.py --ci
50+
if ($LASTEXITCODE -ne '0') {
51+
throw "Tests failed with exit code $LASTEXITCODE"
52+
} else {
53+
Write-Output "Tests succeeded."
54+
}
55+
python script\verify-ffmpeg.py
56+
57+
if ($LASTEXITCODE -ne '0') {
58+
throw "Verify ffmpeg failed with exit code $LASTEXITCODE"
59+
} else {
60+
"Verify ffmpeg succeeded."
61+
}
62+
}
63+
artifacts:
64+
- path: out
65+
name: out

atom/app/atom_content_client.cc

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "content/public/common/user_agent.h"
2121
#include "media/media_features.h"
2222
#include "ppapi/shared_impl/ppapi_permissions.h"
23-
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
2423
#include "ui/base/l10n/l10n_util.h"
2524
#include "url/url_constants.h"
2625

@@ -90,20 +89,6 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
9089
kWidevineCdmPluginMimeType, kWidevineCdmPluginExtension,
9190
kWidevineCdmPluginMimeTypeDescription);
9291

93-
// Add the supported codecs as if they came from the component manifest.
94-
std::vector<std::string> codecs;
95-
codecs.push_back(kCdmSupportedCodecVp8);
96-
codecs.push_back(kCdmSupportedCodecVp9);
97-
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
98-
codecs.push_back(kCdmSupportedCodecAvc1);
99-
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
100-
std::string codec_string = base::JoinString(
101-
codecs, std::string(1, kCdmSupportedCodecsValueDelimiter));
102-
widevine_cdm_mime_type.additional_param_names.push_back(
103-
base::ASCIIToUTF16(kCdmSupportedCodecsParamName));
104-
widevine_cdm_mime_type.additional_param_values.push_back(
105-
base::ASCIIToUTF16(codec_string));
106-
10792
widevine_cdm.mime_types.push_back(widevine_cdm_mime_type);
10893
widevine_cdm.permissions = kWidevineCdmPluginPermissions;
10994

@@ -224,4 +209,36 @@ void AtomContentClient::AddPepperPlugins(
224209
#endif // defined(ENABLE_PDF_VIEWER)
225210
}
226211

212+
void AtomContentClient::AddContentDecryptionModules(
213+
std::vector<content::CdmInfo>* cdms,
214+
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) {
215+
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
216+
auto command_line = base::CommandLine::ForCurrentProcess();
217+
base::FilePath widevine_cdm_path =
218+
command_line->GetSwitchValuePath(switches::kWidevineCdmPath);
219+
if (widevine_cdm_path.empty())
220+
return;
221+
222+
if (!base::PathExists(widevine_cdm_path))
223+
return;
224+
225+
auto widevine_cdm_version =
226+
command_line->GetSwitchValueASCII(switches::kWidevineCdmVersion);
227+
if (widevine_cdm_version.empty())
228+
return;
229+
230+
std::vector<media::VideoCodec> supported_video_codecs;
231+
supported_video_codecs.push_back(media::VideoCodec::kCodecVP8);
232+
supported_video_codecs.push_back(media::VideoCodec::kCodecVP9);
233+
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
234+
supported_video_codecs.push_back(media::VideoCodec::kCodecH264);
235+
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
236+
content::CdmRegistry::GetInstance()->RegisterCdm(
237+
content::CdmInfo(kWidevineCdmDisplayName, kWidevineCdmGuid,
238+
base::Version(widevine_cdm_version), widevine_cdm_path,
239+
kWidevineCdmFileSystemId, supported_video_codecs, false,
240+
kWidevineKeySystem, false));
241+
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
242+
}
243+
227244
} // namespace atom

atom/app/atom_content_client.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class AtomContentClient : public brightray::ContentClient {
2626
void AddAdditionalSchemes(Schemes* schemes) override;
2727
void AddPepperPlugins(
2828
std::vector<content::PepperPluginInfo>* plugins) override;
29+
void AddContentDecryptionModules(
30+
std::vector<content::CdmInfo>* cdms,
31+
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) override;
2932

3033
private:
3134
DISALLOW_COPY_AND_ASSIGN(AtomContentClient);

atom/app/atom_main_delegate.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "chrome/common/chrome_paths.h"
2323
#include "content/public/common/content_switches.h"
2424
#include "ipc/ipc_features.h"
25+
#include "services/service_manager/sandbox/switches.h"
2526
#include "ui/base/l10n/l10n_util.h"
2627
#include "ui/base/resource/resource_bundle.h"
2728

@@ -83,7 +84,7 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
8384
#endif // !defined(OS_WIN)
8485

8586
// Only enable logging when --enable-logging is specified.
86-
std::unique_ptr<base::Environment> env(base::Environment::Create());
87+
auto env = base::Environment::Create();
8788
if (!command_line->HasSwitch(::switches::kEnableLogging) &&
8889
!env->HasVar("ELECTRON_ENABLE_LOGGING")) {
8990
settings.logging_dest = logging::LOG_NONE;
@@ -141,7 +142,8 @@ void AtomMainDelegate::PreSandboxStartup() {
141142
if (command_line->HasSwitch(switches::kEnableSandbox)) {
142143
// Disable setuid sandbox since it is not longer required on
143144
// linux(namespace sandbox is available on most distros).
144-
command_line->AppendSwitch(::switches::kDisableSetuidSandbox);
145+
command_line->AppendSwitch(
146+
service_manager::switches::kDisableSetuidSandbox);
145147
} else {
146148
// Disable renderer sandbox for most of node's functions.
147149
command_line->AppendSwitch(::switches::kNoSandbox);
@@ -203,7 +205,7 @@ bool AtomMainDelegate::DelaySandboxInitialization(
203205

204206
std::unique_ptr<brightray::ContentClient>
205207
AtomMainDelegate::CreateContentClient() {
206-
return std::unique_ptr<brightray::ContentClient>(new AtomContentClient);
208+
return std::make_unique<AtomContentClient>();
207209
}
208210

209211
} // namespace atom

atom/app/node_main.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ int NodeMain(int argc, char* argv[]) {
3838
base::ThreadTaskRunnerHandle handle(uv_task_runner);
3939

4040
// Initialize feature list.
41-
std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
41+
auto feature_list = std::make_unique<base::FeatureList>();
4242
feature_list->InitializeFromCommandLine("", "");
4343
base::FeatureList::SetInstance(std::move(feature_list));
4444

45-
gin::V8Initializer::LoadV8Snapshot();
45+
gin::V8Initializer::LoadV8Snapshot(
46+
gin::V8Initializer::V8SnapshotFileType::kWithAdditionalContext);
4647
gin::V8Initializer::LoadV8Natives();
4748

4849
// V8 requires a task scheduler apparently

atom/browser/api/atom_api_app.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "atom/common/native_mate_converters/gurl_converter.h"
2121
#include "atom/common/native_mate_converters/image_converter.h"
2222
#include "atom/common/native_mate_converters/net_converter.h"
23+
#include "atom/common/native_mate_converters/network_converter.h"
2324
#include "atom/common/native_mate_converters/value_converter.h"
2425
#include "atom/common/node_includes.h"
2526
#include "atom/common/options_switches.h"
@@ -47,6 +48,7 @@
4748
#include "native_mate/object_template_builder.h"
4849
#include "net/ssl/client_cert_identity.h"
4950
#include "net/ssl/ssl_cert_request_info.h"
51+
#include "services/network/public/cpp/network_switches.h"
5052
#include "ui/base/l10n/l10n_util.h"
5153
#include "ui/gfx/image/image.h"
5254

@@ -547,9 +549,9 @@ App::App(v8::Isolate* isolate) {
547549
Browser::Get()->AddObserver(this);
548550
content::GpuDataManager::GetInstance()->AddObserver(this);
549551
base::ProcessId pid = base::GetCurrentProcId();
550-
std::unique_ptr<atom::ProcessMetric> process_metric(new atom::ProcessMetric(
552+
auto process_metric = std::make_unique<atom::ProcessMetric>(
551553
content::PROCESS_TYPE_BROWSER, pid,
552-
base::ProcessMetrics::CreateCurrentProcessMetrics()));
554+
base::ProcessMetrics::CreateCurrentProcessMetrics());
553555
app_metrics_[pid] = std::move(process_metric);
554556
Init(isolate);
555557
}
@@ -695,7 +697,7 @@ bool App::CanCreateWindow(
695697
WindowOpenDisposition disposition,
696698
const blink::mojom::WindowFeatures& features,
697699
const std::vector<std::string>& additional_features,
698-
const scoped_refptr<content::ResourceRequestBody>& body,
700+
const scoped_refptr<network::ResourceRequestBody>& body,
699701
bool user_gesture,
700702
bool opener_suppressed,
701703
bool* no_javascript_access) {
@@ -811,9 +813,8 @@ void App::ChildProcessLaunched(int process_type, base::ProcessHandle handle) {
811813
std::unique_ptr<base::ProcessMetrics> metrics(
812814
base::ProcessMetrics::CreateProcessMetrics(handle));
813815
#endif
814-
std::unique_ptr<atom::ProcessMetric> process_metric(
815-
new atom::ProcessMetric(process_type, pid, std::move(metrics)));
816-
app_metrics_[pid] = std::move(process_metric);
816+
app_metrics_[pid] = std::make_unique<atom::ProcessMetric>(process_type, pid,
817+
std::move(metrics));
817818
}
818819

819820
void App::ChildProcessDisconnected(base::ProcessId pid) {
@@ -1305,7 +1306,7 @@ void AppendSwitch(const std::string& switch_string, mate::Arguments* args) {
13051306

13061307
if (base::EndsWith(switch_string, "-path",
13071308
base::CompareCase::INSENSITIVE_ASCII) ||
1308-
switch_string == switches::kLogNetLog) {
1309+
switch_string == network::switches::kLogNetLog) {
13091310
base::FilePath path;
13101311
args->GetNext(&path);
13111312
command_line->AppendSwitchPath(switch_string, path);

0 commit comments

Comments
 (0)