michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsRequestObserverProxy_h__ michael@0: #define nsRequestObserverProxy_h__ michael@0: michael@0: #include "nsIRequestObserver.h" michael@0: #include "nsIRequestObserverProxy.h" michael@0: #include "nsIRequest.h" michael@0: #include "nsThreadUtils.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsProxyRelease.h" michael@0: michael@0: class nsARequestObserverEvent; michael@0: michael@0: class nsRequestObserverProxy MOZ_FINAL : public nsIRequestObserverProxy michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSIREQUESTOBSERVER michael@0: NS_DECL_NSIREQUESTOBSERVERPROXY michael@0: michael@0: nsRequestObserverProxy() {} michael@0: michael@0: nsIRequestObserver *Observer() { return mObserver; } michael@0: michael@0: nsresult FireEvent(nsARequestObserverEvent *); michael@0: michael@0: protected: michael@0: nsMainThreadPtrHandle mObserver; michael@0: nsMainThreadPtrHandle mContext; michael@0: michael@0: friend class nsOnStartRequestEvent; michael@0: friend class nsOnStopRequestEvent; michael@0: }; michael@0: michael@0: class nsARequestObserverEvent : public nsRunnable michael@0: { michael@0: public: michael@0: nsARequestObserverEvent(nsIRequest *); michael@0: michael@0: protected: michael@0: virtual ~nsARequestObserverEvent() {} michael@0: michael@0: nsCOMPtr mRequest; michael@0: }; michael@0: michael@0: #endif // nsRequestObserverProxy_h__