tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

SandboxTest.h (1455B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
      6 #ifndef mozilla_SandboxTest_h
      7 #define mozilla_SandboxTest_h
      8 
      9 #include "SandboxTestingParent.h"
     10 #include "mozISandboxTest.h"
     11 #include "mozilla/GfxMessageUtils.h"
     12 #include "mozilla/MozPromise.h"
     13 #include "GMPService.h"
     14 #include "nsTArray.h"
     15 
     16 #if !defined(MOZ_DEBUG) || !defined(ENABLE_TESTS)
     17 #  error "This file should not be used outside of debug with tests"
     18 #endif
     19 
     20 namespace mozilla {
     21 
     22 class SandboxTest : public mozISandboxTest {
     23 public:
     24  NS_DECL_THREADSAFE_ISUPPORTS
     25  NS_DECL_MOZISANDBOXTEST
     26 
     27  SandboxTest() : mSandboxTestingParents{nullptr} {};
     28 
     29  // We allow nsresult to be rejected with values:
     30  //  - NS_ERROR_FAILURE in obvious case of error
     31  //  - NS_OK in case of success to complete the code but missing process (GPU)
     32  using ProcessPromise =
     33      MozPromise<RefPtr<SandboxTestingParent>, nsresult, true>;
     34 
     35 private:
     36  virtual ~SandboxTest() = default;
     37  nsTArray<RefPtr<SandboxTestingParent>> mSandboxTestingParents;
     38  RefPtr<gmp::GMPContentParentCloseBlocker> mGMPContentParentWrapper;
     39 #if defined(XP_WIN)
     40  bool mChromeDirExisted = false;
     41 #endif
     42 };
     43 
     44 }  // namespace mozilla
     45 #endif  // mozilla_SandboxTest_h