mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
win: Add bootstrap[c].exe for sandbox integration (see #3824)
Replace cef_sandbox.lib usage with bootstrap executables. See the SandboxSetup Wiki page for details.
This commit is contained in:
51
libcef_dll/bootstrap/bootstrap_util_win.h
Normal file
51
libcef_dll/bootstrap/bootstrap_util_win.h
Normal file
@ -0,0 +1,51 @@
|
||||
// Copyright (c) 2025 The Chromium Embedded Framework 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 CEF_LIBCEF_DLL_BOOTSTRAP_BOOTSTRAP_UTIL_WIN_H_
|
||||
#define CEF_LIBCEF_DLL_BOOTSTRAP_BOOTSTRAP_UTIL_WIN_H_
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
|
||||
namespace base {
|
||||
class CommandLine;
|
||||
}
|
||||
|
||||
namespace bootstrap_util {
|
||||
|
||||
namespace switches {
|
||||
inline constexpr char kModule[] = "module";
|
||||
}
|
||||
|
||||
// Returns true if |name| is one of the default bootstrap executable names.
|
||||
bool IsDefaultExeName(const std::wstring& name);
|
||||
|
||||
// Returns the command-line configured module value without validation.
|
||||
std::wstring GetModuleValue(const base::CommandLine& command_line);
|
||||
|
||||
// The following functions can only be called in unsandboxed processes.
|
||||
|
||||
// Returns the fully qualified file path for the executable module.
|
||||
base::FilePath GetExePath();
|
||||
|
||||
// Returns the fully qualified file path for |module|.
|
||||
base::FilePath GetModulePath(HMODULE module);
|
||||
|
||||
// Returns the command-line configured module value if it passes validation.
|
||||
std::wstring GetValidatedModuleValue(const base::CommandLine& command_line,
|
||||
const base::FilePath& exe_path);
|
||||
|
||||
// Returns the default module name (executable name without extension).
|
||||
std::wstring GetDefaultModuleValue(const base::FilePath& exe_path);
|
||||
|
||||
// Returns true if loading |module| is allowed.
|
||||
bool IsModulePathAllowed(HMODULE module, const base::FilePath& exe_path);
|
||||
|
||||
} // namespace bootstrap_util
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_BOOTSTRAP_BOOTSTRAP_UTIL_WIN_H_
|
Reference in New Issue
Block a user