Commit da02fb9b authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

Fuchsia: Moved SandboxPolicyFuchsia to service/service_manager/sandbox

This will allow to reuse the class in //webrunner when starting context
process.

Bug: 861853
Change-Id: I499850a7ba8df4b73e5f71b6a61568a5cfca1e6b
Reviewed-on: https://chromium-review.googlesource.com/c/1355764Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612494}
parent 4713ee49
...@@ -1938,6 +1938,7 @@ jumbo_source_set("browser") { ...@@ -1938,6 +1938,7 @@ jumbo_source_set("browser") {
"child_process_launcher_helper_fuchsia.cc", "child_process_launcher_helper_fuchsia.cc",
"memory/memory_monitor_fuchsia.cc", "memory/memory_monitor_fuchsia.cc",
] ]
deps += [ "//third_party/fuchsia-sdk/sdk:zx" ]
} else if (is_posix) { } else if (is_posix) {
sources += [ sources += [
"child_process_launcher_helper_posix.cc", "child_process_launcher_helper_posix.cc",
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#endif #endif
#if defined(OS_FUCHSIA) #if defined(OS_FUCHSIA)
#include "content/common/sandbox_policy_fuchsia.h" #include "services/service_manager/sandbox/fuchsia/sandbox_policy_fuchsia.h"
#endif #endif
#if BUILDFLAG(USE_ZYGOTE_HANDLE) #if BUILDFLAG(USE_ZYGOTE_HANDLE)
...@@ -247,7 +247,7 @@ class ChildProcessLauncherHelper : ...@@ -247,7 +247,7 @@ class ChildProcessLauncherHelper :
#endif #endif
#if defined(OS_FUCHSIA) #if defined(OS_FUCHSIA)
SandboxPolicyFuchsia sandbox_policy_; service_manager::SandboxPolicyFuchsia sandbox_policy_;
#endif #endif
}; };
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/process/launch.h" #include "base/process/launch.h"
#include "content/browser/child_process_launcher.h" #include "content/browser/child_process_launcher.h"
#include "content/common/sandbox_policy_fuchsia.h"
#include "content/public/browser/child_process_launcher_utils.h" #include "content/public/browser/child_process_launcher_utils.h"
#include "content/public/common/sandboxed_process_launcher_delegate.h" #include "content/public/common/sandboxed_process_launcher_delegate.h"
#include "services/service_manager/embedder/result_codes.h" #include "services/service_manager/embedder/result_codes.h"
......
...@@ -456,18 +456,8 @@ source_set("common") { ...@@ -456,18 +456,8 @@ source_set("common") {
} }
if (is_fuchsia) { if (is_fuchsia) {
sources += [ sources += [ "font_list_fuchsia.cc" ]
"font_list_fuchsia.cc", deps += [ "//third_party/fuchsia-sdk/sdk:fdio" ]
"sandbox_policy_fuchsia.cc",
"sandbox_policy_fuchsia.h",
]
deps += [
"//third_party/fuchsia-sdk/sdk:fdio",
"//third_party/fuchsia-sdk/sdk:fonts",
"//third_party/fuchsia-sdk/sdk:mediacodec",
"//third_party/fuchsia-sdk/sdk:scenic",
]
} }
} }
......
...@@ -98,6 +98,18 @@ component("sandbox") { ...@@ -98,6 +98,18 @@ component("sandbox") {
] ]
deps += [ "//sandbox/win:sandbox" ] deps += [ "//sandbox/win:sandbox" ]
} }
if (is_fuchsia) {
sources += [
"fuchsia/sandbox_policy_fuchsia.cc",
"fuchsia/sandbox_policy_fuchsia.h",
]
deps += [
"//third_party/fuchsia-sdk/sdk:fonts",
"//third_party/fuchsia-sdk/sdk:mediacodec",
"//third_party/fuchsia-sdk/sdk:scenic",
]
}
} }
buildflag_header("sanitizer_buildflags") { buildflag_header("sanitizer_buildflags") {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/common/sandbox_policy_fuchsia.h" #include "services/service_manager/sandbox/fuchsia/sandbox_policy_fuchsia.h"
#include <lib/fdio/spawn.h> #include <lib/fdio/spawn.h>
#include <stdio.h> #include <stdio.h>
...@@ -24,10 +24,9 @@ ...@@ -24,10 +24,9 @@
#include "base/process/launch.h" #include "base/process/launch.h"
#include "base/process/process.h" #include "base/process/process.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "content/public/common/content_switches.h"
#include "services/service_manager/sandbox/switches.h" #include "services/service_manager/sandbox/switches.h"
namespace content { namespace service_manager {
namespace { namespace {
constexpr const char* const kRendererServices[] = { constexpr const char* const kRendererServices[] = {
...@@ -123,4 +122,4 @@ void SandboxPolicyFuchsia::UpdateLaunchOptionsForSandbox( ...@@ -123,4 +122,4 @@ void SandboxPolicyFuchsia::UpdateLaunchOptionsForSandbox(
} }
} }
} // namespace content } // namespace service_manager
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_COMMON_SANDBOX_POLICY_FUCHSIA_H_ #ifndef SERVICES_SERVICE_MANAGER_SANDBOX_FUCHSIA_SANDBOX_POLICY_FUCHSIA_H_
#define CONTENT_COMMON_SANDBOX_POLICY_FUCHSIA_H_ #define SERVICES_SERVICE_MANAGER_SANDBOX_FUCHSIA_SANDBOX_POLICY_FUCHSIA_H_
#include <lib/zx/channel.h> #include <lib/zx/channel.h>
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "services/service_manager/sandbox/export.h"
#include "services/service_manager/sandbox/sandbox_type.h" #include "services/service_manager/sandbox/sandbox_type.h"
namespace base { namespace base {
...@@ -20,9 +21,9 @@ class FilteredServiceDirectory; ...@@ -20,9 +21,9 @@ class FilteredServiceDirectory;
} // namespace base } // namespace base
namespace content { namespace service_manager {
class SandboxPolicyFuchsia { class SERVICE_MANAGER_SANDBOX_EXPORT SandboxPolicyFuchsia {
public: public:
SandboxPolicyFuchsia(); SandboxPolicyFuchsia();
~SandboxPolicyFuchsia(); ~SandboxPolicyFuchsia();
...@@ -44,8 +45,10 @@ class SandboxPolicyFuchsia { ...@@ -44,8 +45,10 @@ class SandboxPolicyFuchsia {
std::unique_ptr<base::fuchsia::FilteredServiceDirectory> service_directory_; std::unique_ptr<base::fuchsia::FilteredServiceDirectory> service_directory_;
zx::channel service_directory_client_channel_; zx::channel service_directory_client_channel_;
scoped_refptr<base::SequencedTaskRunner> service_directory_task_runner_; scoped_refptr<base::SequencedTaskRunner> service_directory_task_runner_;
DISALLOW_COPY_AND_ASSIGN(SandboxPolicyFuchsia);
}; };
} // namespace content } // namespace service_manager
#endif // CONTENT_COMMON_SANDBOX_POLICY_FUCHSIA_H_ #endif // SERVICES_SERVICE_MANAGER_SANDBOX_FUCHSIA_SANDBOX_POLICY_FUCHSIA_H_
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