Chromium Code Reviews| Index: chrome/utility/chrome_content_utility_client.cc |
| diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc |
| index d82c23bf5479e1b7cf85f27b64a0953c7d635c47..6c2aaa1d24a425b5588071348ff5a262895c8717 100644 |
| --- a/chrome/utility/chrome_content_utility_client.cc |
| +++ b/chrome/utility/chrome_content_utility_client.cc |
| @@ -29,6 +29,8 @@ |
| #if !defined(OS_ANDROID) |
|
Lei Zhang
2015/03/19 00:42:23
Maybe flip this to #if defined(OS_ANDROID) ?
Robert Sesek
2015/03/19 14:57:30
Done.
|
| #include "chrome/utility/profile_import_handler.h" |
| #include "net/proxy/mojo_proxy_resolver_factory_impl.h" |
| +#else |
| +#include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
| #endif |
| #if defined(OS_WIN) |
| @@ -162,6 +164,10 @@ bool ChromeContentUtilityClient::OnMessageReceived( |
| #if defined(OS_CHROMEOS) |
| IPC_MESSAGE_HANDLER(ChromeUtilityMsg_CreateZipFile, OnCreateZipFile) |
| #endif |
| +#if defined(OS_ANDROID) |
| + IPC_MESSAGE_HANDLER(ChromeUtilityMsg_DetectSeccompSupport, |
| + OnDetectSeccompSupport) |
| +#endif |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP() |
| @@ -277,6 +283,22 @@ void ChromeContentUtilityClient::OnCreateZipFile( |
| } |
| #endif // defined(OS_CHROMEOS) |
| +#if defined(OS_ANDROID) |
| +void ChromeContentUtilityClient::OnDetectSeccompSupport() { |
| + bool supports_prctl = sandbox::SandboxBPF::SupportsSeccompSandbox( |
| + sandbox::SandboxBPF::SeccompLevel::SINGLE_THREADED); |
| + Send(new ChromeUtilityHostMsg_DetectSeccompSupport_ResultPrctl( |
| + supports_prctl)); |
| + |
| + bool supports_syscall = sandbox::SandboxBPF::SupportsSeccompSandbox( |
| + sandbox::SandboxBPF::SeccompLevel::MULTI_THREADED); |
| + Send(new ChromeUtilityHostMsg_DetectSeccompSupport_ResultSyscall( |
| + supports_syscall)); |
| + |
| + ReleaseProcessIfNeeded(); |
| +} |
| +#endif // defined(OS_ANDROID) |
| + |
| void ChromeContentUtilityClient::OnRobustJPEGDecodeImage( |
| const std::vector<unsigned char>& encoded_data) { |
| // Our robust jpeg decoding is using IJG libjpeg. |