Revert 168224 - Update V8 to version 3.15.4.
[chromium-blink-merge.git] / chrome / nacl / nacl_main_platform_delegate.h
bloba2d019eb600083f0e4e3d7252273f5e3a3e2b082
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_NACL_NACL_MAIN_PLATFORM_DELEGATE_H_
6 #define CHROME_NACL_NACL_MAIN_PLATFORM_DELEGATE_H_
8 #include "base/native_library.h"
9 #include "content/public/common/main_function_params.h"
11 typedef bool (*RunNaClLoaderTests)(void);
12 const char kNaClLoaderTestCall[] = "RunNaClLoaderTests";
14 class NaClMainPlatformDelegate {
15 public:
16 explicit NaClMainPlatformDelegate(
17 const content::MainFunctionParams& parameters);
18 ~NaClMainPlatformDelegate();
20 // Called first thing and last thing in the process' lifecycle, i.e. before
21 // the sandbox is enabled.
22 void PlatformInitialize();
23 void PlatformUninitialize();
25 // Gives us an opportunity to initialize state used for tests before enabling
26 // the sandbox.
27 void InitSandboxTests(bool no_sandbox);
29 // Initiate Lockdown.
30 void EnableSandbox();
32 // Runs the sandbox tests for the NaCl Loader, if tests supplied.
33 // Cannot run again, after this (resources freed).
34 // Returns false if the tests are supplied and fail.
35 bool RunSandboxTests();
37 private:
38 const content::MainFunctionParams& parameters_;
39 base::NativeLibrary sandbox_test_module_;
41 DISALLOW_COPY_AND_ASSIGN(NaClMainPlatformDelegate);
44 #endif // CHROME_NACL_NACL_MAIN_PLATFORM_DELEGATE_H_