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

Unified Diff: content/browser/frame_host/ancestor_throttle.cc

Issue 2606933002: Fix crash in AncestorThrottle that was causing a crash in telemetry perf unittests. (Closed)
Patch Set: review comment Created 3 years, 12 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/frame_host/ancestor_throttle.cc
diff --git a/content/browser/frame_host/ancestor_throttle.cc b/content/browser/frame_host/ancestor_throttle.cc
index 3d6a0a200a132c2e8202ca032c642b2f1408ef52..ca87f0a221d797c54f9304669bd016aa961c9bcc 100644
--- a/content/browser/frame_host/ancestor_throttle.cc
+++ b/content/browser/frame_host/ancestor_throttle.cc
@@ -172,6 +172,8 @@ void AncestorThrottle::ParseError(const std::string& value,
HeaderDisposition disposition) {
DCHECK(disposition == HeaderDisposition::CONFLICT ||
disposition == HeaderDisposition::INVALID);
+ if (!navigation_handle()->GetRenderFrameHost())
+ return; // Some responses won't have a RFH (i.e. 204/205s or downloads).
std::string message;
if (disposition == HeaderDisposition::CONFLICT) {
@@ -196,6 +198,9 @@ void AncestorThrottle::ParseError(const std::string& value,
void AncestorThrottle::ConsoleError(HeaderDisposition disposition) {
DCHECK(disposition == HeaderDisposition::DENY ||
disposition == HeaderDisposition::SAMEORIGIN);
+ if (!navigation_handle()->GetRenderFrameHost())
+ return; // Some responses won't have a RFH (i.e. 204/205s or downloads).
+
std::string message = base::StringPrintf(
"Refused to display '%s' in a frame because it set 'X-Frame-Options' "
"to '%s'.",
« 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