15 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_REQUEST_PROPERTIES_H_
16 #define NET_INSTAWEB_REWRITER_PUBLIC_REQUEST_PROPERTIES_H_
18 #include "net/instaweb/rewriter/public/device_properties.h"
19 #include "pagespeed/kernel/base/basictypes.h"
20 #include "pagespeed/kernel/base/gtest_prod.h"
21 #include "pagespeed/kernel/base/scoped_ptr.h"
22 #include "pagespeed/kernel/base/string_util.h"
23 #include "pagespeed/kernel/http/user_agent_matcher.h"
25 namespace net_instaweb {
27 class DownstreamCachingDirectives;
28 class AbstractLogRecord;
48 bool SupportsImageInlining()
const;
49 bool SupportsLazyloadImages()
const;
50 bool SupportsCriticalCss()
const;
51 bool SupportsCriticalCssBeacon()
const;
52 bool SupportsCriticalImagesBeacon()
const;
53 bool SupportsJsDefer(
bool enable_mobile)
const;
58 bool SupportsWebpRewrittenUrls()
const;
59 bool SupportsWebpLosslessAlpha()
const;
60 bool SupportsWebpAnimated()
const;
62 bool CanPreloadResources()
const;
63 UserAgentMatcher::DeviceType GetDeviceType()
const;
64 bool IsMobile()
const;
65 bool IsTablet()
const;
66 bool ForbidWebpInlining()
const;
67 bool AcceptsGzip()
const;
68 void LogDeviceInfo(AbstractLogRecord* log_record,
69 bool enable_aggressive_rewriters_for_mobile);
70 bool RequestsSaveData()
const;
71 bool HasViaHeader()
const;
74 friend class ImageRewriteTest;
75 FRIEND_TEST(RequestPropertiesTest, GetScreenGroupIndex);
77 scoped_ptr<DeviceProperties> device_properties_;
78 scoped_ptr<DownstreamCachingDirectives> downstream_caching_directives_;
80 mutable LazyBool supports_image_inlining_;
81 mutable LazyBool supports_js_defer_;
82 mutable LazyBool supports_lazyload_images_;
83 mutable LazyBool supports_webp_in_place_;
84 mutable LazyBool supports_webp_rewritten_urls_;
85 mutable LazyBool supports_webp_lossless_alpha_;
86 mutable LazyBool supports_webp_animated_;
bool SupportsWebpInPlace() const
void SetUserAgent(StringPiece user_agent_string)
Sets the user agent string on the underlying DeviceProperties object.
void ParseRequestHeaders(const RequestHeaders &request_headers)
Definition: request_properties.h:37