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

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

Issue 2502843002: DevTools: issue document.write(script) violation reports. (Closed)
Patch Set: rebaselined Created 4 years, 1 month 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 if (!document.settings()) 118 if (!document.settings())
119 return false; 119 return false;
120 120
121 if (!document.frame()) 121 if (!document.frame())
122 return false; 122 return false;
123 123
124 // Only block synchronously loaded (parser blocking) scripts. 124 // Only block synchronously loaded (parser blocking) scripts.
125 if (defer != FetchRequest::NoDefer) 125 if (defer != FetchRequest::NoDefer)
126 return false; 126 return false;
127 127
128 PerformanceMonitor::documentWriteFetchScript(&document);
129
128 if (!request.url().protocolIsInHTTPFamily()) 130 if (!request.url().protocolIsInHTTPFamily())
129 return false; 131 return false;
130 132
131 // Avoid blocking same origin scripts, as they may be used to render main 133 // Avoid blocking same origin scripts, as they may be used to render main
132 // page content, whereas cross-origin scripts inserted via document.write 134 // page content, whereas cross-origin scripts inserted via document.write
133 // are likely to be third party content. 135 // are likely to be third party content.
134 String requestHost = request.url().host(); 136 String requestHost = request.url().host();
135 String documentHost = document.getSecurityOrigin()->domain(); 137 String documentHost = document.getSecurityOrigin()->domain();
136 if (requestHost == documentHost) 138 if (requestHost == documentHost)
137 return false; 139 return false;
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 response); 1010 response);
1009 } 1011 }
1010 1012
1011 DEFINE_TRACE(FrameFetchContext) { 1013 DEFINE_TRACE(FrameFetchContext) {
1012 visitor->trace(m_document); 1014 visitor->trace(m_document);
1013 visitor->trace(m_documentLoader); 1015 visitor->trace(m_documentLoader);
1014 FetchContext::trace(visitor); 1016 FetchContext::trace(visitor);
1015 } 1017 }
1016 1018
1017 } // namespace blink 1019 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698