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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp

Issue 2428093002: [KURL] Avoid re-hashing input if is already canonicalized (Closed)
Patch Set: uh ignore PS 5 I have no idea how that got there :P Created 4 years, 2 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/
4 * Copyright (C) 2010 Google Inc. All Rights Reserved. 4 * Copyright (C) 2010 Google Inc. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 default: { return; } 821 default: { return; }
822 } 822 }
823 } 823 }
824 824
825 template <typename Token> 825 template <typename Token>
826 void TokenPreloadScanner::updatePredictedBaseURL(const Token& token) { 826 void TokenPreloadScanner::updatePredictedBaseURL(const Token& token) {
827 ASSERT(m_predictedBaseElementURL.isEmpty()); 827 ASSERT(m_predictedBaseElementURL.isEmpty());
828 if (const typename Token::Attribute* hrefAttribute = 828 if (const typename Token::Attribute* hrefAttribute =
829 token.getAttributeItem(hrefAttr)) { 829 token.getAttributeItem(hrefAttr)) {
830 KURL url(m_documentURL, stripLeadingAndTrailingHTMLSpaces( 830 KURL url(m_documentURL, stripLeadingAndTrailingHTMLSpaces(
831 hrefAttribute->value8BitIfNecessary())); 831 hrefAttribute->value8BitIfNecessary())
832 .isolatedCopy());
832 m_predictedBaseElementURL = url.isValid() ? url.copy() : KURL(); 833 m_predictedBaseElementURL = url.isValid() ? url.copy() : KURL();
833 } 834 }
834 } 835 }
835 836
836 HTMLPreloadScanner::HTMLPreloadScanner( 837 HTMLPreloadScanner::HTMLPreloadScanner(
837 const HTMLParserOptions& options, 838 const HTMLParserOptions& options,
838 const KURL& documentURL, 839 const KURL& documentURL,
839 std::unique_ptr<CachedDocumentParameters> documentParameters, 840 std::unique_ptr<CachedDocumentParameters> documentParameters,
840 const MediaValuesCached::MediaValuesCachedData& mediaValuesCachedData) 841 const MediaValuesCached::MediaValuesCachedData& mediaValuesCachedData)
841 : m_scanner(documentURL, 842 : m_scanner(documentURL,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 defaultViewportMinWidth = document->viewportDefaultMinWidth(); 893 defaultViewportMinWidth = document->viewportDefaultMinWidth();
893 viewportMetaZeroValuesQuirk = 894 viewportMetaZeroValuesQuirk =
894 document->settings() && 895 document->settings() &&
895 document->settings()->viewportMetaZeroValuesQuirk(); 896 document->settings()->viewportMetaZeroValuesQuirk();
896 viewportMetaEnabled = 897 viewportMetaEnabled =
897 document->settings() && document->settings()->viewportMetaEnabled(); 898 document->settings() && document->settings()->viewportMetaEnabled();
898 referrerPolicy = document->getReferrerPolicy(); 899 referrerPolicy = document->getReferrerPolicy();
899 } 900 }
900 901
901 } // namespace blink 902 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698