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

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: rebase + added tests 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..3b7164f4844b22c891a876fb6efa31a3b83b08a7 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,29 @@ class HTMLParserOptions;
class HTMLTokenizer;
class SegmentedString;
+struct CachedDocumentParameters {
+ static PassOwnPtr<CachedDocumentParameters> create(Document* document, PassRefPtr<MediaValues> mediaValues)
+ {
+ return adoptPtr(new CachedDocumentParameters(document, mediaValues));
+ }
+
+ static PassOwnPtr<CachedDocumentParameters> create(Document* document)
+ {
+ return adoptPtr(new CachedDocumentParameters(document));
+ }
+
+ CachedDocumentParameters(Document*);
+ CachedDocumentParameters(Document*, PassRefPtr<MediaValues>);
Nate Chapin 2015/04/30 20:19:04 Can we have two create() methods, but just one con
+
+ RefPtr<MediaValues> mediaValues;
+ Length defaultViewportMinWidth;
+ bool viewportMetaZeroValuesQuirk;
+};
+
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 +120,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 +128,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