Chromium Code Reviews| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 #include <memory> | 84 #include <memory> |
| 85 | 85 |
| 86 namespace blink { | 86 namespace blink { |
| 87 | 87 |
| 88 namespace { | 88 namespace { |
| 89 | 89 |
| 90 void emitWarningForDocWriteScripts(const String& url, Document& document) { | 90 void emitWarningForDocWriteScripts(const String& url, Document& document) { |
| 91 String message = | 91 String message = |
| 92 "A Parser-blocking, cross site (i.e. different eTLD+1) script, " + url + | 92 "A Parser-blocking, cross site (i.e. different eTLD+1) script, " + url + |
| 93 ", is invoked via document.write. This may be blocked by " | 93 ", is invoked via document.write. This may be blocked by " |
| 94 "the browser if the device has poor network connectivity. " | 94 "the browser due to poor network connectivity. " |
| 95 "See https://www.chromestatus.com/feature/5718547946799104 " | 95 "See https://www.chromestatus.com/feature/5718547946799104 " |
| 96 "for more details."; | 96 "for more details. If the script is indeed blocked, you should see an " |
|
Bryan McQuade
2017/01/18 23:47:04
thinking about this more i'm a little concerned th
shivanisha
2017/01/19 18:04:58
I hear your concern. Omitting the last sentence mi
| |
| 97 "error message following this."; | |
| 97 document.addConsoleMessage( | 98 document.addConsoleMessage( |
| 98 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message)); | 99 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message)); |
| 99 WTFLogAlways("%s", message.utf8().data()); | 100 WTFLogAlways("%s", message.utf8().data()); |
| 100 } | 101 } |
| 101 | 102 |
| 102 bool isConnectionEffectively2G(WebEffectiveConnectionType effectiveType) { | 103 bool isConnectionEffectively2G(WebEffectiveConnectionType effectiveType) { |
| 103 switch (effectiveType) { | 104 switch (effectiveType) { |
| 104 case WebEffectiveConnectionType::TypeSlow2G: | 105 case WebEffectiveConnectionType::TypeSlow2G: |
| 105 case WebEffectiveConnectionType::Type2G: | 106 case WebEffectiveConnectionType::Type2G: |
| 106 return true; | 107 return true; |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1075 response); | 1076 response); |
| 1076 } | 1077 } |
| 1077 | 1078 |
| 1078 DEFINE_TRACE(FrameFetchContext) { | 1079 DEFINE_TRACE(FrameFetchContext) { |
| 1079 visitor->trace(m_document); | 1080 visitor->trace(m_document); |
| 1080 visitor->trace(m_documentLoader); | 1081 visitor->trace(m_documentLoader); |
| 1081 FetchContext::trace(visitor); | 1082 FetchContext::trace(visitor); |
| 1082 } | 1083 } |
| 1083 | 1084 |
| 1084 } // namespace blink | 1085 } // namespace blink |
| OLD | NEW |