Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1937)

Unified Diff: chrome/browser/ui/webui/gpu_internals_ui.cc

Issue 10910026: Show about:sandbox status in the about:gpu page. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Show about:sandbox status in the about:gpu page. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/gpu_internals/info_view.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/gpu_internals_ui.cc
diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc
index 9340e2e3f3c5ee93ab49f7fad921dd3722b1ab74..896a23791ce61bfe0cf7712a150194ffa08e4599 100644
--- a/chrome/browser/ui/webui/gpu_internals_ui.cc
+++ b/chrome/browser/ui/webui/gpu_internals_ui.cc
@@ -34,6 +34,11 @@
#include "third_party/angle/src/common/version.h"
#include "ui/base/l10n/l10n_util.h"
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
+#include "content/public/browser/zygote_host_linux.h"
+#include "content/public/common/sandbox_linux.h"
+#endif
+
using content::BrowserThread;
using content::GpuDataManager;
using content::WebContents;
@@ -81,6 +86,7 @@ class GpuMessageHandler
// Submessages dispatched from OnCallAsync
Value* OnRequestClientInfo(const ListValue* list);
+ Value* OnRequestSandboxInfo(const ListValue* list);
Value* OnRequestLogMessages(const ListValue* list);
Value* OnRequestCrashList(const ListValue* list);
@@ -157,6 +163,8 @@ void GpuMessageHandler::OnCallAsync(const ListValue* args) {
Value* ret = NULL;
if (submessage == "requestClientInfo") {
ret = OnRequestClientInfo(submessageArgs);
+ } else if (submessage == "requestSandboxInfo") {
+ ret = OnRequestSandboxInfo(submessageArgs);
} else if (submessage == "requestLogMessages") {
ret = OnRequestLogMessages(submessageArgs);
} else if (submessage == "requestCrashList") {
@@ -237,6 +245,35 @@ Value* GpuMessageHandler::OnRequestClientInfo(const ListValue* list) {
return dict;
}
+Value* GpuMessageHandler::OnRequestSandboxInfo(const ListValue*) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ DictionaryValue* dict = new DictionaryValue();
+
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
+ const int status = content::ZygoteHost::GetInstance()->GetSandboxStatus();
+ dict->SetBoolean("suid_sanbox", status & content::kSandboxLinuxSUID);
+ dict->SetBoolean("pid_namespaces", status & content::kSandboxLinuxPIDNS);
+ dict->SetBoolean("net_namespaces", status & content::kSandboxLinuxNetNS);
+ dict->SetBoolean("seccomp_legacy",
+ status & content::kSandboxLinuxSeccompLegacy);
+ dict->SetBoolean("seccomp_bpf", status & content::kSandboxLinuxSeccompBpf);
+ bool good = ((status & content::kSandboxLinuxSUID) &&
+ (status & content::kSandboxLinuxPIDNS)) ||
+ (status & content::kSandboxLinuxSeccompLegacy);
+ dict->SetBoolean("sandbox_ok", good);
+#else
+ dict->SetBoolean("suid_sanbox", false);
+ dict->SetBoolean("pid_namespaces", false);
+ dict->SetBoolean("net_namespaces", false);
+ dict->SetBoolean("seccomp_legacy", false);
+ dict->SetBoolean("seccomp_bpf", false);
+ dict->SetBoolean("sandbox_ok", true);
+#endif
+
+ return dict;
+}
+
Value* GpuMessageHandler::OnRequestLogMessages(const ListValue*) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
« no previous file with comments | « chrome/browser/resources/gpu_internals/info_view.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698