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_net_ClassifierDummyChannelChild_h 8 #define mozilla_net_ClassifierDummyChannelChild_h 9 10 #include "mozilla/net/PClassifierDummyChannelChild.h" 11 #include "nsCOMPtr.h" 12 13 #include <functional> 14 15 class nsIHttpChannel; 16 class nsIURI; 17 18 namespace mozilla { 19 namespace net { 20 21 class ClassifierDummyChannelChild final : public PClassifierDummyChannelChild { 22 friend class PClassifierDummyChannelChild; 23 24 public: 25 static bool Create(nsIHttpChannel* aChannel, nsIURI* aURI, 26 const std::function<void(bool)>& aCallback); 27 28 // Used by PNeckoChild only! 29 ClassifierDummyChannelChild() = default; 30 ~ClassifierDummyChannelChild() = default; 31 32 private: 33 void Initialize(nsIHttpChannel* aChannel, nsIURI* aURI, bool aIsThirdParty, 34 const std::function<void(bool)>& aCallback); 35 36 mozilla::ipc::IPCResult Recv__delete__(const uint32_t& aClassificationFlags); 37 38 nsCOMPtr<nsIHttpChannel> mChannel; 39 nsCOMPtr<nsIURI> mURI; 40 std::function<void(bool)> mCallback; 41 bool mIsThirdParty{false}; 42 }; 43 44 } // namespace net 45 } // namespace mozilla 46 47 #endif // mozilla_net_ClassifierDummyChannelChild_h 48