blob: b1c56f631c312d8a0bb14c521081495133096eb9 [file] [log] [blame]
// Copyright (c) 2010 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.
#pragma once
#include "base/native_library.h"
#include "content/common/main_function_params.h"
typedef bool (*RunNaClLoaderTests)(void);
const char kNaClLoaderTestCall[] = "RunNaClLoaderTests";
class NaClMainPlatformDelegate {
explicit NaClMainPlatformDelegate(const MainFunctionParams& parameters);
// Called first thing and last thing in the process' lifecycle, i.e. before
// the sandbox is enabled.
void PlatformInitialize();
void PlatformUninitialize();
// Gives us an opportunity to initialize state used for tests before enabling
// the sandbox.
void InitSandboxTests(bool no_sandbox);
// Initiate Lockdown.
void EnableSandbox();
// Runs the sandbox tests for the NaCl Loader, if tests supplied.
// Cannot run again, after this (resources freed).
// Returns false if the tests are supplied and fail.
bool RunSandboxTests();
const MainFunctionParams& parameters_;
base::NativeLibrary sandbox_test_module_;