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

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

Issue 2783743002: Fix nullptr deref in maybeRenderFallbackContent() (Closed)
Patch Set: Rebase, flip was_loading 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 2097 matching lines...) Expand 10 before | Expand all | Expand 10 after
2108 history_item, static_cast<HistoryLoadType>(web_history_load_type)); 2108 history_item, static_cast<HistoryLoadType>(web_history_load_type));
2109 } 2109 }
2110 2110
2111 bool WebLocalFrameImpl::MaybeRenderFallbackContent( 2111 bool WebLocalFrameImpl::MaybeRenderFallbackContent(
2112 const WebURLError& error) const { 2112 const WebURLError& error) const {
2113 DCHECK(GetFrame()); 2113 DCHECK(GetFrame());
2114 2114
2115 if (!GetFrame()->Owner() || !GetFrame()->Owner()->CanRenderFallbackContent()) 2115 if (!GetFrame()->Owner() || !GetFrame()->Owner()->CanRenderFallbackContent())
2116 return false; 2116 return false;
2117 2117
2118 DCHECK(GetFrame()->Loader().ProvisionalDocumentLoader()); 2118 // provisionalDocumentLoader() can be null if a navigation started and
2119 GetFrame()->Loader().ProvisionalDocumentLoader()->LoadFailed(error); 2119 // completed (e.g. about:blank) while waiting for the navigation that wants
2120 // to show fallback content.
2121 if (GetFrame()->Loader().ProvisionalDocumentLoader())
2122 GetFrame()->Loader().ProvisionalDocumentLoader()->LoadFailed(error);
2120 return true; 2123 return true;
2121 } 2124 }
2122 2125
2123 // Called when a navigation is blocked because a Content Security Policy (CSP) 2126 // Called when a navigation is blocked because a Content Security Policy (CSP)
2124 // is infringed. 2127 // is infringed.
2125 void WebLocalFrameImpl::ReportContentSecurityPolicyViolation( 2128 void WebLocalFrameImpl::ReportContentSecurityPolicyViolation(
2126 const blink::WebContentSecurityPolicyViolation& violation) { 2129 const blink::WebContentSecurityPolicyViolation& violation) {
2127 AddMessageToConsole(blink::WebConsoleMessage( 2130 AddMessageToConsole(blink::WebConsoleMessage(
2128 WebConsoleMessage::kLevelError, violation.console_message, 2131 WebConsoleMessage::kLevelError, violation.console_message,
2129 violation.source_location.url, violation.source_location.line_number, 2132 violation.source_location.url, violation.source_location.line_number,
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
2562 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { 2565 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const {
2563 return *text_checker_client_; 2566 return *text_checker_client_;
2564 } 2567 }
2565 2568
2566 void WebLocalFrameImpl::SetTextCheckClient( 2569 void WebLocalFrameImpl::SetTextCheckClient(
2567 WebTextCheckClient* text_check_client) { 2570 WebTextCheckClient* text_check_client) {
2568 text_check_client_ = text_check_client; 2571 text_check_client_ = text_check_client;
2569 } 2572 }
2570 2573
2571 } // namespace blink 2574 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698