* Small cleanups.
* Make sure that the BWebView for which a notification is received still exists. This affected only the title changed notification, for which this was already checked, and the icon received notification, which could actually lead to a crash if the tab was closed before receiving the notification. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@522 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
committed by
Alexandre Deckner
parent
591220f9b2
commit
ed0c70c14d
@@ -1245,12 +1245,12 @@ BrowserWindow::MainDocumentError(const BString& failingURL,
|
||||
void
|
||||
BrowserWindow::TitleChanged(const BString& title, BWebView* view)
|
||||
{
|
||||
for (int32 i = 0; i < fTabManager->CountTabs(); i++) {
|
||||
if (fTabManager->ViewForTab(i) == view) {
|
||||
fTabManager->SetTabLabel(i, title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
int32 tabIndex = fTabManager->TabForView(view);
|
||||
if (tabIndex < 0)
|
||||
return;
|
||||
|
||||
fTabManager->SetTabLabel(tabIndex, title);
|
||||
|
||||
if (view != CurrentWebView())
|
||||
return;
|
||||
|
||||
@@ -1261,6 +1261,11 @@ BrowserWindow::TitleChanged(const BString& title, BWebView* view)
|
||||
void
|
||||
BrowserWindow::IconReceived(const BBitmap* icon, BWebView* view)
|
||||
{
|
||||
// The view may already be gone, since this notification arrives
|
||||
// asynchronously.
|
||||
if (!fTabManager->HasView(view))
|
||||
return;
|
||||
|
||||
_SetPageIcon(view, icon);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user