Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: content/browser/host_zoom_map_impl.cc

Issue 320863002: Don't assume WebContents has a LastCommittedEntry when setting zoom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/host_zoom_map_impl.cc
diff --git a/content/browser/host_zoom_map_impl.cc b/content/browser/host_zoom_map_impl.cc
index a0a68dad95a2c860e42b0bb9dc3f519882a6a8b2..634771a1089ef8a54fd7d79c56c19656fb07744f 100644
--- a/content/browser/host_zoom_map_impl.cc
+++ b/content/browser/host_zoom_map_impl.cc
@@ -250,9 +250,10 @@ void HostZoomMapImpl::SetZoomLevelForWebContents(
GURL url;
NavigationEntry* entry =
web_contents_impl.GetController().GetLastCommittedEntry();
- DCHECK(entry);
- url = entry->GetURL();
- SetZoomLevelForHost(net::GetHostOrSpecFromURL(url), level);
+ if (entry) {
Peter Kasting 2014/06/09 18:17:57 Nit: Add a comment about why this can be NULL. Id
+ url = entry->GetURL();
wjmaclean 2014/06/09 17:35:59 Actually, this should be GURL url = ... No need
+ SetZoomLevelForHost(net::GetHostOrSpecFromURL(url), level);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698