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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2783743002: Fix nullptr deref in maybeRenderFallbackContent() (Closed)
Patch Set: Fix tests, handled the non-loading cause in the maybeRenderFallbackContent() if block Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after
2077 static_cast<HistoryLoadType>(webHistoryLoadType)); 2077 static_cast<HistoryLoadType>(webHistoryLoadType));
2078 } 2078 }
2079 2079
2080 bool WebLocalFrameImpl::maybeRenderFallbackContent( 2080 bool WebLocalFrameImpl::maybeRenderFallbackContent(
2081 const WebURLError& error) const { 2081 const WebURLError& error) const {
2082 DCHECK(frame()); 2082 DCHECK(frame());
2083 2083
2084 if (!frame()->owner() || !frame()->owner()->canRenderFallbackContent()) 2084 if (!frame()->owner() || !frame()->owner()->canRenderFallbackContent())
2085 return false; 2085 return false;
2086 2086
2087 DCHECK(frame()->loader().provisionalDocumentLoader()); 2087 // provisionalDocumentLoader() can be null if a navigation started and
2088 frame()->loader().provisionalDocumentLoader()->loadFailed(error); 2088 // completed (e.g. about:blank) while waiting for the navigation that wants
2089 // to show fallback content.
2090 if (frame()->loader().provisionalDocumentLoader())
2091 frame()->loader().provisionalDocumentLoader()->loadFailed(error);
2089 return true; 2092 return true;
2090 } 2093 }
2091 2094
2092 // Called when a navigation is blocked because a Content Security Policy (CSP) 2095 // Called when a navigation is blocked because a Content Security Policy (CSP)
2093 // is infringed. 2096 // is infringed.
2094 void WebLocalFrameImpl::reportContentSecurityPolicyViolation( 2097 void WebLocalFrameImpl::reportContentSecurityPolicyViolation(
2095 const blink::WebContentSecurityPolicyViolation& violation) { 2098 const blink::WebContentSecurityPolicyViolation& violation) {
2096 addMessageToConsole(blink::WebConsoleMessage( 2099 addMessageToConsole(blink::WebConsoleMessage(
2097 WebConsoleMessage::LevelError, violation.consoleMessage, 2100 WebConsoleMessage::LevelError, violation.consoleMessage,
2098 violation.sourceLocation.url, violation.sourceLocation.lineNumber, 2101 violation.sourceLocation.url, violation.sourceLocation.lineNumber,
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
2516 createMarkup(startPosition, endPosition, AnnotateForInterchange, 2519 createMarkup(startPosition, endPosition, AnnotateForInterchange,
2517 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2520 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2518 } else { 2521 } else {
2519 clipHtml = 2522 clipHtml =
2520 createMarkup(endPosition, startPosition, AnnotateForInterchange, 2523 createMarkup(endPosition, startPosition, AnnotateForInterchange,
2521 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2524 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2522 } 2525 }
2523 } 2526 }
2524 2527
2525 } // namespace blink 2528 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698