servo: Merge #12708 - Enable multiprocess and sandbox (from paulrouget:multiprocessAndSandboxForBhtml); r=metajack

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #12705 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Enable multiprocess and sandbox for Mac and Linux when running
browserhtml.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3dce4c62ca55409dfac9dea6ecc674c0020eab6c
This commit is contained in:
Paul Rouget 2016-08-04 16:13:45 -05:00
parent 757c4e85e5
commit 22abbe3f7c
2 changed files with 6 additions and 2 deletions

View File

@ -146,7 +146,7 @@ class PackageCommands(CommandBase):
print("Writing run-servo")
bhtml_path = path.join('${0%/*}/../Resources', browserhtml_path.split('/')[-1], 'out', 'index.html')
runservo = os.open(dir_to_app + '/Contents/MacOS/run-servo', os.O_WRONLY | os.O_CREAT, int("0755", 8))
os.write(runservo, '#!/bin/bash\nexec ${0%/*}/servo ' + bhtml_path)
os.write(runservo, '#!/bin/bash\nexec ${0%/*}/servo -M -S ' + bhtml_path)
os.close(runservo)
print("Creating dmg")
@ -220,7 +220,7 @@ class PackageCommands(CommandBase):
delete(dir_to_package + '/build/' + f)
print("Writing runservo.sh")
# TODO: deduplicate this arg list from post_build_commands
servo_args = ['-w', '-b',
servo_args = ['-w', '-b', '-M', '-S'
'--pref', 'dom.mozbrowser.enabled',
'--pref', 'dom.forcetouch.enabled',
'--pref', 'shell.builtin-key-shortcuts.enabled=false',

View File

@ -111,6 +111,10 @@ class PostBuildCommands(CommandBase):
# Convert to a relative path to avoid mingw -> Windows path conversions
browserhtml_path = path.relpath(browserhtml_path, os.getcwd())
if not is_windows():
# multiprocess + sandbox
args = args + ['-M', '-S']
args = args + ['-w',
'--pref', 'dom.mozbrowser.enabled',
'--pref', 'dom.forcetouch.enabled',