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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 3399 matching lines...) Expand 10 before | Expand all | Expand 10 after
3410 m_elemSheet = CSSStyleSheet::createInline(*this, m_baseURL); 3410 m_elemSheet = CSSStyleSheet::createInline(*this, m_baseURL);
3411 return *m_elemSheet; 3411 return *m_elemSheet;
3412 } 3412 }
3413 3413
3414 void Document::maybeHandleHttpRefresh(const String& content, 3414 void Document::maybeHandleHttpRefresh(const String& content,
3415 HttpRefreshType httpRefreshType) { 3415 HttpRefreshType httpRefreshType) {
3416 if (m_isViewSource || !m_frame) 3416 if (m_isViewSource || !m_frame)
3417 return; 3417 return;
3418 3418
3419 double delay; 3419 double delay;
3420 String refreshURL; 3420 String refreshURLString;
3421 if (!parseHTTPRefresh(content, httpRefreshType == HttpRefreshFromMetaTag 3421 if (!parseHTTPRefresh(content, httpRefreshType == HttpRefreshFromMetaTag
3422 ? isHTMLSpace<UChar> 3422 ? isHTMLSpace<UChar>
3423 : nullptr, 3423 : nullptr,
3424 delay, refreshURL)) 3424 delay, refreshURLString))
3425 return; 3425 return;
3426 if (refreshURL.isEmpty()) 3426 KURL refreshURL =
3427 refreshURL = url().getString(); 3427 refreshURLString.isEmpty() ? url() : completeURL(refreshURLString);
3428 else
3429 refreshURL = completeURL(refreshURL).getString();
3430 3428
3431 if (protocolIsJavaScript(refreshURL)) { 3429 if (refreshURL.protocolIsJavaScript()) {
3432 String message = 3430 String message =
3433 "Refused to refresh " + m_url.elidedString() + " to a javascript: URL"; 3431 "Refused to refresh " + m_url.elidedString() + " to a javascript: URL";
3434 addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, 3432 addConsoleMessage(ConsoleMessage::create(SecurityMessageSource,
3435 ErrorMessageLevel, message)); 3433 ErrorMessageLevel, message));
3436 return; 3434 return;
3437 } 3435 }
3438 3436
3439 if (httpRefreshType == HttpRefreshFromMetaTag && 3437 if (httpRefreshType == HttpRefreshFromMetaTag &&
3440 isSandboxed(SandboxAutomaticFeatures)) { 3438 isSandboxed(SandboxAutomaticFeatures)) {
3441 String message = 3439 String message =
(...skipping 3090 matching lines...) Expand 10 before | Expand all | Expand 10 after
6532 } 6530 }
6533 6531
6534 void showLiveDocumentInstances() { 6532 void showLiveDocumentInstances() {
6535 WeakDocumentSet& set = liveDocumentSet(); 6533 WeakDocumentSet& set = liveDocumentSet();
6536 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6534 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6537 for (Document* document : set) 6535 for (Document* document : set)
6538 fprintf(stderr, "- Document %p URL: %s\n", document, 6536 fprintf(stderr, "- Document %p URL: %s\n", document,
6539 document->url().getString().utf8().data()); 6537 document->url().getString().utf8().data());
6540 } 6538 }
6541 #endif 6539 #endif
OLDNEW
« 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