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

Unified Diff: content/browser/resource_context_impl.cc

Issue 350203002: Fix possible crash when HostZoomMap is NULL (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/resource_context_impl.cc
diff --git a/content/browser/resource_context_impl.cc b/content/browser/resource_context_impl.cc
index 14115a4887c77b6d081bba0fec8eb789a9480da0..6cd05277a87a96d0b46b13f034cbc75f999e03d9 100644
--- a/content/browser/resource_context_impl.cc
+++ b/content/browser/resource_context_impl.cc
@@ -94,8 +94,11 @@ StreamContext* GetStreamContextForResourceContext(
HostZoomMap* GetHostZoomMapForResourceContext(ResourceContext* context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- return static_cast<NonOwningZoomData*>(
- context->GetUserData(kHostZoomMapKeyName))->host_zoom_map();
+ NonOwningZoomData* result = static_cast<NonOwningZoomData*>(
+ context->GetUserData(kHostZoomMapKeyName));
+ if (!result)
+ return NULL;
+ return result->host_zoom_map();
}
URLDataManagerBackend* GetURLDataManagerForResourceContext(
« 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