From 302bf1b523012e11b60425d6eee1221ebc2724eb Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 3 Nov 2019 00:17:46 -0400 Subject: Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1 --- mailnews/news/src/nsNntpMockChannel.h | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 mailnews/news/src/nsNntpMockChannel.h (limited to 'mailnews/news/src/nsNntpMockChannel.h') diff --git a/mailnews/news/src/nsNntpMockChannel.h b/mailnews/news/src/nsNntpMockChannel.h new file mode 100644 index 000000000..dc20185ec --- /dev/null +++ b/mailnews/news/src/nsNntpMockChannel.h @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#ifndef nsNntpMockChannel_h___ +#define nsNntpMockChannel_h___ + +#include "nsIChannel.h" +#include "nsIMsgWindow.h" + +#include "nsCOMPtr.h" +#include "nsStringGlue.h" + +class nsNNTPProtocol; + +class nsNntpMockChannel : public nsIChannel +{ +public: + NS_DECL_THREADSAFE_ISUPPORTS + NS_DECL_NSICHANNEL + NS_DECL_NSIREQUEST + + nsNntpMockChannel(nsIURI *aUri, nsIMsgWindow *aMsgWindow); + nsNntpMockChannel(nsIURI *aUri, nsIMsgWindow *aMsgWindow, + nsISupports *aConsumer); + + nsresult AttachNNTPConnection(nsNNTPProtocol &protocol); +protected: + virtual ~nsNntpMockChannel(); + + // The URL we will be running + nsCOMPtr m_url; + + // Variables for arguments to pass into the opening phase. + nsCOMPtr m_channelListener; + nsCOMPtr m_context; + nsCOMPtr m_msgWindow; + + // The state we're in + enum + { + CHANNEL_UNOPENED, //!< No one bothered to open this yet + CHANNEL_OPEN_WITH_LOAD, //!< We should open with LoadNewsUrl + CHANNEL_OPEN_WITH_ASYNC, //!< We should open with AsyncOpen + CHANNEL_CLOSED //!< We were closed and should not open + } m_channelState; + + // The protocol instance + nsNNTPProtocol *m_protocol; + + // Temporary variables for accessors before we get to the actual instance. + nsresult m_cancelStatus; + nsCOMPtr m_loadGroup; + nsCOMPtr m_loadInfo; + nsLoadFlags m_loadFlags; + + nsCOMPtr m_owner; + nsCOMPtr m_notificationCallbacks; + nsCString m_contentType; + nsCString m_contentCharset; + int64_t m_contentLength; +}; + +#endif // nsNntpMockChannel_h___ -- cgit v1.2.3