2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-04-10 09:43:26 +04:00
|
|
|
|
|
|
|
#ifndef nsRequestObserverProxy_h__
|
|
|
|
#define nsRequestObserverProxy_h__
|
|
|
|
|
|
|
|
#include "nsIRequestObserver.h"
|
|
|
|
#include "nsIRequestObserverProxy.h"
|
|
|
|
#include "nsIRequest.h"
|
2006-05-10 21:30:15 +04:00
|
|
|
#include "nsThreadUtils.h"
|
2001-04-10 09:43:26 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2013-03-19 20:04:57 +04:00
|
|
|
#include "nsProxyRelease.h"
|
2001-04-10 09:43:26 +04:00
|
|
|
|
2016-05-19 05:02:57 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2001-04-10 09:43:26 +04:00
|
|
|
class nsARequestObserverEvent;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsRequestObserverProxy final : public nsIRequestObserverProxy {
|
2018-04-30 19:46:04 +03:00
|
|
|
~nsRequestObserverProxy() = default;
|
2014-06-24 20:36:44 +04:00
|
|
|
|
2001-04-10 09:43:26 +04:00
|
|
|
public:
|
2013-07-19 06:24:13 +04:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2001-04-10 09:43:26 +04:00
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
|
|
|
NS_DECL_NSIREQUESTOBSERVERPROXY
|
|
|
|
|
2018-04-30 19:46:04 +03:00
|
|
|
nsRequestObserverProxy() = default;
|
2001-04-10 09:43:26 +04:00
|
|
|
|
|
|
|
nsIRequestObserver *Observer() { return mObserver; }
|
|
|
|
|
|
|
|
nsresult FireEvent(nsARequestObserverEvent *);
|
|
|
|
|
|
|
|
protected:
|
2013-03-19 20:04:57 +04:00
|
|
|
nsMainThreadPtrHandle<nsIRequestObserver> mObserver;
|
|
|
|
nsMainThreadPtrHandle<nsISupports> mContext;
|
2001-04-10 09:43:26 +04:00
|
|
|
|
|
|
|
friend class nsOnStartRequestEvent;
|
|
|
|
friend class nsOnStopRequestEvent;
|
|
|
|
};
|
|
|
|
|
2016-05-19 05:02:57 +03:00
|
|
|
class nsARequestObserverEvent : public Runnable {
|
2001-04-10 09:43:26 +04:00
|
|
|
public:
|
2014-08-05 17:20:24 +04:00
|
|
|
explicit nsARequestObserverEvent(nsIRequest *);
|
2001-04-10 09:43:26 +04:00
|
|
|
|
|
|
|
protected:
|
2018-04-30 19:46:04 +03:00
|
|
|
virtual ~nsARequestObserverEvent() = default;
|
2001-04-10 09:43:26 +04:00
|
|
|
|
|
|
|
nsCOMPtr<nsIRequest> mRequest;
|
|
|
|
};
|
|
|
|
|
2016-05-19 05:02:57 +03:00
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2001-04-10 09:43:26 +04:00
|
|
|
#endif // nsRequestObserverProxy_h__
|