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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2644633006: Add KURL::protocolIsJavascript member function (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 53d69df8b7bebd37217f1c7cac4ccafa9963ce8a..c7a8df4a374d98ce82e83be34ac22fb844d3a488 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -3417,18 +3417,16 @@ void Document::maybeHandleHttpRefresh(const String& content,
return;
double delay;
- String refreshURL;
+ String refreshURLString;
if (!parseHTTPRefresh(content, httpRefreshType == HttpRefreshFromMetaTag
? isHTMLSpace<UChar>
: nullptr,
- delay, refreshURL))
+ delay, refreshURLString))
return;
- if (refreshURL.isEmpty())
- refreshURL = url().getString();
- else
- refreshURL = completeURL(refreshURL).getString();
+ KURL refreshURL =
+ refreshURLString.isEmpty() ? url() : completeURL(refreshURLString);
- if (protocolIsJavaScript(refreshURL)) {
+ if (refreshURL.protocolIsJavaScript()) {
String message =
"Refused to refresh " + m_url.elidedString() + " to a javascript: URL";
addConsoleMessage(ConsoleMessage::create(SecurityMessageSource,
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp ('k') | third_party/WebKit/Source/core/frame/DOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698