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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (match(tagImpl, scriptTag)) 100 if (match(tagImpl, scriptTag))
101 return scriptTag.localName(); 101 return scriptTag.localName();
102 if (match(tagImpl, videoTag)) 102 if (match(tagImpl, videoTag))
103 return videoTag.localName(); 103 return videoTag.localName();
104 ASSERT_NOT_REACHED(); 104 ASSERT_NOT_REACHED();
105 return emptyString(); 105 return emptyString();
106 } 106 }
107 107
108 static bool mediaAttributeMatches(const MediaValuesCached& mediaValues, const St ring& attributeValue) 108 static bool mediaAttributeMatches(const MediaValuesCached& mediaValues, const St ring& attributeValue)
109 { 109 {
110 RefPtrWillBeRawPtr<MediaQuerySet> mediaQueries = MediaQuerySet::createOffMai nThread(attributeValue); 110 RawPtr<MediaQuerySet> mediaQueries = MediaQuerySet::createOffMainThread(attr ibuteValue);
111 MediaQueryEvaluator mediaQueryEvaluator(mediaValues); 111 MediaQueryEvaluator mediaQueryEvaluator(mediaValues);
112 return mediaQueryEvaluator.eval(mediaQueries.get()); 112 return mediaQueryEvaluator.eval(mediaQueries.get());
113 } 113 }
114 114
115 class TokenPreloadScanner::StartTagScanner { 115 class TokenPreloadScanner::StartTagScanner {
116 STACK_ALLOCATED(); 116 STACK_ALLOCATED();
117 public: 117 public:
118 StartTagScanner(const StringImpl* tagImpl, PassRefPtrWillBeRawPtr<MediaValue sCached> mediaValues) 118 StartTagScanner(const StringImpl* tagImpl, RawPtr<MediaValuesCached> mediaVa lues)
119 : m_tagImpl(tagImpl) 119 : m_tagImpl(tagImpl)
120 , m_linkIsStyleSheet(false) 120 , m_linkIsStyleSheet(false)
121 , m_linkTypeIsMissingOrSupportedStyleSheet(true) 121 , m_linkTypeIsMissingOrSupportedStyleSheet(true)
122 , m_linkIsPreconnect(false) 122 , m_linkIsPreconnect(false)
123 , m_linkIsPreload(false) 123 , m_linkIsPreload(false)
124 , m_linkIsImport(false) 124 , m_linkIsImport(false)
125 , m_matchedMediaAttribute(true) 125 , m_matchedMediaAttribute(true)
126 , m_inputIsImage(false) 126 , m_inputIsImage(false)
127 , m_sourceSize(0) 127 , m_sourceSize(0)
128 , m_sourceSizeSet(false) 128 , m_sourceSizeSet(false)
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 bool m_linkIsImport; 429 bool m_linkIsImport;
430 bool m_matchedMediaAttribute; 430 bool m_matchedMediaAttribute;
431 bool m_inputIsImage; 431 bool m_inputIsImage;
432 String m_imgSrcUrl; 432 String m_imgSrcUrl;
433 String m_srcsetAttributeValue; 433 String m_srcsetAttributeValue;
434 String m_asAttributeValue; 434 String m_asAttributeValue;
435 float m_sourceSize; 435 float m_sourceSize;
436 bool m_sourceSizeSet; 436 bool m_sourceSizeSet;
437 FetchRequest::DeferOption m_defer; 437 FetchRequest::DeferOption m_defer;
438 CrossOriginAttributeValue m_crossOrigin; 438 CrossOriginAttributeValue m_crossOrigin;
439 RefPtrWillBeMember<MediaValuesCached> m_mediaValues; 439 Member<MediaValuesCached> m_mediaValues;
440 bool m_referrerPolicySet; 440 bool m_referrerPolicySet;
441 ReferrerPolicy m_referrerPolicy; 441 ReferrerPolicy m_referrerPolicy;
442 IntegrityMetadataSet m_integrityMetadata; 442 IntegrityMetadataSet m_integrityMetadata;
443 }; 443 };
444 444
445 TokenPreloadScanner::TokenPreloadScanner(const KURL& documentURL, PassOwnPtr<Cac hedDocumentParameters> documentParameters) 445 TokenPreloadScanner::TokenPreloadScanner(const KURL& documentURL, PassOwnPtr<Cac hedDocumentParameters> documentParameters)
446 : m_documentURL(documentURL) 446 : m_documentURL(documentURL)
447 , m_inStyle(false) 447 , m_inStyle(false)
448 , m_inPicture(false) 448 , m_inPicture(false)
449 , m_isAppCacheEnabled(false) 449 , m_isAppCacheEnabled(false)
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 while (m_tokenizer->nextToken(m_source, m_token)) { 671 while (m_tokenizer->nextToken(m_source, m_token)) {
672 if (m_token.type() == HTMLToken::StartTag) 672 if (m_token.type() == HTMLToken::StartTag)
673 m_tokenizer->updateStateFor(attemptStaticStringCreation(m_token.name (), Likely8Bit)); 673 m_tokenizer->updateStateFor(attemptStaticStringCreation(m_token.name (), Likely8Bit));
674 m_scanner.scan(m_token, m_source, requests); 674 m_scanner.scan(m_token, m_source, requests);
675 m_token.clear(); 675 m_token.clear();
676 } 676 }
677 677
678 preloader->takeAndPreload(requests); 678 preloader->takeAndPreload(requests);
679 } 679 }
680 680
681 CachedDocumentParameters::CachedDocumentParameters(Document* document, PassRefPt rWillBeRawPtr<MediaValuesCached> givenMediaValues) 681 CachedDocumentParameters::CachedDocumentParameters(Document* document, RawPtr<Me diaValuesCached> givenMediaValues)
682 { 682 {
683 ASSERT(isMainThread()); 683 ASSERT(isMainThread());
684 ASSERT(document); 684 ASSERT(document);
685 doHtmlPreloadScanning = !document->settings() || document->settings()->doHtm lPreloadScanning(); 685 doHtmlPreloadScanning = !document->settings() || document->settings()->doHtm lPreloadScanning();
686 if (givenMediaValues) 686 if (givenMediaValues)
687 mediaValues = givenMediaValues; 687 mediaValues = givenMediaValues;
688 else 688 else
689 mediaValues = MediaValuesCached::create(*document); 689 mediaValues = MediaValuesCached::create(*document);
690 ASSERT(mediaValues->isSafeToSendToAnotherThread()); 690 ASSERT(mediaValues->isSafeToSendToAnotherThread());
691 defaultViewportMinWidth = document->viewportDefaultMinWidth(); 691 defaultViewportMinWidth = document->viewportDefaultMinWidth();
692 viewportMetaZeroValuesQuirk = document->settings() && document->settings()-> viewportMetaZeroValuesQuirk(); 692 viewportMetaZeroValuesQuirk = document->settings() && document->settings()-> viewportMetaZeroValuesQuirk();
693 viewportMetaEnabled = document->settings() && document->settings()->viewport MetaEnabled(); 693 viewportMetaEnabled = document->settings() && document->settings()->viewport MetaEnabled();
694 referrerPolicy = ReferrerPolicyDefault; 694 referrerPolicy = ReferrerPolicyDefault;
695 } 695 }
696 696
697 } // namespace blink 697 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698