browser: emit did-fail-load for invalid url

This commit is contained in:
Robo 2016-02-11 08:24:50 +05:30
parent 027b5345f8
commit 5a8bebc2f8
2 changed files with 21 additions and 4 deletions

View file

@ -710,6 +710,14 @@ bool WebContents::Equal(const WebContents* web_contents) const {
}
void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
if (!url.is_valid()) {
Emit("did-fail-load",
static_cast<int>(net::ERR_INVALID_URL),
net::ErrorToShortString(net::ERR_INVALID_URL),
url.possibly_invalid_spec());
return;
}
content::NavigationController::LoadURLParams params(url);
GURL http_referrer;