| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 #include "public/platform/WebViewScheduler.h" | 77 #include "public/platform/WebViewScheduler.h" |
| 78 #include <algorithm> | 78 #include <algorithm> |
| 79 #include <memory> | 79 #include <memory> |
| 80 | 80 |
| 81 namespace blink { | 81 namespace blink { |
| 82 | 82 |
| 83 namespace { | 83 namespace { |
| 84 | 84 |
| 85 void emitWarningForDocWriteScripts(const String& url, Document& document) | 85 void emitWarningForDocWriteScripts(const String& url, Document& document) |
| 86 { | 86 { |
| 87 String message = "A Parser-blocking, cross-origin script, " + url + ", is in
voked via document.write. This may be blocked by the browser if the device has p
oor network connectivity."; | 87 String message = "A Parser-blocking, cross-origin script, " + url + ", is in
voked via document.write. This may be blocked by the browser if the device has p
oor network connectivity. See https://www.chromestatus.com/feature/5718547946799
104 for more details."; |
| 88 document.addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMe
ssageLevel, message)); | 88 document.addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMe
ssageLevel, message)); |
| 89 WTFLogAlways("%s", message.utf8().data()); | 89 WTFLogAlways("%s", message.utf8().data()); |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool shouldDisallowFetchForMainFrameScript(const ResourceRequest& request, Fetch
Request::DeferOption defer, Document& document) | 92 bool shouldDisallowFetchForMainFrameScript(const ResourceRequest& request, Fetch
Request::DeferOption defer, Document& document) |
| 93 { | 93 { |
| 94 // Only scripts inserted via document.write are candidates for having their | 94 // Only scripts inserted via document.write are candidates for having their |
| 95 // fetch disallowed. | 95 // fetch disallowed. |
| 96 if (!document.isInDocumentWrite()) | 96 if (!document.isInDocumentWrite()) |
| 97 return false; | 97 return false; |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 } | 836 } |
| 837 | 837 |
| 838 DEFINE_TRACE(FrameFetchContext) | 838 DEFINE_TRACE(FrameFetchContext) |
| 839 { | 839 { |
| 840 visitor->trace(m_document); | 840 visitor->trace(m_document); |
| 841 visitor->trace(m_documentLoader); | 841 visitor->trace(m_documentLoader); |
| 842 FetchContext::trace(visitor); | 842 FetchContext::trace(visitor); |
| 843 } | 843 } |
| 844 | 844 |
| 845 } // namespace blink | 845 } // namespace blink |
| OLD | NEW |