Page Speed Optimization Libraries  1.6.29.3
net/instaweb/rewriter/public/downstream_caching_directives.h
00001 // Copyright 2013 Google Inc. All Rights Reserved.
00014 
00015 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_DOWNSTREAM_CACHING_DIRECTIVES_H_
00016 #define NET_INSTAWEB_REWRITER_PUBLIC_DOWNSTREAM_CACHING_DIRECTIVES_H_
00017 
00018 #include "net/instaweb/util/public/basictypes.h"
00019 #include "net/instaweb/util/public/gtest_prod.h"
00020 #include "pagespeed/kernel/base/string.h"  
00021 
00022 namespace net_instaweb {
00023 
00024 class RequestHeaders;
00025 
00031 class DownstreamCachingDirectives {
00032  public:
00035   static const char kNoCapabilitiesSpecified[];
00036 
00037   DownstreamCachingDirectives();
00038   virtual ~DownstreamCachingDirectives();
00039 
00042   void ParseCapabilityListFromRequestHeaders(
00043       const RequestHeaders& request_headers);
00044 
00047   bool SupportsImageInlining() const;
00048   bool SupportsLazyloadImages() const;
00051   bool SupportsJsDefer() const;
00052   bool SupportsWebp() const;
00053   bool SupportsWebpLosslessAlpha() const;
00054 
00055  private:
00070   static bool IsPropertySupported(LazyBool* supports_property,
00071                                   const GoogleString& capability,
00072                                   const GoogleString& capability_list);
00073 
00074   mutable LazyBool supports_image_inlining_;
00075   mutable LazyBool supports_js_defer_;
00076   mutable LazyBool supports_lazyload_images_;
00077   mutable LazyBool supports_webp_;
00078   mutable LazyBool supports_webp_lossless_alpha_;
00079 
00080   GoogleString capabilities_to_be_supported_;
00081 
00082   DISALLOW_COPY_AND_ASSIGN(DownstreamCachingDirectives);
00083 };
00084 
00085 }  
00086 
00087 #endif  ///< NET_INSTAWEB_REWRITER_PUBLIC_DOWNSTREAM_CACHING_DIRECTIVES_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines