#include "chrome/browser/extensions/api/messaging/native_process_launcher.h"
#include <stdint.h>
#include <memory>
#include <utility>
#include "base/functional/callback.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/messaging/launch_context.h"
#include "net/base/file_stream.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_WIN)
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "extensions/common/extension_features.h"
#include "ui/views/win/hwnd_util.h"
#endif
namespace extensions {
namespace {
class NativeProcessLauncherImpl : public NativeProcessLauncher { … };
NativeProcessLauncherImpl::NativeProcessLauncherImpl(
bool allow_user_level_hosts,
bool require_native_initiated_connections,
bool native_hosts_executables_launch_directly,
intptr_t window_handle,
const base::FilePath& profile_directory,
const std::string& connect_id,
const std::string& error_arg)
: … { … }
void NativeProcessLauncherImpl::Launch(const GURL& origin,
const std::string& native_host_name,
LaunchedCallback callback) const { … }
void NativeProcessLauncherImpl::OnComplete(
LaunchedCallback callback,
LaunchResult result,
base::Process process,
base::PlatformFile read_file,
std::unique_ptr<net::FileStream> read_stream,
std::unique_ptr<net::FileStream> write_stream) const { … }
}
std::unique_ptr<NativeProcessLauncher> NativeProcessLauncher::CreateDefault(
bool allow_user_level_hosts,
gfx::NativeView native_view,
const base::FilePath& profile_directory,
bool require_native_initiated_connections,
const std::string& connect_id,
const std::string& error_arg,
Profile* profile) { … }
}