separate 64bit progress api from 32bit because of possible compiler bug

passing long long params between c++ and objc (bug 291406)
This commit is contained in:
pinkerton%aol.net 2005-04-23 19:20:41 +00:00
Родитель 9e785f6315
Коммит 0cbc19cb7f
3 изменённых файлов: 36 добавлений и 24 удалений

Просмотреть файл

@ -194,7 +194,8 @@ class nsISupportsArray;
// CHBrowserListener messages
- (void)onLoadingStarted;
- (void)onLoadingCompleted:(BOOL)succeeded;
- (void)onProgressChange:(long long)currentBytes outOf:(long long)maxBytes;
- (void)onProgressChange64:(long long)currentBytes outOf:(long long)maxBytes;
- (void)onProgressChange:(long)currentBytes outOf:(long)maxBytes;
- (void)onLocationChange:(NSString*)urlSpec;
- (void)onStatusChange:(NSString*)aMessage;
- (void)onSecurityStateChange:(unsigned long)newState;

Просмотреть файл

@ -460,12 +460,21 @@ static NSString* const kOfflineNotificationName = @"offlineModeChanged";
}
}
- (void)onProgressChange:(long long)currentBytes outOf:(long long)maxBytes
- (void)onProgressChange64:(long long)currentBytes outOf:(long long)maxBytes
{
if (maxBytes > 0)
{
mProgress = ((double)currentBytes / (double)maxBytes) * 100.0;
[mDelegate setLoadingProgress:mProgress];
[mDelegate setLoadingProgress:mProgress];
}
}
- (void)onProgressChange:(long)currentBytes outOf:(long)maxBytes
{
if (maxBytes > 0)
{
mProgress = ((double)currentBytes / (double)maxBytes) * 100.0;
[mDelegate setLoadingProgress:mProgress];
}
}

Просмотреть файл

@ -532,12 +532,29 @@ CHBrowserListener::GetSiteWindow(void * *aSiteWindow)
/* void onProgressChange64 (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long long aCurSelfProgress, in long long aMaxSelfProgress, in long long aCurTotalProgress, in long long aMaxTotalProgress); */
NS_IMETHODIMP
CHBrowserListener::OnProgressChange64(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt64 aCurSelfProgress,
PRInt64 aMaxSelfProgress,
PRInt64 aCurTotalProgress,
PRInt64 aMaxTotalProgress)
CHBrowserListener::OnProgressChange64(nsIWebProgress *aWebProgress, nsIRequest *aRequest,
PRInt64 aCurSelfProgress, PRInt64 aMaxSelfProgress,
PRInt64 aCurTotalProgress, PRInt64 aMaxTotalProgress)
{
//XXXPINK there appear to be a compiler bug here, the values passed to |-onProgressChange64:outOf:|
// are garbage even though they're ok here.
NSEnumerator* enumerator = [mListeners objectEnumerator];
id<CHBrowserListener> obj;
while ((obj = [enumerator nextObject]))
[obj onProgressChange64:aCurTotalProgress outOf:aMaxTotalProgress];
return NS_OK;
}
//
// Implementation of nsIWebProgressListener
//
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
NS_IMETHODIMP
CHBrowserListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest,
PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
NSEnumerator* enumerator = [mListeners objectEnumerator];
id<CHBrowserListener> obj;
@ -547,10 +564,6 @@ CHBrowserListener::OnProgressChange64(nsIWebProgress *aWebProgress,
return NS_OK;
}
//
// Implementation of nsIWebProgressListener
//
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in unsigned long aStatus); */
NS_IMETHODIMP
CHBrowserListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest,
@ -575,17 +588,6 @@ CHBrowserListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequ
return NS_OK;
}
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
NS_IMETHODIMP
CHBrowserListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest,
PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
return OnProgressChange64(aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress);
}
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP
CHBrowserListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest,