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

Unified Diff: Source/core/html/parser/HTMLPreloadScanner.h

Issue 1104103002: Add <meta viewport> support to the preloader (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: moved CachedDocumentParameters constructor to private Created 5 years, 8 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
« no previous file with comments | « Source/core/html/parser/HTMLDocumentParser.cpp ('k') | Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLPreloadScanner.h
diff --git a/Source/core/html/parser/HTMLPreloadScanner.h b/Source/core/html/parser/HTMLPreloadScanner.h
index ed3f3cc67bd0cbab936186fa2ae87101502d2859..2a215c220a92fc37fb291c7e278da9f7f78dedac 100644
--- a/Source/core/html/parser/HTMLPreloadScanner.h
+++ b/Source/core/html/parser/HTMLPreloadScanner.h
@@ -28,10 +28,12 @@
#define HTMLPreloadScanner_h
#include "core/css/MediaValues.h"
+#include "core/dom/ViewportDescription.h"
#include "core/html/parser/CSSPreloadScanner.h"
#include "core/html/parser/CompactHTMLToken.h"
#include "core/html/parser/HTMLToken.h"
#include "platform/text/SegmentedString.h"
+#include "wtf/RefCounted.h"
#include "wtf/Vector.h"
namespace blink {
@@ -42,10 +44,24 @@ class HTMLParserOptions;
class HTMLTokenizer;
class SegmentedString;
+struct CachedDocumentParameters {
+ static PassOwnPtr<CachedDocumentParameters> create(Document* document, PassRefPtr<MediaValues> mediaValues = nullptr)
+ {
+ return adoptPtr(new CachedDocumentParameters(document, mediaValues));
+ }
+
+ RefPtr<MediaValues> mediaValues;
+ Length defaultViewportMinWidth;
+ bool viewportMetaZeroValuesQuirk;
+
+private:
+ CachedDocumentParameters(Document*, PassRefPtr<MediaValues>);
+};
+
class TokenPreloadScanner {
WTF_MAKE_NONCOPYABLE(TokenPreloadScanner); WTF_MAKE_FAST_ALLOCATED(TokenPreloadScanner);
public:
- TokenPreloadScanner(const KURL& documentURL, PassRefPtr<MediaValues>);
+ TokenPreloadScanner(const KURL& documentURL, PassOwnPtr<CachedDocumentParameters>);
~TokenPreloadScanner();
void scan(const HTMLToken&, const SegmentedString&, PreloadRequestStream& requests);
@@ -99,7 +115,7 @@ private:
bool m_isCSPEnabled;
String m_pictureSourceURL;
size_t m_templateCount;
- RefPtr<MediaValues> m_mediaValues;
+ OwnPtr<CachedDocumentParameters> m_documentParameters;
Vector<Checkpoint> m_checkpoints;
};
@@ -107,13 +123,13 @@ private:
class HTMLPreloadScanner {
WTF_MAKE_NONCOPYABLE(HTMLPreloadScanner); WTF_MAKE_FAST_ALLOCATED(HTMLPreloadScanner);
public:
- static PassOwnPtr<HTMLPreloadScanner> create(const HTMLParserOptions& options, const KURL& documentURL, PassRefPtr<MediaValues> mediaValues)
+ static PassOwnPtr<HTMLPreloadScanner> create(const HTMLParserOptions& options, const KURL& documentURL, PassOwnPtr<CachedDocumentParameters> documentParameters)
{
- return adoptPtr(new HTMLPreloadScanner(options, documentURL, mediaValues));
+ return adoptPtr(new HTMLPreloadScanner(options, documentURL, documentParameters));
}
- HTMLPreloadScanner(const HTMLParserOptions&, const KURL& documentURL, PassRefPtr<MediaValues>);
+ HTMLPreloadScanner(const HTMLParserOptions&, const KURL& documentURL, PassOwnPtr<CachedDocumentParameters>);
~HTMLPreloadScanner();
void appendToEnd(const SegmentedString&);
« no previous file with comments | « Source/core/html/parser/HTMLDocumentParser.cpp ('k') | Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698