The OverLink handler no longer caches the current over and target link to ensure we aren't called for the same link more than once. The lower level is assuring we aren't execpt in on case where a popup is up and then you move over links. This is a small case. Since string copies were actually showing up on some profiles I'm removing this caching of the string for some small amount of performance and bloat benefit as well as code cleanup.

This commit is contained in:
tbogard%aol.net 2000-03-31 02:47:04 +00:00
Родитель c4e54d4889
Коммит 3d1c2bc802
2 изменённых файлов: 8 добавлений и 48 удалений

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

@ -379,8 +379,6 @@ protected:
nsISessionHistory * mSHist;
nsRect mBounds;
nsString mOverURL;
nsString mOverTarget;
PRPackedBool mIsInSHist;
PRPackedBool mFailedToLoadHistoryService;
@ -2229,29 +2227,11 @@ nsWebShell::OnOverLink(nsIContent* aContent,
const PRUnichar* aURLSpec,
const PRUnichar* aTargetSpec)
{
if (!mOverURL.Equals(aURLSpec) || !mOverTarget.Equals(aTargetSpec)) {
#ifdef NOISY_LINKS
fputs("Was '", stdout);
fputs(mOverURL, stdout);
fputs("' '", stdout);
fputs(mOverTarget, stdout);
fputs("'\n", stdout);
fputs("Over link '", stdout);
fputs(aURLSpec, stdout);
fputs("' '", stdout);
fputs(aTargetSpec, stdout);
fputs("'\n", stdout);
#endif /* NS_DEBUG */
mOverURL = aURLSpec;
mOverTarget = aTargetSpec;
nsCOMPtr<nsIWebBrowserChrome> browserChrome(do_GetInterface(mTreeOwner));
if(browserChrome)
browserChrome->SetOverLink(aURLSpec);
}
return NS_OK;
}

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

@ -379,8 +379,6 @@ protected:
nsISessionHistory * mSHist;
nsRect mBounds;
nsString mOverURL;
nsString mOverTarget;
PRPackedBool mIsInSHist;
PRPackedBool mFailedToLoadHistoryService;
@ -2229,29 +2227,11 @@ nsWebShell::OnOverLink(nsIContent* aContent,
const PRUnichar* aURLSpec,
const PRUnichar* aTargetSpec)
{
if (!mOverURL.Equals(aURLSpec) || !mOverTarget.Equals(aTargetSpec)) {
#ifdef NOISY_LINKS
fputs("Was '", stdout);
fputs(mOverURL, stdout);
fputs("' '", stdout);
fputs(mOverTarget, stdout);
fputs("'\n", stdout);
fputs("Over link '", stdout);
fputs(aURLSpec, stdout);
fputs("' '", stdout);
fputs(aTargetSpec, stdout);
fputs("'\n", stdout);
#endif /* NS_DEBUG */
mOverURL = aURLSpec;
mOverTarget = aTargetSpec;
nsCOMPtr<nsIWebBrowserChrome> browserChrome(do_GetInterface(mTreeOwner));
if(browserChrome)
browserChrome->SetOverLink(aURLSpec);
}
return NS_OK;
}