Bug 1909613 - Enable <details name=''> everywhere, r=emilio
[gecko.git] / netwerk / base / nsRequestObserverProxy.h
blobe1ccec0c4ce2e26d56528de4500f86805a7d3eb8
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsRequestObserverProxy_h__
7 #define nsRequestObserverProxy_h__
9 #include "nsIRequestObserver.h"
10 #include "nsIRequestObserverProxy.h"
11 #include "nsIRequest.h"
12 #include "nsThreadUtils.h"
13 #include "nsCOMPtr.h"
14 #include "nsProxyRelease.h"
16 namespace mozilla {
17 namespace net {
19 class nsARequestObserverEvent;
21 class nsRequestObserverProxy final : public nsIRequestObserverProxy {
22 ~nsRequestObserverProxy() = default;
24 public:
25 NS_DECL_THREADSAFE_ISUPPORTS
26 NS_DECL_NSIREQUESTOBSERVER
27 NS_DECL_NSIREQUESTOBSERVERPROXY
29 nsRequestObserverProxy() = default;
31 nsIRequestObserver* Observer() { return mObserver; }
33 nsresult FireEvent(nsARequestObserverEvent*);
35 protected:
36 nsMainThreadPtrHandle<nsIRequestObserver> mObserver;
37 nsMainThreadPtrHandle<nsISupports> mContext;
39 friend class nsOnStartRequestEvent;
40 friend class nsOnStopRequestEvent;
43 class nsARequestObserverEvent : public Runnable {
44 public:
45 explicit nsARequestObserverEvent(nsIRequest*);
47 protected:
48 virtual ~nsARequestObserverEvent() = default;
50 nsCOMPtr<nsIRequest> mRequest;
53 } // namespace net
54 } // namespace mozilla
56 #endif // nsRequestObserverProxy_h__