| OLD | NEW |
| 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 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2101 DCHECK(frame_request.GetSubstituteData().IsValid()); | 2101 DCHECK(frame_request.GetSubstituteData().IsValid()); |
| 2102 frame_request.SetReplacesCurrentItem(replace); | 2102 frame_request.SetReplacesCurrentItem(replace); |
| 2103 if (is_client_redirect) | 2103 if (is_client_redirect) |
| 2104 frame_request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect); | 2104 frame_request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect); |
| 2105 | 2105 |
| 2106 GetFrame()->Loader().Load( | 2106 GetFrame()->Loader().Load( |
| 2107 frame_request, static_cast<FrameLoadType>(web_frame_load_type), | 2107 frame_request, static_cast<FrameLoadType>(web_frame_load_type), |
| 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 WebLocalFrame::FallbackContentResult |
| 2112 const WebURLError& error) const { | 2112 WebLocalFrameImpl::MaybeRenderFallbackContent(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 NoFallbackContent; |
| 2117 | 2117 |
| 2118 DCHECK(GetFrame()->Loader().ProvisionalDocumentLoader()); | 2118 // provisionalDocumentLoader() can be null if a navigation started and |
| 2119 // completed (e.g. about:blank) while waiting for the navigation that wants |
| 2120 // to show fallback content. |
| 2121 if (!GetFrame()->Loader().ProvisionalDocumentLoader()) |
| 2122 return NoLoadInProgress; |
| 2123 |
| 2119 GetFrame()->Loader().ProvisionalDocumentLoader()->LoadFailed(error); | 2124 GetFrame()->Loader().ProvisionalDocumentLoader()->LoadFailed(error); |
| 2120 return true; | 2125 return FallbackRendered; |
| 2121 } | 2126 } |
| 2122 | 2127 |
| 2123 // Called when a navigation is blocked because a Content Security Policy (CSP) | 2128 // Called when a navigation is blocked because a Content Security Policy (CSP) |
| 2124 // is infringed. | 2129 // is infringed. |
| 2125 void WebLocalFrameImpl::ReportContentSecurityPolicyViolation( | 2130 void WebLocalFrameImpl::ReportContentSecurityPolicyViolation( |
| 2126 const blink::WebContentSecurityPolicyViolation& violation) { | 2131 const blink::WebContentSecurityPolicyViolation& violation) { |
| 2127 AddMessageToConsole(blink::WebConsoleMessage( | 2132 AddMessageToConsole(blink::WebConsoleMessage( |
| 2128 WebConsoleMessage::kLevelError, violation.console_message, | 2133 WebConsoleMessage::kLevelError, violation.console_message, |
| 2129 violation.source_location.url, violation.source_location.line_number, | 2134 violation.source_location.url, violation.source_location.line_number, |
| 2130 violation.source_location.column_number)); | 2135 violation.source_location.column_number)); |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2562 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { | 2567 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { |
| 2563 return *text_checker_client_; | 2568 return *text_checker_client_; |
| 2564 } | 2569 } |
| 2565 | 2570 |
| 2566 void WebLocalFrameImpl::SetTextCheckClient( | 2571 void WebLocalFrameImpl::SetTextCheckClient( |
| 2567 WebTextCheckClient* text_check_client) { | 2572 WebTextCheckClient* text_check_client) { |
| 2568 text_check_client_ = text_check_client; | 2573 text_check_client_ = text_check_client; |
| 2569 } | 2574 } |
| 2570 | 2575 |
| 2571 } // namespace blink | 2576 } // namespace blink |
| OLD | NEW |