JSValidatorParent.h (1214B)
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 http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_dom_JSValidatorParent 8 #define mozilla_dom_JSValidatorParent 9 10 #include "mozilla/MozPromise.h" 11 #include "mozilla/ProcInfo.h" 12 #include "mozilla/dom/PJSValidatorParent.h" 13 14 namespace mozilla::ipc { 15 class UtilityProcessParent; 16 class IProtocol; 17 } // namespace mozilla::ipc 18 19 namespace mozilla::dom { 20 21 class JSValidatorParent final : public PJSValidatorParent { 22 public: 23 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(JSValidatorParent, override); 24 25 static already_AddRefed<JSValidatorParent> Create(); 26 27 void IsOpaqueResponseAllowed( 28 const std::function<void(Maybe<mozilla::ipc::Shmem>, ValidatorResult)>& 29 aCallback); 30 31 void OnDataAvailable(const nsACString& aData); 32 33 void OnStopRequest(nsresult aResult, nsIRequest& aRequest); 34 35 private: 36 virtual ~JSValidatorParent() = default; 37 }; 38 } // namespace mozilla::dom 39 40 #endif // defined(mozilla_dom_JSValidatorParent)