Skip to content

Commit

Permalink
Bug 814723 - Don't warn about missing 'browser.newtab.url' in nsDocSh…
Browse files Browse the repository at this point in the history
…ell. r=jlebar

The preference key 'browser.newtab.url' is only supported for the browser,
and undefined on all other targets; such as mobile or b2g. For those targets
the function 'nsDocShell::ShouldAddToSessionHistory' warns about the missing
key.

This patch silences this warning by making Gecko return a default value of
'true' if the key is not present in the preferences.
  • Loading branch information
tdz committed Nov 27, 2012
1 parent ffca6c1 commit 6674dad
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10316,10 +10316,13 @@ nsDocShell::ShouldAddToSessionHistory(nsIURI * aURI)
}
}

rv = aURI->GetSpec(buf);
NS_ENSURE_SUCCESS(rv, true);

rv = Preferences::GetDefaultCString("browser.newtab.url", &pref);

if (NS_FAILED(rv)) {
return true;
}

rv = aURI->GetSpec(buf);
NS_ENSURE_SUCCESS(rv, true);

return !buf.Equals(pref);
Expand Down

0 comments on commit 6674dad

Please sign in to comment.