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

Side by Side Diff: Source/core/html/parser/XSSAuditorDelegate.cpp

Issue 20890003: Limit console messages' automatic collection of parser state. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline "fast/frames/sandboxed-iframe-autofocus-denied.html" Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/ScriptExecutionContext.h ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 RefPtr<JSONObject> reportObject = JSONObject::create(); 86 RefPtr<JSONObject> reportObject = JSONObject::create();
87 reportObject->setObject("xss-report", reportDetails.release()); 87 reportObject->setObject("xss-report", reportDetails.release());
88 88
89 return FormData::create(reportObject->toJSONString().utf8().data()); 89 return FormData::create(reportObject->toJSONString().utf8().data());
90 } 90 }
91 91
92 void XSSAuditorDelegate::didBlockScript(const XSSInfo& xssInfo) 92 void XSSAuditorDelegate::didBlockScript(const XSSInfo& xssInfo)
93 { 93 {
94 ASSERT(isMainThread()); 94 ASSERT(isMainThread());
95 95
96 m_document->addConsoleMessage(JSMessageSource, ErrorMessageLevel, buildConso leError(xssInfo, m_document->url().string())); 96 m_document->addConsoleMessage(JSMessageSource, ErrorMessageLevel, buildConso leError(xssInfo, m_document->url().string()), 0, ForceParserStateCollection);
97 97
98 // stopAllLoaders can detach the Frame, so protect it. 98 // stopAllLoaders can detach the Frame, so protect it.
99 RefPtr<Frame> protect(m_document->frame()); 99 RefPtr<Frame> protect(m_document->frame());
100 FrameLoader* frameLoader = m_document->frame()->loader(); 100 FrameLoader* frameLoader = m_document->frame()->loader();
101 if (xssInfo.m_didBlockEntirePage) 101 if (xssInfo.m_didBlockEntirePage)
102 frameLoader->stopAllLoaders(); 102 frameLoader->stopAllLoaders();
103 103
104 if (!m_didSendNotifications) { 104 if (!m_didSendNotifications) {
105 m_didSendNotifications = true; 105 m_didSendNotifications = true;
106 106
107 frameLoader->client()->didDetectXSS(m_document->url(), xssInfo.m_didBloc kEntirePage); 107 frameLoader->client()->didDetectXSS(m_document->url(), xssInfo.m_didBloc kEntirePage);
108 108
109 if (!m_reportURL.isEmpty()) 109 if (!m_reportURL.isEmpty())
110 PingLoader::sendViolationReport(m_document->frame(), m_reportURL, ge nerateViolationReport(), PingLoader::XSSAuditorViolationReport); 110 PingLoader::sendViolationReport(m_document->frame(), m_reportURL, ge nerateViolationReport(), PingLoader::XSSAuditorViolationReport);
111 } 111 }
112 112
113 if (xssInfo.m_didBlockEntirePage) 113 if (xssInfo.m_didBlockEntirePage)
114 m_document->frame()->navigationScheduler()->scheduleLocationChange(m_doc ument->securityOrigin(), SecurityOrigin::urlWithUniqueSecurityOrigin(), String() ); 114 m_document->frame()->navigationScheduler()->scheduleLocationChange(m_doc ument->securityOrigin(), SecurityOrigin::urlWithUniqueSecurityOrigin(), String() );
115 } 115 }
116 116
117 } // namespace WebCore 117 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ScriptExecutionContext.h ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698