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

Supply Sharing sandbox from service_sandbox_type.h

Prelude to removal of WithSandboxType API. See linked bug for
rationale.  Does not change behavior.

Bug: 1065087
Change-Id: Idf559fdb44076b11219f17f233c81ae6966fe2aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2203140
Commit-Queue: Alex Gough <ajgo@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770337}
parent e44391bc
......@@ -19,6 +19,7 @@ namespace mojom {
class RemovableStorageWriter;
} // namespace mojom
} // namespace chrome
template <>
inline content::SandboxType
content::GetServiceSandboxType<chrome::mojom::RemovableStorageWriter>() {
......@@ -26,7 +27,7 @@ content::GetServiceSandboxType<chrome::mojom::RemovableStorageWriter>() {
return SandboxType::kNoSandboxAndElevatedPrivileges;
#else
return SandboxType::kNoSandbox;
#endif
#endif // !defined(OS_WIN)
}
// chrome::mojom::UtilWin
......@@ -36,12 +37,13 @@ namespace mojom {
class UtilWin;
}
} // namespace chrome
template <>
inline content::SandboxType
content::GetServiceSandboxType<chrome::mojom::UtilWin>() {
return content::SandboxType::kNoSandbox;
}
#endif
#endif // defined(OS_WIN)
// chrome::mojom::ProfileImport
namespace chrome {
......@@ -49,6 +51,7 @@ namespace mojom {
class ProfileImport;
}
} // namespace chrome
template <>
inline content::SandboxType
content::GetServiceSandboxType<chrome::mojom::ProfileImport>() {
......@@ -62,6 +65,7 @@ namespace mojom {
class PrintingService;
}
} // namespace printing
template <>
inline content::SandboxType
content::GetServiceSandboxType<printing::mojom::PrintingService>() {
......@@ -76,6 +80,7 @@ namespace mojom {
class ProxyResolverFactory;
}
} // namespace proxy_resolver
template <>
inline content::SandboxType
content::GetServiceSandboxType<proxy_resolver::mojom::ProxyResolverFactory>() {
......@@ -90,6 +95,7 @@ namespace mojom {
class Quarantine;
}
} // namespace quarantine
template <>
inline content::SandboxType
content::GetServiceSandboxType<quarantine::mojom::Quarantine>() {
......@@ -97,4 +103,19 @@ content::GetServiceSandboxType<quarantine::mojom::Quarantine>() {
}
#endif // defined(OS_WIN)
// sharing::mojom::Sharing
#if !defined(OS_MACOSX)
namespace sharing {
namespace mojom {
class Sharing;
}
} // namespace sharing
template <>
inline content::SandboxType
content::GetServiceSandboxType<sharing::mojom::Sharing>() {
return content::SandboxType::kSharingService;
}
#endif // !defined(OS_MACOSX)
#endif // CHROME_BROWSER_SERVICE_SANDBOX_TYPE_H_
......@@ -4,7 +4,7 @@
#include "chrome/browser/sharing/webrtc/sharing_mojo_service.h"
#include "build/build_config.h"
#include "chrome/browser/service_sandbox_type.h"
#include "content/public/browser/service_process_host.h"
namespace sharing {
......@@ -14,9 +14,6 @@ mojo::PendingRemote<mojom::Sharing> LaunchSharing() {
content::ServiceProcessHost::Launch<mojom::Sharing>(
remote.InitWithNewPipeAndPassReceiver(),
content::ServiceProcessHost::Options()
#if !defined(OS_MACOSX)
.WithSandboxType(service_manager::SandboxType::kSharingService)
#endif
.WithDisplayName("Sharing Service")
.Pass());
return remote;
......
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