Commit a2034cba authored by Alex Gough's avatar Alex Gough Committed by Commit Bot

Adds js types for linux & android chrome://sandbox

There should be no functional changes. Existing js will now have its
types checked by the closure_compile target on builds.

Bug: 997273
Change-Id: Ieb9d06b4260238b72381863d5efae49840b61122
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1836136
Auto-Submit: Alex Gough <ajgo@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702955}
parent e42352f7
......@@ -39,7 +39,7 @@ if (closure_compile) {
"welcome:closure_compile",
]
}
if (is_win) {
if (is_win || is_android || is_linux) {
deps += [ "sandbox_internals:closure_compile" ]
}
if (is_chromeos) {
......
......@@ -10,6 +10,24 @@ js_type_check("closure_compile") {
":sandbox_internals_win",
]
}
if (is_android || is_linux) {
deps = [
":sandbox_internals",
]
}
}
js_library("sandbox_internals") {
# Android & Linux both need _externs for type checks as they share a js file.
deps = [
":sandbox_android_externs",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:util",
]
}
js_library("sandbox_android_externs") {
}
js_library("sandbox_internals_win") {
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* This function is only exposed to the Android chrome://sandbox webui.
* @param {!function(!AndroidSandboxStatus)=} callback
*/
chrome.getAndroidSandboxStatus = function(callback) {};
......@@ -2,6 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @typedef {{
* seccompStatus: number,
* pid: string,
* uid: string,
* secontext: string,
* procStatus: string,
* androidBuildId: string
* }}
*/
let AndroidSandboxStatus;
(function() {
/**
* CSS classes for different statuses.
......@@ -52,7 +64,7 @@ function addGoodBadRow(name, result) {
/**
* Reports the overall sandbox status evaluation message.
* @param {boolean}
* @param {boolean} result
*/
function setEvaluation(result) {
const message = result ? 'You are adequately sandboxed.' :
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment