start work on pseudo interruption, not hooked up yet

git-svn-id: svn://10.0.0.236/trunk@47862 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bienvenu%netscape.com
1999-09-16 23:30:46 +00:00
parent 9878b12e09
commit 0c738d2b59
5 changed files with 46 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ interface nsIImapUrl;
interface nsIEventQueue;
interface nsIImapProtocol;
interface nsISupportsArray;
interface nsIMsgFolder;
[scriptable, uuid(3d2e7e38-f9d8-11d2-af8f-001083002da8)]
interface nsIImapIncomingServer : nsISupports {
@@ -53,4 +54,5 @@ interface nsIImapIncomingServer : nsISupports {
void RemoveConnection(in nsIImapProtocol aImapConnection);
void ResetNamespaceReferences();
void PseudoInterruptMsgLoad(in nsIMsgFolder folder, out boolean interrupted);
};

View File

@@ -38,6 +38,7 @@ class nsIURI;
class nsIImapUrl;
class nsIImapHostSessionList;
class nsIWebShell;
class nsIMsgFolder;
class nsIImapProtocol : public nsIStreamListener
{
@@ -98,6 +99,8 @@ public:
NS_IMETHOD TellThreadToDie(PRBool isSafeToDie) = 0;
// Get last active time stamp
NS_IMETHOD GetLastActiveTimeStamp(PRTime *aTimeStamp) = 0;
NS_IMETHOD PseudoInterruptMsgLoad(nsIMsgFolder *aFolder, PRBool *interrupted) = 0;
};
#endif /* nsIImapProtocol_h___ */

View File

@@ -1305,6 +1305,37 @@ NS_IMETHODIMP nsImapIncomingServer::CommitNamespaces()
}
NS_IMETHODIMP nsImapIncomingServer::PseudoInterruptMsgLoad(nsIMsgFolder *aFolder, PRBool *interrupted)
{
nsresult rv = NS_OK;
PRBool canRunUrl = PR_FALSE;
PRBool hasToWait = PR_FALSE;
nsCOMPtr<nsIImapProtocol> connection;
nsCOMPtr<nsIImapProtocol> freeConnection;
PRBool isBusy = PR_FALSE;
PRBool isInboxConnection = PR_FALSE;
PR_CEnterMonitor(this);
// iterate through the connection cache for a connection that is loading
// a message in this folder and should be pseudo-interrupted.
PRUint32 cnt;
nsCOMPtr<nsISupports> aSupport;
rv = m_connectionCache->Count(&cnt);
if (NS_FAILED(rv)) return rv;
for (PRUint32 i = 0; i < cnt && !canRunUrl && !hasToWait; i++)
{
aSupport = getter_AddRefs(m_connectionCache->ElementAt(i));
connection = do_QueryInterface(aSupport);
if (connection)
rv = connection->PseudoInterruptMsgLoad(aFolder, interrupted);
}
PR_CExitMonitor(this);
return rv;
}
NS_IMETHODIMP nsImapIncomingServer::ResetNamespaceReferences()
{
return NS_ERROR_NOT_IMPLEMENTED;

View File

@@ -780,6 +780,14 @@ nsImapProtocol::GetLastActiveTimeStamp(PRTime* aTimeStamp)
return NS_OK;
}
NS_IMETHODIMP
nsImapProtocol::PseudoInterruptMsgLoad(nsIMsgFolder *aFolder, PRBool *interrupted)
{
// this should check if the protocol instance is currently running a msg fetch
// url for the passed folder, and if so, pseudo interrupt it.
return NS_ERROR_NOT_IMPLEMENTED;
}
void
nsImapProtocol::ImapThreadMainLoop()
{

View File

@@ -111,6 +111,8 @@ public:
NS_IMETHOD TellThreadToDie(PRBool isSafeToClose);
// Get last active time stamp
NS_IMETHOD GetLastActiveTimeStamp(PRTime *aTimeStamp);
NS_IMETHOD PseudoInterruptMsgLoad(nsIMsgFolder *aFolder, PRBool *interrupted);
////////////////////////////////////////////////////////////////////////////////////////
// End of nsIStreamListenerSupport
////////////////////////////////////////////////////////////////////////////////////////