|
板凳
楼主 |
发表于 2016-7-25 13:45:17
|
只看该作者
- nsImapIncomingServer
- nsCOMArray<nsIImapUrl> m_urlQueue; 任务队列
- nsCOMArray<nsIImapProtocol> m_connectionCache; //imap连接线程队列
- GetImapConnection(nsIImapUrl * aImapUrl,..)
- {
- 1.从缓存中取可用连接
- connection = m_connectionCache[i];
- 2.没有可用连接,且连接数少于最大连接数,则创建新连接
- CreateProtocolInstance(nsIImapProtocol ** aImapConnection)
- 3.如果找不到可用连接,则放到队列中
- m_urlQueue.AppendObject(aImapUrl); //GetImapConnectionAndLoadUrl
- }
- 获取连接以后加载执行任务
- rv = aProtocol->LoadImapUrl(mailnewsurl, aConsumer);
- nsImapIncomingServer调用nsIImapService为了构建nsIImapUrl,然后再转回来调用nsImapIncomingServer,然后是nsImapProtocol
- ---------相关难点-----
- 多个imap线程连接之间,如何进行分开不重复执行相关任务,
- imap线程内部永远不会自动产生新任务?
- 不需要时移除掉此连接 imapServer->RemoveConnection(this);
- 可自动获取上层的任务
- rv = m_imapServerSink->LoadNextQueuedUrl(this, &anotherUrlRun);
- LoadImapUrl的调用
- nsImapIncomingServer下
- GetImapConnectionAndLoadUrl ---- nsImapMockChannel::ReadFromImapConnection OnCacheEntryAvailable AsyncOpen
- RetryUrl
- LoadNextQueuedUrl
- 是否可共用连接的判断 :
- in selected state can only run url with matching foldername //选择状态下只能是同一邮件夹下的相关任务可以共用
- //头收完后,邮件体是如何触发收取的?
- HeaderFetchCompleted()
- nsImapMailFolder::ParseMsgHdrs(nsIImapProtocol *aProtocol, nsIImapHeaderXferInfo *aHdrXferInfo){
- }
- !nsImapProtocol::LoadImapUrl(nsIURI * aURL, nsISupports * aConsumer) 行 2205 C++
- > !nsImapIncomingServer::LoadNextQueuedUrl(nsIImapProtocol * aProtocol, bool * aResult) 行 575 C++
- !`anonymous namespace'::SyncRunnable2<nsIImapMailFolderSink,unsigned int,nsIImapUrl *>::Run() 行 147 C++ ---界面点击触发,不点不触发?
- > !nsImapProtocol::LoadImapUrl(nsIURI * aURL, nsISupports * aConsumer) 行 2205 C++
- !nsImapIncomingServer::LoadNextQueuedUrl(nsIImapProtocol * aProtocol, bool * aResult) 行 575 C++
- !`anonymous namespace'::SyncRunnable2<nsIImapMailFolderSink,unsigned int,nsIImapUrl *>::Run() 行 147 C++ //nsImapMsgDownloadForOffline = 268435506,
- nsImapMsgDownloadForOffline 邮件头下载完后,调用自动同步 HeaderFetchCompleted -> nsAutoSyncState
- !nsImapService::DownloadMessagesForOffline(const nsACString & messageIds, nsIMsgFolder * aFolder, nsIUrlListener * aUrlListener, nsIMsgWindow * aMsgWindow) 行 3255 C++
- !nsAutoSyncState::DownloadMessagesForOffline(nsIArray * aMessagesList) 行 651 C++
- !nsAutoSyncManager::DownloadMessagesForOffline(nsIAutoSyncState * aAutoSyncStateObj, unsigned int aSizeLimit) 行 982 C++
- !nsAutoSyncManager::OnDownloadQChanged(nsIAutoSyncState * aAutoSyncStateObj) 行 1206 C++
- !nsAutoSyncState::PlaceIntoDownloadQ(const nsTArray<unsigned int> & aMsgKeyList) 行 154 C++
- > !nsImapMailFolder::HeaderFetchCompleted(nsIImapProtocol * aProtocol) 行 5901 C++
复制代码 |
|