Introduce content_nacl_nonsfi.gyp for nacl_helper_nonsfi.
This CL builds a library containing only SendZygoteChildPing(), which will be used nacl_helper_linux even without the sandbox. The lib will contain more code for sandbox implementation in a following CL. BUG=358465 TEST=Ran trybot. Review URL: https://codereview.chromium.org/687363004 Cr-Commit-Position: refs/heads/master@{#303438}
This commit is contained in:
@ -44,8 +44,8 @@
|
||||
#include "components/nacl/loader/nonsfi/irt_exception_handling.h"
|
||||
#include "components/nacl/loader/nonsfi/nonsfi_listener.h"
|
||||
#include "components/nacl/loader/sandbox_linux/nacl_sandbox_linux.h"
|
||||
#include "content/public/common/child_process_sandbox_support_linux.h"
|
||||
#include "content/public/common/content_descriptors.h"
|
||||
#include "content/public/common/send_zygote_child_ping_linux.h"
|
||||
#include "content/public/common/zygote_fork_delegate_linux.h"
|
||||
#include "crypto/nss_util.h"
|
||||
#include "ipc/ipc_descriptors.h"
|
||||
|
@ -57,6 +57,7 @@
|
||||
'>(tc_lib_dir_nonsfi_helper32)/libbase_nacl_nonsfi.a',
|
||||
'>(tc_lib_dir_nonsfi_helper32)/libcommand_buffer_client_nacl.a',
|
||||
'>(tc_lib_dir_nonsfi_helper32)/libcommand_buffer_common_nacl.a',
|
||||
'>(tc_lib_dir_nonsfi_helper32)/libcontent_common_nacl_nonsfi.a',
|
||||
'>(tc_lib_dir_nonsfi_helper32)/libevent_nacl_nonsfi.a',
|
||||
'>(tc_lib_dir_nonsfi_helper32)/libgles2_cmd_helper_nacl.a',
|
||||
'>(tc_lib_dir_nonsfi_helper32)/libgles2_implementation_nacl.a',
|
||||
@ -75,6 +76,7 @@
|
||||
},
|
||||
'dependencies': [
|
||||
'../base/base_nacl.gyp:base_nacl_nonsfi',
|
||||
'../content/content_nacl_nonsfi.gyp:content_common_nacl_nonsfi',
|
||||
'../ipc/ipc_nacl.gyp:ipc_nacl_nonsfi',
|
||||
'../native_client/src/nonsfi/irt/irt.gyp:nacl_sys_private',
|
||||
'../native_client/src/untrusted/nacl/nacl.gyp:nacl_lib_newlib',
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "base/posix/unix_domain_socket_linux.h"
|
||||
#include "base/sys_byteorder.h"
|
||||
#include "content/common/sandbox_linux/sandbox_linux.h"
|
||||
#include "content/common/zygote_commands_linux.h"
|
||||
#include "third_party/WebKit/public/platform/linux/WebFallbackFont.h"
|
||||
#include "third_party/WebKit/public/platform/linux/WebFontRenderStyle.h"
|
||||
|
||||
@ -205,11 +204,4 @@ bool GetFontTable(int fd, uint32_t table_tag, off_t offset,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SendZygoteChildPing(int fd) {
|
||||
return UnixDomainSocket::SendMsg(fd,
|
||||
kZygoteChildPingMessage,
|
||||
sizeof(kZygoteChildPingMessage),
|
||||
std::vector<int>());
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
21
content/common/send_zygote_child_ping_linux.cc
Normal file
21
content/common/send_zygote_child_ping_linux.cc
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2014 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.
|
||||
|
||||
#include "content/public/common/send_zygote_child_ping_linux.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "base/posix/unix_domain_socket_linux.h"
|
||||
#include "content/common/zygote_commands_linux.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
bool SendZygoteChildPing(int fd) {
|
||||
return UnixDomainSocket::SendMsg(fd,
|
||||
kZygoteChildPingMessage,
|
||||
sizeof(kZygoteChildPingMessage),
|
||||
std::vector<int>());
|
||||
}
|
||||
|
||||
} // namespace content
|
@ -73,9 +73,9 @@
|
||||
'public/common/injection_test_mac.h',
|
||||
'public/common/injection_test_win.h',
|
||||
'public/common/javascript_message_type.h',
|
||||
'public/common/main_function_params.h',
|
||||
'public/common/manifest.cc',
|
||||
'public/common/manifest.h',
|
||||
'public/common/main_function_params.h',
|
||||
'public/common/media_stream_request.cc',
|
||||
'public/common/media_stream_request.h',
|
||||
'public/common/menu_item.cc',
|
||||
@ -110,6 +110,7 @@
|
||||
'public/common/sandboxed_process_launcher_delegate.cc',
|
||||
'public/common/sandboxed_process_launcher_delegate.h',
|
||||
'public/common/security_style.h',
|
||||
'public/common/send_zygote_child_ping_linux.h',
|
||||
'public/common/service_registry.h',
|
||||
'public/common/show_desktop_notification_params.cc',
|
||||
'public/common/show_desktop_notification_params.h',
|
||||
@ -311,14 +312,14 @@
|
||||
'common/gpu/image_transport_surface.cc',
|
||||
'common/gpu/image_transport_surface.h',
|
||||
'common/gpu/image_transport_surface_android.cc',
|
||||
'common/gpu/image_transport_surface_calayer_mac.mm',
|
||||
'common/gpu/image_transport_surface_calayer_mac.h',
|
||||
'common/gpu/image_transport_surface_fbo_mac.mm',
|
||||
'common/gpu/image_transport_surface_calayer_mac.mm',
|
||||
'common/gpu/image_transport_surface_fbo_mac.h',
|
||||
'common/gpu/image_transport_surface_linux.cc',
|
||||
'common/gpu/image_transport_surface_mac.mm',
|
||||
'common/gpu/image_transport_surface_fbo_mac.mm',
|
||||
'common/gpu/image_transport_surface_iosurface_mac.cc',
|
||||
'common/gpu/image_transport_surface_iosurface_mac.h',
|
||||
'common/gpu/image_transport_surface_linux.cc',
|
||||
'common/gpu/image_transport_surface_mac.mm',
|
||||
'common/gpu/image_transport_surface_win.cc',
|
||||
'common/gpu/media/gpu_video_decode_accelerator.cc',
|
||||
'common/gpu/media/gpu_video_decode_accelerator.h',
|
||||
@ -480,6 +481,7 @@
|
||||
'common/savable_url_schemes.cc',
|
||||
'common/savable_url_schemes.h',
|
||||
'common/screen_orientation_messages.h',
|
||||
'common/send_zygote_child_ping_linux.cc',
|
||||
'common/service_worker/embedded_worker_messages.h',
|
||||
'common/service_worker/service_worker_messages.h',
|
||||
'common/service_worker/service_worker_status_code.cc',
|
||||
|
41
content/content_nacl_nonsfi.gyp
Normal file
41
content/content_nacl_nonsfi.gyp
Normal file
@ -0,0 +1,41 @@
|
||||
# Copyright 2014 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.
|
||||
|
||||
{
|
||||
'variables': {
|
||||
'chromium_code': 1,
|
||||
},
|
||||
'includes': [
|
||||
'../build/common_untrusted.gypi',
|
||||
],
|
||||
'conditions': [
|
||||
['disable_nacl==0 and disable_nacl_untrusted==0', {
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'content_common_nacl_nonsfi',
|
||||
'type': 'none',
|
||||
'variables': {
|
||||
'nacl_untrusted_build': 1,
|
||||
'nlib_target': 'libcontent_common_nacl_nonsfi.a',
|
||||
'build_glibc': 0,
|
||||
'build_newlib': 0,
|
||||
'build_irt': 0,
|
||||
'build_pnacl_newlib': 0,
|
||||
'build_nonsfi_helper': 1,
|
||||
|
||||
'sources': [
|
||||
'common/send_zygote_child_ping_linux.cc',
|
||||
'public/common/send_zygote_child_ping_linux.h',
|
||||
# TODO(hidehiko): Add sandbox code.
|
||||
],
|
||||
},
|
||||
'dependencies': [
|
||||
'../base/base_nacl.gyp:base_nacl_nonsfi',
|
||||
'../native_client/tools.gyp:prep_toolchain',
|
||||
],
|
||||
},
|
||||
],
|
||||
}],
|
||||
],
|
||||
}
|
@ -50,10 +50,6 @@ CONTENT_EXPORT int MatchFontWithFallback(
|
||||
CONTENT_EXPORT bool GetFontTable(int fd, uint32_t table_tag, off_t offset,
|
||||
uint8_t* output, size_t* output_length);
|
||||
|
||||
// Sends a zygote child "ping" message to browser process via socket |fd|.
|
||||
// Returns true on success.
|
||||
CONTENT_EXPORT bool SendZygoteChildPing(int fd);
|
||||
|
||||
}; // namespace content
|
||||
|
||||
#endif // CONTENT_PUBLIC_COMMON_CHILD_PROCESS_SANDBOX_SUPPORT_LINUX_H_
|
||||
|
18
content/public/common/send_zygote_child_ping_linux.h
Normal file
18
content/public/common/send_zygote_child_ping_linux.h
Normal file
@ -0,0 +1,18 @@
|
||||
// Copyright 2014 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.
|
||||
|
||||
#ifndef CONTENT_PUBLIC_COMMON_SEND_ZYGOTE_CHILD_PING_LINUX_H_
|
||||
#define CONTENT_PUBLIC_COMMON_SEND_ZYGOTE_CHILD_PING_LINUX_H_
|
||||
|
||||
#include "content/common/content_export.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
// Sends a zygote child "ping" message to browser process via socket |fd|.
|
||||
// Returns true on success.
|
||||
CONTENT_EXPORT bool SendZygoteChildPing(int fd);
|
||||
|
||||
} // namespace content
|
||||
|
||||
#endif // CONTENT_PUBLIC_COMMON_SEND_ZYGOTE_CHILD_PING_LINUX_H_
|
@ -29,6 +29,7 @@
|
||||
#include "content/public/common/content_descriptors.h"
|
||||
#include "content/public/common/result_codes.h"
|
||||
#include "content/public/common/sandbox_linux.h"
|
||||
#include "content/public/common/send_zygote_child_ping_linux.h"
|
||||
#include "content/public/common/zygote_fork_delegate_linux.h"
|
||||
#include "ipc/ipc_channel.h"
|
||||
#include "ipc/ipc_switches.h"
|
||||
|
Reference in New Issue
Block a user