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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2640163002: Doc.write intervention warning and error messages fixed for clarity. (Closed)
Patch Set: Feedback incorporated. Created 3 years, 11 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) 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #include <algorithm> 83 #include <algorithm>
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 in this or a future page load due to poor network "
95 "connectivity. If blocked in this page load, it will be confirmed in a "
96 "subsequent console message."
95 "See https://www.chromestatus.com/feature/5718547946799104 " 97 "See https://www.chromestatus.com/feature/5718547946799104 "
96 "for more details."; 98 "for more details.";
97 document.addConsoleMessage( 99 document.addConsoleMessage(
98 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message)); 100 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message));
99 WTFLogAlways("%s", message.utf8().data()); 101 WTFLogAlways("%s", message.utf8().data());
100 } 102 }
101 103
102 bool isConnectionEffectively2G(WebEffectiveConnectionType effectiveType) { 104 bool isConnectionEffectively2G(WebEffectiveConnectionType effectiveType) {
103 switch (effectiveType) { 105 switch (effectiveType) {
104 case WebEffectiveConnectionType::TypeSlow2G: 106 case WebEffectiveConnectionType::TypeSlow2G:
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 response); 1076 response);
1075 } 1077 }
1076 1078
1077 DEFINE_TRACE(FrameFetchContext) { 1079 DEFINE_TRACE(FrameFetchContext) {
1078 visitor->trace(m_document); 1080 visitor->trace(m_document);
1079 visitor->trace(m_documentLoader); 1081 visitor->trace(m_documentLoader);
1080 FetchContext::trace(visitor); 1082 FetchContext::trace(visitor);
1081 } 1083 }
1082 1084
1083 } // namespace blink 1085 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698