19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_REWRITE_OPTIONS_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_REWRITE_OPTIONS_H_
29 #include "base/logging.h"
48 #include "pagespeed/kernel/base/thread_annotations.h"
53 #include "pagespeed/kernel/http/user_agent_matcher.h"
56 namespace net_instaweb {
91 template<
class RewriteOptionsSub
class,
class OptionClass>
class PropertyLeaf;
112 kCachePartialHtmlDeprecated,
113 kCanonicalizeJavascriptLibraries,
119 kComputeVisibleTextDeprecated,
121 kConvertJpegToProgressive,
125 kConvertToWebpAnimated,
126 kConvertToWebpLossless,
128 kDecodeRewrittenUrls,
137 kExperimentCollectMobImageInfo,
144 kFallbackRewriteCssUrls,
148 kHandleNoscriptRedirect,
149 kHintPreloadSubresources,
151 kIncludeJsSourceMaps,
153 kInlineGoogleFontCss,
157 kInPlaceOptimizeForBrowser,
161 kInsertImageDimensions,
166 kMakeGoogleAnalyticsAsync,
170 kMoveCssAboveScripts,
175 kPrioritizeCriticalCss,
183 kResizeToRenderedImageDimensions,
185 kResponsiveImagesZoom,
188 kRewriteJavascriptExternal,
189 kRewriteJavascriptInline,
190 kRewriteStyleAttributes,
191 kRewriteStyleAttributesWithUrl,
192 kServeDeprecationNotice,
196 kStripImageColorProfile,
248 static const char kAccessControlAllowOrigins[];
249 static const char kAddOptionsToUrls[];
250 static const char kAllowLoggingUrlsInLogRecord[];
251 static const char kAllowOptionsToBeSetByCookies[];
252 static const char kAllowVaryOn[];
253 static const char kAlwaysRewriteCss[];
254 static const char kAmpLinkPattern[];
255 static const char kAnalyticsID[];
256 static const char kAvoidRenamingIntrospectiveJavascript[];
257 static const char kAwaitPcacheLookup[];
258 static const char kBeaconReinstrumentTimeSec[];
259 static const char kBeaconUrl[];
260 static const char kCacheFragment[];
261 static const char kCacheSmallImagesUnrewritten[];
262 static const char kClientDomainRewrite[];
263 static const char kCombineAcrossPaths[];
264 static const char kContentExperimentID[];
265 static const char kContentExperimentVariantID[];
266 static const char kCriticalImagesBeaconEnabled[];
267 static const char kCssFlattenMaxBytes[];
268 static const char kCssImageInlineMaxBytes[];
269 static const char kCssInlineMaxBytes[];
270 static const char kCssOutlineMinBytes[];
271 static const char kCssPreserveURLs[];
272 static const char kDefaultCacheHtml[];
273 static const char kDisableBackgroundFetchesForBots[];
274 static const char kDisableRewriteOnNoTransform[];
275 static const char kDomainRewriteCookies[];
276 static const char kDomainRewriteHyperlinks[];
277 static const char kDomainShardCount[];
278 static const char kDownstreamCachePurgeMethod[];
279 static const char kDownstreamCacheRebeaconingKey[];
280 static const char kDownstreamCacheRewrittenPercentageThreshold[];
281 static const char kEnableAggressiveRewritersForMobile[];
282 static const char kEnableCachePurge[];
283 static const char kEnableDeferJsExperimental[];
284 static const char kEnableExtendedInstrumentation[];
285 static const char kEnableLazyLoadHighResImages[];
286 static const char kEnablePrioritizingScripts[];
287 static const char kEnabled[];
288 static const char kEnrollExperiment[];
289 static const char kExperimentCookieDurationMs[];
290 static const char kExperimentSlot[];
291 static const char kFetcherTimeOutMs[];
292 static const char kFinderPropertiesCacheExpirationTimeMs[];
293 static const char kFinderPropertiesCacheRefreshTimeMs[];
294 static const char kFlushBufferLimitBytes[];
295 static const char kFlushHtml[];
296 static const char kFollowFlushes[];
297 static const char kGoogleFontCssInlineMaxBytes[];
298 static const char kForbidAllDisabledFilters[];
299 static const char kHideRefererUsingMeta[];
300 static const char kHttpCacheCompressionLevel[];
301 static const char kHonorCsp[];
302 static const char kIdleFlushTimeMs[];
303 static const char kImageInlineMaxBytes[];
307 static const char kImageJpegNumProgressiveScansForSmallScreens[];
308 static const char kImageJpegQualityForSaveData[];
309 static const char kImageJpegRecompressionQuality[];
310 static const char kImageJpegRecompressionQualityForSmallScreens[];
311 static const char kImageLimitOptimizedPercent[];
312 static const char kImageLimitRenderedAreaPercent[];
313 static const char kImageLimitResizeAreaPercent[];
314 static const char kImageMaxRewritesAtOnce[];
315 static const char kImagePreserveURLs[];
316 static const char kImageRecompressionQuality[];
317 static const char kImageResolutionLimitBytes[];
318 static const char kImageWebpQualityForSaveData[];
319 static const char kImageWebpRecompressionQuality[];
320 static const char kImageWebpRecompressionQualityForSmallScreens[];
321 static const char kImageWebpAnimatedRecompressionQuality[];
322 static const char kImageWebpTimeoutMs[];
323 static const char kImplicitCacheTtlMs[];
324 static const char kIncreaseSpeedTracking[];
325 static const char kInlineOnlyCriticalImages[];
326 static const char kInPlacePreemptiveRewriteCss[];
327 static const char kInPlacePreemptiveRewriteCssImages[];
328 static const char kInPlacePreemptiveRewriteImages[];
329 static const char kInPlacePreemptiveRewriteJavascript[];
330 static const char kInPlaceResourceOptimization[];
331 static const char kInPlaceRewriteDeadlineMs[];
332 static const char kInPlaceSMaxAgeSec[];
333 static const char kInPlaceWaitForOptimized[];
334 static const char kJsInlineMaxBytes[];
335 static const char kJsOutlineMinBytes[];
336 static const char kJsPreserveURLs[];
337 static const char kLazyloadImagesAfterOnload[];
338 static const char kLazyloadImagesBlankUrl[];
339 static const char kLoadFromFileCacheTtlMs[];
340 static const char kLogBackgroundRewrite[];
341 static const char kLogMobilizationSamples[];
342 static const char kLogRewriteTiming[];
343 static const char kLogUrlIndices[];
344 static const char kLowercaseHtmlNames[];
345 static const char kMaxCacheableResponseContentLength[];
346 static const char kMaxCombinedCssBytes[];
347 static const char kMaxCombinedJsBytes[];
348 static const char kMaxHtmlCacheTimeMs[];
349 static const char kMaxHtmlParseBytes[];
350 static const char kMaxImageSizeLowResolutionBytes[];
351 static const char kMaxInlinedPreviewImagesIndex[];
352 static const char kMaxLowResImageSizeBytes[];
353 static const char kMaxLowResToHighResImageSizePercentage[];
354 static const char kMaxRewriteInfoLogSize[];
355 static const char kMaxUrlSegmentSize[];
356 static const char kMaxUrlSize[];
357 static const char kMetadataCacheStalenessThresholdMs[];
358 static const char kMinImageSizeLowResolutionBytes[];
359 static const char kMinResourceCacheTimeToRewriteMs[];
360 static const char kModifyCachingHeaders[];
361 static const char kNoop[];
362 static const char kNoTransformOptimizedImages[];
363 static const char kNonCacheablesForCachePartialHtml[];
364 static const char kObliviousPagespeedUrls[];
365 static const char kOptionCookiesDurationMs[];
366 static const char kOverrideCachingTtlMs[];
367 static const char kPreserveSubresourceHints[];
368 static const char kPreserveUrlRelativity[];
369 static const char kPrivateNotVaryForIE[];
370 static const char kProactiveResourceFreshening[];
371 static const char kProactivelyFreshenUserFacingRequest[];
372 static const char kProgressiveJpegMinBytes[];
373 static const char kPubliclyCacheMismatchedHashesExperimental[];
374 static const char kRejectBlacklistedStatusCode[];
375 static const char kRejectBlacklisted[];
376 static const char kRemoteConfigurationTimeoutMs[];
377 static const char kRemoteConfigurationUrl[];
378 static const char kReportUnloadTime[];
379 static const char kRequestOptionOverride[];
380 static const char kRespectVary[];
381 static const char kRespectXForwardedProto[];
382 static const char kResponsiveImageDensities[];
383 static const char kRewriteDeadlineMs[];
384 static const char kRewriteLevel[];
385 static const char kRewriteRandomDropPercentage[];
386 static const char kRewriteUncacheableResources[];
387 static const char kRunningExperiment[];
388 static const char kServeStaleIfFetchError[];
389 static const char kServeStaleWhileRevalidateThresholdSec[];
390 static const char kServeXhrAccessControlHeaders[];
391 static const char kStickyQueryParameters[];
392 static const char kSupportNoScriptEnabled[];
393 static const char kTestOnlyPrioritizeCriticalCssDontApplyOriginalCss[];
394 static const char kUrlSigningKey[];
395 static const char kUseAnalyticsJs[];
396 static const char kUseBlankImageForInlinePreview[];
397 static const char kUseExperimentalJsMinifier[];
398 static const char kUseFallbackPropertyCacheValues[];
399 static const char kUseImageScanlineApi[];
400 static const char kXModPagespeedHeaderValue[];
401 static const char kXPsaBlockingRewrite[];
404 static const char kBlockingRewriteRefererUrls[];
405 static const char kDisableFilters[];
406 static const char kDisallow[];
407 static const char kDomain[];
408 static const char kDownstreamCachePurgeLocationPrefix[];
409 static const char kEnableFilters[];
410 static const char kExperimentVariable[];
411 static const char kExperimentSpec[];
412 static const char kForbidFilters[];
413 static const char kInlineResourcesWithoutExplicitAuthorization[];
414 static const char kRetainComment[];
415 static const char kPermitIdsForCssCombining[];
418 static const char kCustomFetchHeader[];
419 static const char kLoadFromFile[];
420 static const char kLoadFromFileMatch[];
421 static const char kLoadFromFileRule[];
422 static const char kLoadFromFileRuleMatch[];
423 static const char kMapOriginDomain[];
424 static const char kMapProxyDomain[];
425 static const char kMapRewriteDomain[];
426 static const char kShardDomain[];
429 static const char kUrlValuedAttribute[];
433 static const char kCacheFlushPollIntervalSec[];
434 static const char kCompressMetadataCache[];
435 static const char kFetcherProxy[];
436 static const char kFetchHttps[];
437 static const char kFileCacheCleanInodeLimit[];
438 static const char kFileCacheCleanIntervalMs[];
439 static const char kFileCacheCleanSizeKb[];
440 static const char kFileCachePath[];
441 static const char kLogDir[];
442 static const char kLruCacheByteLimit[];
443 static const char kLruCacheKbPerProcess[];
444 static const char kMemcachedServers[];
445 static const char kMemcachedThreads[];
446 static const char kMemcachedTimeoutUs[];
447 static const char kProxySuffix[];
448 static const char kRateLimitBackgroundFetches[];
449 static const char kServeWebpToAnyAgent[];
450 static const char kSlurpDirectory[];
451 static const char kSlurpFlushLimit[];
452 static const char kSlurpReadOnly[];
453 static const char kSslCertDirectory[];
454 static const char kSslCertFile[];
455 static const char kStatisticsEnabled[];
456 static const char kStatisticsLoggingChartsCSS[];
457 static const char kStatisticsLoggingChartsJS[];
458 static const char kStatisticsLoggingEnabled[];
459 static const char kStatisticsLoggingIntervalMs[];
460 static const char kStatisticsLoggingMaxFileSizeKb[];
461 static const char kTestProxy[];
462 static const char kTestProxySlurp[];
463 static const char kUseSharedMemLocking[];
488 Color background_color;
489 Color foreground_color;
494 NameValue(StringPiece name_in, StringPiece value_in) {
495 name_in.CopyToString(&name);
496 value_in.CopyToString(&value);
511 static const char kAutoString[];
515 allow_accept_(false),
516 allow_save_data_(false),
517 allow_user_agent_(false) {
522 bool allow_auto()
const {
525 void set_allow_auto(
bool v) {
528 bool allow_accept()
const {
529 return allow_accept_;
531 void set_allow_accept(
bool v) {
534 bool allow_save_data()
const {
535 return allow_save_data_ || allow_auto_;
537 void set_allow_save_data(
bool v) {
538 allow_save_data_ = v;
540 bool allow_user_agent()
const {
541 return allow_user_agent_;
543 void set_allow_user_agent(
bool v) {
544 allow_user_agent_ = v;
552 bool allow_save_data_;
553 bool allow_user_agent_;
556 bool AllowVaryOnAuto()
const {
557 return allow_vary_on_.value().allow_auto();
559 bool AllowVaryOnAccept()
const {
560 return allow_vary_on_.value().allow_accept();
562 bool AllowVaryOnSaveData()
const {
563 return allow_vary_on_.value().allow_save_data();
565 bool AllowVaryOnUserAgent()
const {
566 return allow_vary_on_.value().allow_user_agent();
569 return ToString(allow_vary_on_.value());
579 void set_allow_vary_on(
const AllowVaryOn& x) {
585 int64 ImageJpegQualityForSmallScreen()
const;
586 int64 ImageJpegQualityForSaveData()
const;
587 int64 ImageWebpQuality()
const;
588 int64 ImageWebpQualityForSmallScreen()
const;
589 int64 ImageWebpQualityForSaveData()
const;
590 int64 ImageWebpAnimatedQuality()
const;
591 int64 ImageJpegNumProgressiveScansForSmallScreen()
const;
643 static const char kCacheExtenderId[];
644 static const char kCssCombinerId[];
645 static const char kCssFilterId[];
646 static const char kCssImportFlattenerId[];
647 static const char kCssInlineId[];
648 static const char kGoogleFontCssInlineId[];
649 static const char kImageCombineId[];
650 static const char kImageCompressionId[];
651 static const char kInPlaceRewriteId[];
652 static const char kJavascriptCombinerId[];
653 static const char kJavascriptInlineId[];
654 static const char kJavascriptMinId[];
655 static const char kJavascriptMinSourceMapId[];
656 static const char kLocalStorageCacheId[];
657 static const char kPrioritizeCriticalCssId[];
675 typedef std::vector<Filter> FilterVector;
691 typedef std::set<OptionStringPair> OptionSet;
700 option_name_(option_name),
702 do_not_use_for_signature_computation_(
false),
711 void set_do_not_use_for_signature_computation(
bool x) {
712 do_not_use_for_signature_computation_ = x;
714 bool is_used_for_signature_computation()
const {
715 return !do_not_use_for_signature_computation_;
721 void set_help_text(
const char* x) { help_text_ = x; }
722 const char* help_text()
const {
return help_text_; }
724 void set_index(
int index) { index_ = index; }
725 const char* id()
const {
return id_; }
726 StringPiece option_name()
const {
return option_name_; }
727 int index()
const {
return index_; }
729 bool safe_to_print()
const {
return safe_to_print_; }
730 void set_safe_to_print(
bool safe_to_print) {
731 safe_to_print_ = safe_to_print;
736 const char* help_text_;
737 StringPiece option_name_;
739 bool do_not_use_for_signature_computation_;
746 typedef std::vector<PropertyBase*> PropertyVector;
760 virtual void Merge(
const OptionBase* src) = 0;
761 virtual bool was_set()
const = 0;
764 const char* id()
const {
return property()->id(); }
765 const char* help_text()
const {
return property()->help_text(); }
766 OptionScope scope()
const {
return property()->scope(); }
767 StringPiece option_name()
const {
return property()->option_name(); }
768 bool is_used_for_signature_computation()
const {
769 return property()->is_used_for_signature_computation();
819 static const char kDefaultAllowVaryOn[];
820 static const int kDefaultBeaconReinstrumentTimeSec;
821 static const int64 kDefaultCssFlattenMaxBytes;
822 static const int64 kDefaultCssImageInlineMaxBytes;
823 static const int64 kDefaultCssInlineMaxBytes;
824 static const int64 kDefaultCssOutlineMinBytes;
825 static const int64 kDefaultGoogleFontCssInlineMaxBytes;
826 static const int64 kDefaultImageInlineMaxBytes;
827 static const int64 kDefaultJsInlineMaxBytes;
828 static const int64 kDefaultJsOutlineMinBytes;
829 static const int64 kDefaultProgressiveJpegMinBytes;
830 static const int64 kDefaultMaxCacheableResponseContentLength;
831 static const int64 kDefaultMaxHtmlCacheTimeMs;
832 static const int64 kDefaultMaxHtmlParseBytes;
833 static const int64 kDefaultMaxLowResImageSizeBytes;
834 static const int kDefaultMaxLowResToFullResImageSizePercentage;
835 static const int64 kDefaultMetadataInputErrorsCacheTtlMs;
836 static const int64 kDefaultMinResourceCacheTimeToRewriteMs;
837 static const char kDefaultDownstreamCachePurgeMethod[];
838 static const int64 kDefaultDownstreamCacheRewrittenPercentageThreshold;
839 static const int64 kDefaultIdleFlushTimeMs;
840 static const int64 kDefaultFlushBufferLimitBytes;
841 static const int64 kDefaultImplicitCacheTtlMs;
842 static const int64 kDefaultPrioritizeVisibleContentCacheTimeMs;
843 static const char kDefaultBeaconUrl[];
844 static const int64 kDefaultImageRecompressQuality;
845 static const int64 kDefaultImageJpegQualityForSaveData;
846 static const int64 kDefaultImageJpegRecompressQuality;
847 static const int64 kDefaultImageJpegRecompressQualityForSmallScreens;
848 static const int kDefaultImageLimitOptimizedPercent;
849 static const int kDefaultImageLimitRenderedAreaPercent;
850 static const int kDefaultImageLimitResizeAreaPercent;
851 static const int64 kDefaultImageResolutionLimitBytes;
852 static const int64 kDefaultImageJpegNumProgressiveScans;
853 static const int64 kDefaultImageWebpQualityForSaveData;
854 static const int64 kDefaultImageWebpRecompressQuality;
855 static const int64 kDefaultImageWebpAnimatedRecompressQuality;
856 static const int64 kDefaultImageWebpRecompressQualityForSmallScreens;
857 static const int64 kDefaultImageWebpTimeoutMs;
858 static const int kDefaultDomainShardCount;
859 static const int64 kDefaultOptionCookiesDurationMs;
860 static const int64 kDefaultLoadFromFileCacheTtlMs;
861 static const double kDefaultResponsiveImageDensities[];
867 static const int kDefaultImageMaxRewritesAtOnce;
906 static const int kDefaultExperimentTrafficPercent;
910 static const char kDefaultBlockingRewriteKey[];
912 static const char kRejectedRequestUrlKeyName[];
914 static const int kDefaultPropertyCacheHttpStatusStabilityThreshold;
916 static const int kDefaultMaxRewriteInfoLogSize;
943 bool is_valid()
const {
return id_ >= 0; }
946 int id()
const {
return id_; }
947 int percent()
const {
return percent_; }
949 int slot()
const {
return ga_variable_slot_; }
950 RewriteLevel rewrite_level()
const {
return rewrite_level_; }
951 FilterSet enabled_filters()
const {
return enabled_filters_; }
952 FilterSet disabled_filters()
const {
return disabled_filters_; }
953 OptionSet filter_options()
const {
return filter_options_; }
955 bool use_default()
const {
return use_default_; }
960 MessageHandler* handler)
const;
969 typedef std::bitset<net_instaweb::UserAgentMatcher::kEndOfDeviceType>
972 static bool ParseDeviceTypeBitSet(
const StringPiece& in,
973 DeviceTypeBitSet* out,
974 MessageHandler* handler);
977 StringVector serving_domains;
1009 FRIEND_TEST(RewriteOptionsTest, ExperimentMergeTest);
1010 FRIEND_TEST(RewriteOptionsTest, DeviceTypeMergeTest);
1011 FRIEND_TEST(RewriteOptionsTest, AlternateOriginDomainMergeTest);
1015 void Initialize(
const StringPiece& spec,
MessageHandler* handler);
1023 int ga_variable_slot_;
1028 OptionSet filter_options_;
1038 typedef std::vector<AlternateOriginDomainSpec> AlternateOriginDomains;
1039 AlternateOriginDomains alternate_origin_domains_;
1048 semantic_type::Category category;
1080 int size()
const {
return property_vector_.size(); }
1083 return property_vector_[index];
1085 PropertyBase* property(
int index) {
return property_vector_[index]; }
1092 void Merge(Properties* properties);
1094 void push_back(PropertyBase* p) { property_vector_.push_back(p); }
1105 int initialization_count_;
1111 bool owns_properties_;
1112 PropertyVector property_vector_;
1118 const char* filter_id;
1119 const char* filter_name;
1122 static bool ParseRewriteLevel(
const StringPiece& in,
RewriteLevel* out);
1124 typedef std::set<semantic_type::Category> ResourceCategorySet;
1126 static bool ParseInlineUnauthorizedResourceType(
1127 const StringPiece& in,
1128 ResourceCategorySet* resource_types);
1147 static bool Terminate();
1173 bool modified()
const {
return modified_; }
1182 level_.set_default(level);
1201 const StringPiece& value,
1208 const NameValue* resource_header(
int i)
const {
1209 return resource_headers_[i];
1212 int num_resource_headers()
const {
1213 return resource_headers_.size();
1219 const NameValue* custom_fetch_header(
int i)
const {
1220 return custom_fetch_headers_[i];
1223 int num_custom_fetch_headers()
const {
1224 return custom_fetch_headers_.size();
1239 MessageHandler* handler);
1255 int experiment_id()
const {
return experiment_id_; }
1257 int experiment_spec_id(
int i)
const {
1258 return experiment_specs_[i]->id();
1267 ExperimentSpec* experiment_spec(
int i)
const {
1268 return experiment_specs_[i];
1271 int num_experiments()
const {
return experiment_specs_.size(); }
1273 bool enroll_experiment()
const {
1274 return enroll_experiment_id() != experiment::kForceNoExperiment;
1289 const StringPiece& attribute,
1290 semantic_type::Category category);
1295 StringPiece* element,
1296 StringPiece* attribute,
1297 semantic_type::Category* category)
const;
1299 int num_url_valued_attributes()
const {
1300 if (url_valued_attributes_ == NULL) {
1303 return url_valued_attributes_->size();
1307 void AddInlineUnauthorizedResourceType(semantic_type::Category category);
1308 bool HasInlineUnauthorizedResourceType(
1309 semantic_type::Category category)
const;
1310 void ClearInlineUnauthorizedResourceTypes();
1311 void set_inline_unauthorized_resource_types(ResourceCategorySet x);
1315 uint64 bytes, StringPiece md5_hash, StringPiece canonical_url) {
1317 bytes, md5_hash, canonical_url);
1324 if (Enabled(kCanonicalizeJavascriptLibraries)) {
1325 return javascript_library_identification_.get();
1338 MessageHandler* handler);
1344 MessageHandler* handler);
1350 MessageHandler* handler);
1356 MessageHandler* handler);
1377 void DisableFilter(
Filter filter);
1378 void DisableIfNotExplictlyEnabled(
Filter filter);
1379 void ForbidFilter(
Filter filter);
1380 void EnableFilters(
const FilterSet& filter_set);
1381 void DisableFilters(
const FilterSet& filter_set);
1382 void ForbidFilters(
const FilterSet& filter_set);
1410 bool Enabled(
Filter filter)
const;
1411 bool Forbidden(
Filter filter)
const;
1412 bool Forbidden(StringPiece filter_id)
const;
1436 const StringPiece& options, OptionSet* set, MessageHandler* handler);
1443 StringPiece name, StringPiece value,
GoogleString* msg);
1447 StringPiece name, StringPiece value);
1470 StringPiece name, StringPiece arg,
1477 StringPiece name, StringPiece arg,
OptionScope max_scope,
1481 StringPiece name, StringPiece arg1, StringPiece arg2,
1485 StringPiece name, StringPiece arg1, StringPiece arg2, StringPiece arg3,
1493 bool OptionValue(StringPiece option_name,
const char**
id,
1504 MessageHandler* handler);
1514 return StringToInt64(value_string, value);
1516 static bool ParseFromString(StringPiece value_string,
double* value) {
1520 value_string.CopyToString(value);
1524 return ParseRewriteLevel(value_string, value);
1527 ResourceCategorySet* value) {
1528 return ParseInlineUnauthorizedResourceType(value_string, value);
1530 static bool ParseFromString(StringPiece value_string, BeaconUrl* value) {
1534 static bool ParseFromString(StringPiece value_string, MobTheme* theme);
1536 ResponsiveDensities* value);
1538 protobuf::MessageLite* proto);
1540 AllowVaryOn* allow_vary_on);
1545 void set_css_outline_min_bytes(int64 x) {
1549 const GoogleString& ga_id()
const {
return ga_id_.value(); }
1554 void set_content_experiment_id(
const GoogleString& s) {
1558 return content_experiment_id_.value();
1561 void set_content_experiment_variant_id(
const GoogleString& s) {
1562 set_option(s, &content_experiment_variant_id_);
1564 const GoogleString& content_experiment_variant_id()
const {
1565 return content_experiment_variant_id_.value();
1568 bool is_content_experiment()
const {
1569 return !content_experiment_id().empty() &&
1570 !content_experiment_variant_id().empty();
1573 bool use_analytics_js()
const {
1574 return use_analytics_js_.value();
1576 void set_use_analytics_js(
bool x) {
1580 bool increase_speed_tracking()
const {
1581 return increase_speed_tracking_.value();
1583 void set_increase_speed_tracking(
bool x) {
1587 int64 js_outline_min_bytes()
const {
return js_outline_min_bytes_.value(); }
1588 void set_js_outline_min_bytes(int64 x) {
1592 int64 progressive_jpeg_min_bytes()
const {
1593 return progressive_jpeg_min_bytes_.value();
1595 void set_progressive_jpeg_min_bytes(int64 x) {
1599 int64 css_flatten_max_bytes()
const {
return css_flatten_max_bytes_.value(); }
1600 void set_css_flatten_max_bytes(int64 x) {
1603 bool cache_small_images_unrewritten()
const {
1604 return cache_small_images_unrewritten_.value();
1606 void set_cache_small_images_unrewritten(
bool x) {
1607 set_option(x, &cache_small_images_unrewritten_);
1609 int64 image_resolution_limit_bytes()
const {
1610 return image_resolution_limit_bytes_.value();
1612 void set_image_resolution_limit_bytes(int64 x) {
1613 set_option(x, &image_resolution_limit_bytes_);
1618 void set_image_inline_max_bytes(int64 x);
1621 void set_css_image_inline_max_bytes(int64 x) {
1626 int64 css_inline_max_bytes()
const {
return css_inline_max_bytes_.value(); }
1627 void set_css_inline_max_bytes(int64 x) {
1630 int64 google_font_css_inline_max_bytes()
const {
1631 return google_font_css_inline_max_bytes_.value();
1633 void set_google_font_css_inline_max_bytes(int64 x) {
1634 set_option(x, &google_font_css_inline_max_bytes_);
1636 int64 js_inline_max_bytes()
const {
return js_inline_max_bytes_.value(); }
1637 void set_js_inline_max_bytes(int64 x) {
1640 int64 max_html_cache_time_ms()
const {
1641 return max_html_cache_time_ms_.value();
1643 void set_max_html_cache_time_ms(int64 x) {
1646 int64 max_html_parse_bytes()
const {
1647 return max_html_parse_bytes_.value();
1649 void set_max_html_parse_bytes(int64 x) {
1652 int64 max_cacheable_response_content_length()
const {
1653 return max_cacheable_response_content_length_.value();
1655 void set_max_cacheable_response_content_length(int64 x) {
1656 set_option(x, &max_cacheable_response_content_length_);
1658 int64 min_resource_cache_time_to_rewrite_ms()
const {
1659 return min_resource_cache_time_to_rewrite_ms_.value();
1661 void set_min_resource_cache_time_to_rewrite_ms(int64 x) {
1662 set_option(x, &min_resource_cache_time_to_rewrite_ms_);
1664 bool need_to_store_experiment_data()
const {
1665 return need_to_store_experiment_data_;
1667 void set_need_to_store_experiment_data(
bool x) {
1668 need_to_store_experiment_data_ = x;
1671 int64 blocking_fetch_timeout_ms()
const {
1672 return blocking_fetch_timeout_ms_.value();
1674 void set_blocking_fetch_timeout_ms(int64 x) {
1677 bool override_ie_document_mode()
const {
1678 return override_ie_document_mode_.value();
1680 void set_override_ie_document_mode(
bool x) {
1684 bool preserve_subresource_hints()
const {
1685 return preserve_subresource_hints_.value();
1687 void set_preserve_subresource_hints(
bool x) {
1692 bool preserve_url_relativity()
const {
1693 return preserve_url_relativity_.value();
1695 void set_preserve_url_relativity(
bool x) {
1716 bool search_wildcards)
const;
1736 bool ignores_metadata_and_pcache);
1739 void PurgeUrl(StringPiece url, int64 timestamp_ms);
1748 cache_purge_mutex_.reset(lock);
1771 LOCKS_EXCLUDED(cache_purge_mutex_.get());
1777 LOCKS_EXCLUDED(cache_purge_mutex_.get());
1786 return idle_flush_time_ms_.value();
1788 void set_idle_flush_time_ms(int64 x) {
1794 return flush_buffer_limit_bytes_.value();
1797 void set_flush_buffer_limit_bytes(int64 x) {
1804 void set_max_url_segment_size(
int x) {
1808 int image_max_rewrites_at_once()
const {
1809 return image_max_rewrites_at_once_.value();
1811 void set_image_max_rewrites_at_once(
int x) {
1817 void set_max_url_size(
int x) {
1821 int rewrite_deadline_ms()
const {
return rewrite_deadline_ms_.value(); }
1822 void set_rewrite_deadline_ms(
int x) {
1826 bool test_instant_fetch_rewrite_deadline()
const {
1827 return test_instant_fetch_rewrite_deadline_.value();
1829 void set_test_instant_fetch_rewrite_deadline(
bool x) {
1830 set_option(x, &test_instant_fetch_rewrite_deadline_);
1833 void set_test_only_prioritize_critical_css_dont_apply_original_css(
bool x) {
1834 set_option(x, &test_only_prioritize_critical_css_dont_apply_original_css_);
1836 bool test_only_prioritize_critical_css_dont_apply_original_css()
const {
1837 return test_only_prioritize_critical_css_dont_apply_original_css_.value();
1840 int domain_shard_count()
const {
return domain_shard_count_.value(); }
1851 bool enabled()
const {
1854 bool unplugged()
const {
1857 bool standby()
const {
1858 return !enabled() && !unplugged();
1861 void set_add_options_to_urls(
bool x) {
1865 bool add_options_to_urls()
const {
1866 return add_options_to_urls_.value();
1869 void set_publicly_cache_mismatched_hashes_experimental(
bool x) {
1870 set_option(x, &publicly_cache_mismatched_hashes_experimental_);
1873 bool publicly_cache_mismatched_hashes_experimental()
const {
1874 return publicly_cache_mismatched_hashes_experimental_.value();
1877 void set_oblivious_pagespeed_urls(
bool x) {
1881 bool oblivious_pagespeed_urls()
const {
1882 return oblivious_pagespeed_urls_.value();
1885 void set_in_place_rewriting_enabled(
bool x) {
1889 bool in_place_rewriting_enabled()
const {
1890 return CheckBandwidthOption(in_place_rewriting_enabled_);
1893 void set_in_place_wait_for_optimized(
bool x) {
1894 set_option(x, &in_place_wait_for_optimized_);
1897 bool in_place_wait_for_optimized()
const {
1898 return (in_place_wait_for_optimized_.value() ||
1899 (in_place_rewrite_deadline_ms() < 0));
1902 void set_in_place_rewrite_deadline_ms(
int x) {
1903 set_option(x, &in_place_rewrite_deadline_ms_);
1906 int in_place_rewrite_deadline_ms()
const {
1907 return in_place_rewrite_deadline_ms_.value();
1910 void set_in_place_s_maxage_sec(
int x) {
1914 int in_place_s_maxage_sec()
const {
1915 return in_place_s_maxage_sec_.value();
1918 int EffectiveInPlaceSMaxAgeSec()
const {
1919 return modify_caching_headers() ? in_place_s_maxage_sec() : -1;
1922 void set_in_place_preemptive_rewrite_css(
bool x) {
1923 set_option(x, &in_place_preemptive_rewrite_css_);
1925 bool in_place_preemptive_rewrite_css()
const {
1926 return CheckBandwidthOption(in_place_preemptive_rewrite_css_);
1929 void set_in_place_preemptive_rewrite_css_images(
bool x) {
1930 set_option(x, &in_place_preemptive_rewrite_css_images_);
1932 bool in_place_preemptive_rewrite_css_images()
const {
1933 return CheckBandwidthOption(in_place_preemptive_rewrite_css_images_);
1936 void set_in_place_preemptive_rewrite_images(
bool x) {
1937 set_option(x, &in_place_preemptive_rewrite_images_);
1939 bool in_place_preemptive_rewrite_images()
const {
1940 return CheckBandwidthOption(in_place_preemptive_rewrite_images_);
1943 void set_in_place_preemptive_rewrite_javascript(
bool x) {
1944 set_option(x, &in_place_preemptive_rewrite_javascript_);
1946 bool in_place_preemptive_rewrite_javascript()
const {
1947 return CheckBandwidthOption(in_place_preemptive_rewrite_javascript_);
1950 void set_private_not_vary_for_ie(
bool x) {
1953 bool private_not_vary_for_ie()
const {
1954 return private_not_vary_for_ie_.value();
1957 void set_combine_across_paths(
bool x) {
1960 bool combine_across_paths()
const {
return combine_across_paths_.value(); }
1962 void set_log_background_rewrites(
bool x) {
1965 bool log_background_rewrites()
const {
1966 return log_background_rewrites_.value();
1969 void set_log_mobilization_samples(
bool x) {
1972 bool log_mobilization_samples()
const {
1973 return log_mobilization_samples_.value();
1976 void set_log_rewrite_timing(
bool x) {
1979 bool log_rewrite_timing()
const {
return log_rewrite_timing_.value(); }
1981 void set_log_url_indices(
bool x) {
1984 bool log_url_indices()
const {
return log_url_indices_.value(); }
1986 void set_lowercase_html_names(
bool x) {
1989 bool lowercase_html_names()
const {
return lowercase_html_names_.value(); }
1991 void set_always_rewrite_css(
bool x) {
1994 bool always_rewrite_css()
const {
return always_rewrite_css_.value(); }
1996 void set_respect_vary(
bool x) {
1999 bool respect_vary()
const {
return respect_vary_.value(); }
2001 void set_respect_x_forwarded_proto(
bool x) {
2004 bool respect_x_forwarded_proto()
const {
2005 return respect_x_forwarded_proto_.value();
2008 void set_flush_html(
bool x) {
set_option(x, &flush_html_); }
2009 bool flush_html()
const {
return flush_html_.value(); }
2011 void set_serve_stale_if_fetch_error(
bool x) {
2014 bool serve_stale_if_fetch_error()
const {
2015 return serve_stale_if_fetch_error_.value();
2018 void set_serve_xhr_access_control_headers(
bool x) {
2019 set_option(x, &serve_xhr_access_control_headers_);
2021 bool serve_xhr_access_control_headers()
const {
2022 return serve_xhr_access_control_headers_.value();
2025 void set_proactively_freshen_user_facing_request(
bool x) {
2026 set_option(x, &proactively_freshen_user_facing_request_);
2028 bool proactively_freshen_user_facing_request()
const {
2029 return proactively_freshen_user_facing_request_.value();
2032 void set_serve_stale_while_revalidate_threshold_sec(int64 x) {
2033 set_option(x, &serve_stale_while_revalidate_threshold_sec_);
2035 int64 serve_stale_while_revalidate_threshold_sec()
const {
2036 return serve_stale_while_revalidate_threshold_sec_.value();
2039 void set_default_cache_html(
bool x) {
set_option(x, &default_cache_html_); }
2040 bool default_cache_html()
const {
return default_cache_html_.value(); }
2042 void set_modify_caching_headers(
bool x) {
2045 bool modify_caching_headers()
const {
2046 return modify_caching_headers_.value();
2049 void set_inline_only_critical_images(
bool x) {
2050 set_option(x, &inline_only_critical_images_);
2052 bool inline_only_critical_images()
const {
2053 return inline_only_critical_images_.value();
2056 void set_critical_images_beacon_enabled(
bool x) {
2057 set_option(x, &critical_images_beacon_enabled_);
2059 bool critical_images_beacon_enabled()
const {
2060 return critical_images_beacon_enabled_.value();
2063 void set_beacon_reinstrument_time_sec(
int x) {
2064 set_option(x, &beacon_reinstrument_time_sec_);
2066 int beacon_reinstrument_time_sec()
const {
2067 return beacon_reinstrument_time_sec_.value();
2070 void set_accept_invalid_signatures(
bool x) {
2073 bool accept_invalid_signatures()
const {
2074 return accept_invalid_signatures_.value();
2077 void set_remote_configuration_timeout_ms(int64 x) {
2078 set_option(x, &remote_configuration_timeout_ms_);
2080 int64 remote_configuration_timeout_ms()
const {
2081 return remote_configuration_timeout_ms_.value();
2084 void set_remote_configuration_url(StringPiece p) {
2088 return remote_configuration_url_.value();
2091 void set_http_cache_compression_level(
int x) {
2092 set_option(x, &http_cache_compression_level_);
2094 int http_cache_compression_level()
const {
2095 return http_cache_compression_level_.value();
2098 void set_request_option_override(StringPiece p) {
2102 return request_option_override_.value();
2105 void set_url_signing_key(StringPiece p) {
2109 return url_signing_key_.value();
2112 void set_lazyload_images_after_onload(
bool x) {
2113 set_option(x, &lazyload_images_after_onload_);
2115 bool lazyload_images_after_onload()
const {
2116 return lazyload_images_after_onload_.value();
2119 void set_lazyload_images_blank_url(StringPiece p) {
2122 const GoogleString& lazyload_images_blank_url()
const {
2123 return lazyload_images_blank_url_.value();
2126 void set_max_inlined_preview_images_index(
int x) {
2127 set_option(x, &max_inlined_preview_images_index_);
2129 int max_inlined_preview_images_index()
const {
2130 return max_inlined_preview_images_index_.value();
2133 void set_use_blank_image_for_inline_preview(
bool x) {
2134 set_option(x, &use_blank_image_for_inline_preview_);
2136 bool use_blank_image_for_inline_preview()
const {
2137 return use_blank_image_for_inline_preview_.value();
2140 void set_min_image_size_low_resolution_bytes(int64 x) {
2141 set_option(x, &min_image_size_low_resolution_bytes_);
2143 int64 min_image_size_low_resolution_bytes()
const {
2144 return min_image_size_low_resolution_bytes_.value();
2147 void set_max_image_size_low_resolution_bytes(int64 x) {
2148 set_option(x, &max_image_size_low_resolution_bytes_);
2150 int64 max_image_size_low_resolution_bytes()
const {
2151 return max_image_size_low_resolution_bytes_.value();
2154 void set_experiment_cookie_duration_ms(int64 x) {
2155 set_option(x, &experiment_cookie_duration_ms_);
2157 int64 experiment_cookie_duration_ms()
const {
2158 return experiment_cookie_duration_ms_.value();
2161 void set_finder_properties_cache_expiration_time_ms(int64 x) {
2162 set_option(x, &finder_properties_cache_expiration_time_ms_);
2164 int64 finder_properties_cache_expiration_time_ms()
const {
2165 return finder_properties_cache_expiration_time_ms_.value();
2168 void set_finder_properties_cache_refresh_time_ms(int64 x) {
2169 set_option(x, &finder_properties_cache_refresh_time_ms_);
2171 int64 finder_properties_cache_refresh_time_ms()
const {
2172 return finder_properties_cache_refresh_time_ms_.value();
2175 void set_rewrite_random_drop_percentage(
int x) {
2176 set_option(x, &rewrite_random_drop_percentage_);
2178 int rewrite_random_drop_percentage()
const {
2179 return rewrite_random_drop_percentage_.value();
2189 return (CheckBandwidthOption(css_preserve_urls_) ||
2190 CheckMobilizeFiltersOption(css_preserve_urls_));
2192 void set_css_preserve_urls(
bool x) {
2196 bool image_preserve_urls()
const {
2197 return CheckBandwidthOption(image_preserve_urls_);
2199 void set_image_preserve_urls(
bool x) {
2203 bool js_preserve_urls()
const {
2204 return CheckBandwidthOption(js_preserve_urls_);
2206 void set_js_preserve_urls(
bool x) {
2210 void set_metadata_cache_staleness_threshold_ms(int64 x) {
2211 set_option(x, &metadata_cache_staleness_threshold_ms_);
2213 int64 metadata_cache_staleness_threshold_ms()
const {
2214 return metadata_cache_staleness_threshold_ms_.value();
2217 void set_metadata_input_errors_cache_ttl_ms(int64 x) {
2218 set_option(x, &metadata_input_errors_cache_ttl_ms_);
2220 int64 metadata_input_errors_cache_ttl_ms()
const {
2221 return metadata_input_errors_cache_ttl_ms_.value();
2224 const GoogleString& downstream_cache_purge_method()
const {
2225 return downstream_cache_purge_method_.value();
2227 void set_downstream_cache_purge_method(StringPiece p) {
2228 set_option(p.as_string(), &downstream_cache_purge_method_);
2231 const GoogleString& downstream_cache_purge_location_prefix()
const {
2232 return downstream_cache_purge_location_prefix_.value();
2237 while (p.ends_with(
"/")) {
2240 set_option(p.as_string(), &downstream_cache_purge_location_prefix_);
2242 bool IsDownstreamCacheIntegrationEnabled()
const {
2243 return !downstream_cache_purge_location_prefix().empty();
2246 void set_downstream_cache_rebeaconing_key(StringPiece p) {
2247 set_option(p.as_string(), &downstream_cache_rebeaconing_key_);
2249 const GoogleString& downstream_cache_rebeaconing_key()
const {
2250 return downstream_cache_rebeaconing_key_.value();
2252 bool IsDownstreamCacheRebeaconingKeyConfigured()
const {
2253 return !downstream_cache_rebeaconing_key().empty();
2258 if (!IsDownstreamCacheRebeaconingKeyConfigured()) {
2261 return StringCaseEqual(key, downstream_cache_rebeaconing_key());
2264 void set_downstream_cache_rewritten_percentage_threshold(int64 x) {
2265 set_option(x, &downstream_cache_rewritten_percentage_threshold_);
2267 int64 downstream_cache_rewritten_percentage_threshold()
const {
2268 return downstream_cache_rewritten_percentage_threshold_.value();
2271 const BeaconUrl& beacon_url()
const {
return beacon_url_.value(); }
2274 beacon_url_.SetFromString(beacon_url, &ignored_error_detail);
2280 void set_image_jpeg_recompress_quality(int64 x) {
2281 set_option(x, &image_jpeg_recompress_quality_);
2284 void set_image_jpeg_recompress_quality_for_small_screens(int64 x) {
2285 set_option(x, &image_jpeg_recompress_quality_for_small_screens_);
2288 void set_image_jpeg_quality_for_save_data(int64 x) {
2289 set_option(x, &image_jpeg_quality_for_save_data_);
2292 int64 image_recompress_quality()
const {
2293 return image_recompress_quality_.value();
2295 void set_image_recompress_quality(int64 x) {
2299 int image_limit_optimized_percent()
const {
2300 return image_limit_optimized_percent_.value();
2302 void set_image_limit_optimized_percent(
int x) {
2303 set_option(x, &image_limit_optimized_percent_);
2305 int image_limit_resize_area_percent()
const {
2306 return image_limit_resize_area_percent_.value();
2308 void set_image_limit_resize_area_percent(
int x) {
2309 set_option(x, &image_limit_resize_area_percent_);
2312 int image_limit_rendered_area_percent()
const {
2313 return image_limit_rendered_area_percent_.value();
2315 void set_image_limit_rendered_area_percent(
int x) {
2316 set_option(x, &image_limit_rendered_area_percent_);
2319 int64 image_jpeg_num_progressive_scans()
const {
2320 return image_jpeg_num_progressive_scans_.value();
2322 void set_image_jpeg_num_progressive_scans(int64 x) {
2323 set_option(x, &image_jpeg_num_progressive_scans_);
2326 void set_image_jpeg_num_progressive_scans_for_small_screens(int64 x) {
2327 set_option(x, &image_jpeg_num_progressive_scans_for_small_screens_);
2330 void set_image_webp_recompress_quality(int64 x) {
2331 set_option(x, &image_webp_recompress_quality_);
2334 void set_image_webp_recompress_quality_for_small_screens(int64 x) {
2335 set_option(x, &image_webp_recompress_quality_for_small_screens_);
2338 void set_image_webp_animated_recompress_quality(int64 x) {
2339 set_option(x, &image_webp_animated_recompress_quality_);
2342 void set_image_webp_quality_for_save_data(int64 x) {
2343 set_option(x, &image_webp_quality_for_save_data_);
2346 int64 image_webp_timeout_ms()
const {
2347 return image_webp_timeout_ms_.value();
2349 void set_image_webp_timeout_ms(int64 x) {
2353 bool domain_rewrite_hyperlinks()
const {
2354 return CheckMobilizeFiltersOption(domain_rewrite_hyperlinks_);
2356 void set_domain_rewrite_hyperlinks(
bool x) {
2360 bool domain_rewrite_cookies()
const {
2361 return CheckMobilizeFiltersOption(domain_rewrite_cookies_);
2363 void set_domain_rewrite_cookies(
bool x) {
2367 bool client_domain_rewrite()
const {
2368 return client_domain_rewrite_.value();
2370 void set_client_domain_rewrite(
bool x) {
2374 void set_follow_flushes(
bool x) {
set_option(x, &follow_flushes_); }
2375 bool follow_flushes()
const {
return follow_flushes_.value(); }
2377 void set_enable_defer_js_experimental(
bool x) {
2378 set_option(x, &enable_defer_js_experimental_);
2380 bool enable_defer_js_experimental()
const {
2381 return enable_defer_js_experimental_.value();
2384 void set_disable_rewrite_on_no_transform(
bool x) {
2385 set_option(x, &disable_rewrite_on_no_transform_);
2387 bool disable_rewrite_on_no_transform()
const {
2388 return disable_rewrite_on_no_transform_.value();
2391 void set_disable_background_fetches_for_bots(
bool x) {
2392 set_option(x, &disable_background_fetches_for_bots_);
2394 bool disable_background_fetches_for_bots()
const {
2395 return disable_background_fetches_for_bots_.value();
2398 void set_enable_cache_purge(
bool x) {
2401 bool enable_cache_purge()
const {
2402 return enable_cache_purge_.value();
2405 void set_proactive_resource_freshening(
bool x) {
2406 set_option(x, &proactive_resource_freshening_);
2408 bool proactive_resource_freshening()
const {
2409 return proactive_resource_freshening_.value();
2412 void set_lazyload_highres_images(
bool x) {
2415 bool lazyload_highres_images()
const {
2416 return lazyload_highres_images_.value();
2419 void set_use_fallback_property_cache_values(
bool x) {
2420 set_option(x, &use_fallback_property_cache_values_);
2422 bool use_fallback_property_cache_values()
const {
2423 return use_fallback_property_cache_values_.value();
2426 void set_await_pcache_lookup(
bool x) {
2429 bool await_pcache_lookup()
const {
2430 return await_pcache_lookup_.value();
2433 void set_enable_prioritizing_scripts(
bool x) {
2434 set_option(x, &enable_prioritizing_scripts_);
2436 bool enable_prioritizing_scripts()
const {
2437 return enable_prioritizing_scripts_.value();
2441 return blocking_rewrite_key_.value();
2443 void set_blocking_rewrite_key(StringPiece p) {
2444 set_option(p.as_string(), &blocking_rewrite_key_);
2447 void EnableBlockingRewriteForRefererUrlPattern(
2448 StringPiece url_pattern) {
2450 blocking_rewrite_referer_urls_.MakeWriteable()->Allow(url_pattern);
2453 bool IsBlockingRewriteEnabledForReferer(StringPiece url)
const {
2454 return blocking_rewrite_referer_urls_->Match(url,
false);
2457 bool IsBlockingRewriteRefererUrlPatternPresent()
const {
2458 return blocking_rewrite_referer_urls_->num_wildcards() > 0;
2461 bool rewrite_uncacheable_resources()
const {
2462 return rewrite_uncacheable_resources_.value();
2465 void set_rewrite_uncacheable_resources(
bool x) {
2466 set_option(x, &rewrite_uncacheable_resources_);
2469 void set_running_experiment(
bool x) {
2472 bool running_experiment()
const {
2473 return running_experiment_.value();
2480 int experiment_ga_slot()
const {
return experiment_ga_slot_.value(); }
2482 void set_enroll_experiment_id(
int x) {
2485 int enroll_experiment_id()
const {
return enroll_experiment_id_.value(); }
2487 void set_report_unload_time(
bool x) {
2490 bool report_unload_time()
const {
2491 return report_unload_time_.value();
2494 void set_implicit_cache_ttl_ms(int64 x) {
2497 int64 implicit_cache_ttl_ms()
const {
2498 return implicit_cache_ttl_ms_.value();
2501 void set_load_from_file_cache_ttl_ms(int64 x) {
2502 set_option(x, &load_from_file_cache_ttl_ms_);
2504 int64 load_from_file_cache_ttl_ms()
const {
2505 return load_from_file_cache_ttl_ms_.value();
2507 bool load_from_file_cache_ttl_ms_was_set()
const {
2508 return load_from_file_cache_ttl_ms_.was_set();
2511 void set_x_header_value(StringPiece p) {
2518 void set_avoid_renaming_introspective_javascript(
bool x) {
2519 set_option(x, &avoid_renaming_introspective_javascript_);
2521 bool avoid_renaming_introspective_javascript()
const {
2522 return avoid_renaming_introspective_javascript_.value();
2525 void set_forbid_all_disabled_filters(
bool x) {
2526 set_option(x, &forbid_all_disabled_filters_);
2528 bool forbid_all_disabled_filters()
const {
2529 return forbid_all_disabled_filters_.value();
2532 bool reject_blacklisted()
const {
return reject_blacklisted_.value(); }
2533 void set_reject_blacklisted(
bool x) {
2537 HttpStatus::Code reject_blacklisted_status_code()
const {
2538 return static_cast<HttpStatus::Code
>(
2539 reject_blacklisted_status_code_.value());
2541 void set_reject_blacklisted_status_code(HttpStatus::Code x) {
2542 set_option(static_cast<int>(x), &reject_blacklisted_status_code_);
2545 bool support_noscript_enabled()
const {
2546 return support_noscript_enabled_.value();
2548 void set_support_noscript_enabled(
bool x) {
2552 bool enable_extended_instrumentation()
const {
2553 return enable_extended_instrumentation_.value();
2555 void set_enable_extended_instrumentation(
bool x) {
2556 set_option(x, &enable_extended_instrumentation_);
2559 bool use_experimental_js_minifier()
const {
2560 return use_experimental_js_minifier_.value();
2562 void set_use_experimental_js_minifier(
bool x) {
2563 set_option(x, &use_experimental_js_minifier_);
2566 void set_max_combined_css_bytes(int64 x) {
2569 int64 max_combined_css_bytes()
const {
2570 return max_combined_css_bytes_.value();
2573 void set_max_combined_js_bytes(int64 x) {
2576 int64 max_combined_js_bytes()
const {
2577 return max_combined_js_bytes_.value();
2580 void set_pre_connect_url(StringPiece p) {
2584 return pre_connect_url_.value();
2586 void set_property_cache_http_status_stability_threshold(
int x) {
2587 set_option(x, &property_cache_http_status_stability_threshold_);
2589 int property_cache_http_status_stability_threshold()
const {
2590 return property_cache_http_status_stability_threshold_.value();
2593 void set_max_rewrite_info_log_size(
int x) {
2596 int max_rewrite_info_log_size()
const {
2597 return max_rewrite_info_log_size_.value();
2600 void set_enable_aggressive_rewriters_for_mobile(
bool x) {
2601 set_option(x, &enable_aggressive_rewriters_for_mobile_);
2603 bool enable_aggressive_rewriters_for_mobile()
const {
2604 return enable_aggressive_rewriters_for_mobile_.value();
2607 void set_allow_logging_urls_in_log_record(
bool x) {
2608 set_option(x, &allow_logging_urls_in_log_record_);
2610 bool allow_logging_urls_in_log_record()
const {
2611 return allow_logging_urls_in_log_record_.value();
2614 void set_allow_options_to_be_set_by_cookies(
bool x) {
2615 set_option(x, &allow_options_to_be_set_by_cookies_);
2617 bool allow_options_to_be_set_by_cookies()
const {
2618 return allow_options_to_be_set_by_cookies_.value();
2621 void set_non_cacheables_for_cache_partial_html(StringPiece p) {
2622 set_option(p.as_string(), &non_cacheables_for_cache_partial_html_);
2624 const GoogleString& non_cacheables_for_cache_partial_html()
const {
2625 return non_cacheables_for_cache_partial_html_.value();
2628 void set_no_transform_optimized_images(
bool x) {
2629 set_option(x, &no_transform_optimized_images_);
2631 bool no_transform_optimized_images()
const {
2632 return no_transform_optimized_images_.value();
2635 void set_access_control_allow_origins(StringPiece p) {
2636 set_option(p.as_string(), &access_control_allow_origins_);
2638 const GoogleString& access_control_allow_origins()
const {
2639 return access_control_allow_origins_.value();
2642 void set_hide_referer_using_meta(
bool x) {
2645 bool hide_referer_using_meta()
const {
2646 return hide_referer_using_meta_.value();
2649 void set_max_low_res_image_size_bytes(int64 x) {
2650 set_option(x, &max_low_res_image_size_bytes_);
2652 int64 max_low_res_image_size_bytes()
const {
2653 return max_low_res_image_size_bytes_.value();
2656 void set_max_low_res_to_full_res_image_size_percentage(
int x) {
2657 set_option(x, &max_low_res_to_full_res_image_size_percentage_);
2659 int max_low_res_to_full_res_image_size_percentage()
const {
2660 return max_low_res_to_full_res_image_size_percentage_.value();
2663 void set_serve_rewritten_webp_urls_to_any_agent(
bool x) {
2664 set_option(x, &serve_rewritten_webp_urls_to_any_agent_);
2666 bool serve_rewritten_webp_urls_to_any_agent()
const {
2667 return serve_rewritten_webp_urls_to_any_agent_.value();
2670 void set_cache_fragment(StringPiece p) {
2674 return cache_fragment_.value();
2677 void set_sticky_query_parameters(StringPiece p) {
2678 set_option(p.as_string(), &sticky_query_parameters_);
2681 return sticky_query_parameters_.value();
2684 void set_option_cookies_duration_ms(int64 x) {
2687 int64 option_cookies_duration_ms()
const {
2688 return option_cookies_duration_ms_.value();
2691 void set_responsive_image_densities(
const ResponsiveDensities& x) {
2694 const ResponsiveDensities& responsive_image_densities()
const {
2695 return responsive_image_densities_.value();
2699 return amp_link_pattern_.value();
2705 bool honor_csp()
const {
2706 return honor_csp_.value();
2708 void set_honor_csp(
bool x) {
2712 virtual bool DisableDomainRewrite()
const {
return false; }
2729 virtual void Merge(
const RewriteOptions& src);
2737 void Allow(StringPiece wildcard_pattern) {
2739 allow_resources_.MakeWriteable()->Allow(wildcard_pattern);
2746 allow_resources_.MakeWriteable()->Disallow(wildcard_pattern);
2752 allow_when_inlining_resources_.MakeWriteable()->Allow(wildcard_pattern);
2766 allow_when_inlining_resources_.MakeWriteable()->Disallow(wildcard_pattern);
2803 FileLoadPolicy* file_load_policy() {
return &file_load_policy_; }
2804 const FileLoadPolicy* file_load_policy()
const {
return &file_load_policy_; }
2809 return allow_resources_->Match(url,
true );
2820 return allow_when_inlining_resources_->Match(
2827 retain_comments_.MakeWriteable()->Allow(comment);
2834 return retain_comments_->Match(comment,
false);
2840 lazyload_enabled_classes_.MakeWriteable()->Disallow(class_name);
2845 return lazyload_enabled_classes_->Match(class_name,
true);
2851 css_combining_permitted_ids_.MakeWriteable()->Allow(id_wildcard);
2854 bool IsAllowedIdForCssCombining(StringPiece
id)
const {
2855 return css_combining_permitted_ids_->Match(
id,
false);
2858 bool CssCombiningMayPermitIds()
const {
2859 return !css_combining_permitted_ids_->empty();
2862 void set_override_caching_ttl_ms(int64 x) {
2865 int64 override_caching_ttl_ms()
const {
2866 return override_caching_ttl_ms_.value();
2873 override_caching_wildcard_.MakeWriteable()->Allow(wildcard);
2878 return override_caching_wildcard_->Match(url,
false);
2881 void AddRejectedUrlWildcard(
const GoogleString& wildcard) {
2882 AddRejectedHeaderWildcard(kRejectedRequestUrlKeyName, wildcard);
2885 void AddRejectedHeaderWildcard(StringPiece header_name,
2888 std::pair<FastWildcardGroupMap::iterator, bool> insert_result =
2889 rejected_request_map_.insert(std::make_pair(
2890 header_name, static_cast<FastWildcardGroup*>(NULL)));
2892 if (insert_result.second) {
2893 insert_result.first->second =
new FastWildcardGroup;
2895 insert_result.first->second->Allow(wildcard);
2901 const RequestHeaders* request_headers)
const;
2906 virtual RewriteOptions*
Clone()
const;
2917 void ComputeSignatureLockHeld() SHARED_LOCKS_REQUIRED(cache_purge_mutex_);
2940 bool frozen()
const {
return frozen_; }
2946 bool frozen = frozen_;
2962 DCHECK(!signature_.empty());
2967 GoogleString FilterSetToString(
const FilterSet& filter_set)
const;
2992 static const PropertyBase* LookupOptionByName(StringPiece option_name);
3008 return all_options_;
3011 static const Properties* deprecated_properties() {
3012 return deprecated_properties_;
3018 bool IsEqual(
const RewriteOptions& that)
const;
3023 const SHA1Signature* sha1signature()
const {
return &sha1signature_; }
3025 ThreadSystem* thread_system()
const {
return thread_system_; }
3048 typedef T ValueType;
3052 virtual bool was_set()
const {
return was_set_; }
3054 void set(
const T& val) {
3059 void set_default(
const T& val) {
3065 const T& value()
const {
return value_; }
3066 T& mutable_value() { was_set_ =
true;
return value_; }
3074 DCHECK(option_name() == src->option_name());
3075 MergeHelper(static_cast<const OptionTemplateBase*>(src));
3081 if (src->was_set_ || !was_set_) {
3082 value_ = src->value_;
3083 was_set_ = src->was_set_;
3089 property_ = property;
3095 value_ =
property->default_value();
3097 virtual const PropertyBase* property()
const {
return property_; }
3109 property->set_default(val);
3122 property->set_do_not_use_for_signature_computation(
true);
3153 return RewriteOptions::OptionSignature(this->value(), hasher);
3157 return RewriteOptions::ToString(this->value());
3166 template<
class RewriteOptionsSub
class,
class OptionClass>
3168 typename OptionClass::ValueType default_value,
3169 OptionClass RewriteOptionsSubclass::*offset,
3171 StringPiece option_name,
3173 const char* help_text,
3178 default_value, offset, id, option_name);
3179 property->set_scope(scope);
3180 property->set_help_text(help_text);
3181 property->set_safe_to_print(safe_to_print);
3182 properties->push_back(property);
3185 static void AddDeprecatedProperty(StringPiece option_name,
3187 deprecated_properties_->push_back(
3188 new DeprecatedProperty(option_name, scope));
3212 all_options_[index] = option;
3220 option->set(new_value);
3264 set_do_not_use_for_signature_computation(
true);
3265 set_help_text(
"Deprecated. Do not use");
3266 set_safe_to_print(
false);
3271 CHECK(
false) <<
"Deprecated properties shouldn't back options!";
3278 template<
class ValueType>
3279 class Property :
public PropertyBase {
3287 StringPiece option_name)
3289 default_value_(default_value) {
3292 void set_default(ValueType value) { default_value_ = value; }
3293 const ValueType& default_value()
const {
return default_value_; }
3296 ValueType default_value_;
3315 template<
class RewriteOptionsSub
class,
class OptionClass>
3316 class PropertyLeaf :
public Property<typename OptionClass::ValueType> {
3322 typedef typename OptionClass::ValueType ValueType;
3327 StringPiece option_name)
3328 :
Property<ValueType>(default_value, id, option_name),
3333 RewriteOptionsSubclass* options_subclass =
3334 static_cast<RewriteOptionsSubclass*
>(options);
3335 OptionClass& option = options_subclass->*offset_;
3336 option.set_property(
this);
3337 DCHECK_NE(-1, this->index()) <<
"Call Property::set_index first.";
3349 class CacheFragmentOption :
public Option<GoogleString> {
3351 virtual bool SetFromString(StringPiece value_string,
3355 struct OptionIdCompare;
3361 enum MergeOverride { kNoAction, kDisablePreserve, kDisableFilter };
3363 static Properties* properties_;
3364 static Properties* all_properties_;
3366 static Properties* deprecated_properties_;
3368 FRIEND_TEST(RewriteOptionsTest, ExperimentMergeTest);
3369 FRIEND_TEST(RewriteOptionsTest, LookupOptionByNameTest);
3370 FRIEND_TEST(RewriteOptionsTest, ColorUtilTest);
3371 FRIEND_TEST(RewriteOptionsTest, ParseFloats);
3374 bool HasRejectedHeader(
const StringPiece& header_name,
3375 const RequestHeaders* request_headers)
const;
3378 return IsRejectedRequest(kRejectedRequestUrlKeyName, url);
3381 bool IsRejectedRequest(StringPiece header_name,
3382 StringPiece value)
const {
3383 FastWildcardGroupMap::const_iterator it = rejected_request_map_.find(
3385 if (it != rejected_request_map_.end()) {
3386 return it->second->Match(value,
false);
3393 JavascriptLibraryIdentification* WriteableJavascriptLibraryIdentification();
3401 struct PrioritizeVisibleContentFamily {
3402 PrioritizeVisibleContentFamily(StringPiece url_pattern_string,
3403 int64 cache_time_ms_in,
3404 StringPiece non_cacheable_elements_in)
3405 : url_pattern(url_pattern_string),
3406 cache_time_ms(cache_time_ms_in),
3407 non_cacheable_elements(non_cacheable_elements_in.data(),
3408 non_cacheable_elements_in.size()) {}
3410 PrioritizeVisibleContentFamily*
Clone()
const {
3411 return new PrioritizeVisibleContentFamily(
3412 url_pattern.spec(), cache_time_ms, non_cacheable_elements);
3416 return StrCat(url_pattern.spec(),
";", Integer64ToString(cache_time_ms),
3417 ";", non_cacheable_elements);
3421 return StrCat(
"URL pattern: ", url_pattern.spec(),
", Cache time (ms): ",
3422 Integer64ToString(cache_time_ms),
", Non-cacheable: ",
3423 non_cacheable_elements);
3426 Wildcard url_pattern;
3427 int64 cache_time_ms;
3433 struct UrlCacheInvalidationEntry {
3434 UrlCacheInvalidationEntry(StringPiece url_pattern_in,
3435 int64 timestamp_ms_in,
3436 bool ignores_metadata_and_pcache_in)
3437 : url_pattern(url_pattern_in),
3438 timestamp_ms(timestamp_ms_in),
3439 ignores_metadata_and_pcache(ignores_metadata_and_pcache_in) {}
3441 UrlCacheInvalidationEntry*
Clone()
const {
3442 return new UrlCacheInvalidationEntry(
3443 url_pattern.spec(), timestamp_ms, ignores_metadata_and_pcache);
3447 if (ignores_metadata_and_pcache) {
3450 return StrCat(url_pattern.spec(),
"@", Integer64ToString(timestamp_ms));
3455 url_pattern.spec(),
", ",
3456 (ignores_metadata_and_pcache ?
"STRICT" :
"REFERENCE"),
" @ ",
3457 Integer64ToString(timestamp_ms));
3460 Wildcard url_pattern;
3462 bool ignores_metadata_and_pcache;
3465 typedef std::vector<UrlCacheInvalidationEntry*>
3466 UrlCacheInvalidationEntryVector;
3467 typedef dense_hash_map<GoogleString, int64> UrlCacheInvalidationMap;
3472 typedef rde::hash_map<StringPiece,
const PropertyBase*,
3473 CaseFoldStringPieceHash, 6,
3474 CaseFoldStringPieceEqual> PropertyNameMap;
3488 template<
class OptionClass>
3489 static void AddRequestProperty(
typename OptionClass::ValueType default_value,
3490 OptionClass RewriteOptions::*offset,
3491 const char*
id,
bool safe_to_print) {
3493 NULL, safe_to_print, properties_);
3498 template<
class OptionClass>
3499 static void AddBaseProperty(
typename OptionClass::ValueType default_value,
3500 OptionClass RewriteOptions::*offset,
3502 StringPiece option_name,
3505 bool safe_to_print) {
3506 AddProperty(default_value, offset,
id, option_name, scope, help,
3507 safe_to_print, properties_);
3510 static void AddProperties();
3511 bool AddCommaSeparatedListToFilterSetState(
3512 const StringPiece& filters, FilterSet* set, MessageHandler* handler);
3513 static bool AddCommaSeparatedListToFilterSet(
3514 const StringPiece& filters, FilterSet* set, MessageHandler* handler);
3516 static void InitFilterIdToEnumArray();
3517 static void InitOptionIdToPropertyArray();
3518 static void InitOptionNameToPropertyArray();
3521 static void InitFixedResourceHeaders();
3533 StringPiece name, StringPiece value,
OptionScope max_scope,
3538 static GoogleString OptionSignature(
bool x,
const Hasher* hasher) {
3539 return x ?
"T" :
"F";
3541 static GoogleString OptionSignature(
int x,
const Hasher* hasher) {
3542 return IntegerToString(x);
3544 static GoogleString OptionSignature(int64 x,
const Hasher* hasher) {
3545 return Integer64ToString(x);
3548 const Hasher* hasher);
3550 const Hasher* hasher);
3551 static GoogleString OptionSignature(ResourceCategorySet x,
3552 const Hasher* hasher);
3553 static GoogleString OptionSignature(
const BeaconUrl& beacon_url,
3554 const Hasher* hasher);
3555 static GoogleString OptionSignature(
const MobTheme& mob_theme,
3556 const Hasher* hasher);
3557 static GoogleString OptionSignature(
const ResponsiveDensities& densities,
3558 const Hasher* hasher);
3559 static GoogleString OptionSignature(
const AllowVaryOn& allow_vary_on,
3560 const Hasher* hasher);
3562 const protobuf::MessageLite& proto,
3563 const Hasher* hasher);
3568 return x ?
"True" :
"False";
3571 return IntegerToString(x);
3574 return Integer64ToString(x);
3580 static GoogleString ToString(
const ResourceCategorySet &x);
3581 static GoogleString ToString(
const BeaconUrl& beacon_url);
3582 static GoogleString ToString(
const MobTheme& mob_theme);
3584 static GoogleString ToString(
const ResponsiveDensities& densities);
3585 static GoogleString ToString(
const protobuf::MessageLite& proto);
3586 static GoogleString ToString(
const AllowVaryOn& allow_vary_on);
3590 static bool PropertyLessThanByOptionName(PropertyBase* p1, PropertyBase* p2) {
3595 static bool OptionNameLessThanArg(OptionBase* option, StringPiece arg) {
3600 static bool CompareUrlCacheInvalidationEntry(UrlCacheInvalidationEntry* e1,
3601 UrlCacheInvalidationEntry* e2) {
3602 return e1->timestamp_ms < e2->timestamp_ms;
3606 static bool FilterEnumToIdAndNameEntryLessThanById(
3607 const FilterEnumToIdAndNameEntry* e1,
3608 const FilterEnumToIdAndNameEntry* e2) {
3609 return strcmp(e1->filter_id, e2->filter_id) < 0;
3614 static StringPiece GetEffectiveOptionName(StringPiece name);
3619 bool CheckLevelSpecificOption(
RewriteLevel rewrite_level,
3620 const Option<bool>& option)
const;
3624 bool CheckBandwidthOption(
const Option<bool>& option)
const {
3630 bool CheckMobilizeFiltersOption(
const Option<bool>& option)
const {
3640 MergeOverride ComputeMergeOverride(
3642 const Option<bool>& src_preserve_option,
3643 const Option<bool>& preserve_option,
3644 const RewriteOptions& src);
3647 void ApplyMergeOverride(
3648 MergeOverride merge_override,
3650 Option<bool>* preserve_option);
3654 FilterSet enabled_filters_;
3655 FilterSet disabled_filters_;
3656 FilterSet forbidden_filters_;
3663 Option<RewriteLevel> level_;
3667 UrlCacheInvalidationEntryVector url_cache_invalidation_entries_;
3675 CopyOnWrite<PurgeSet> purge_set_ GUARDED_BY(cache_purge_mutex_);
3677 scoped_ptr<ThreadSystem::RWLock> cache_purge_mutex_;
3678 Option<int64> css_flatten_max_bytes_;
3679 Option<bool> cache_small_images_unrewritten_;
3680 Option<bool> no_transform_optimized_images_;
3683 Option<int64> image_resolution_limit_bytes_;
3684 Option<int64> css_image_inline_max_bytes_;
3685 Option<int64> css_inline_max_bytes_;
3686 Option<int64> css_outline_min_bytes_;
3687 Option<int64> google_font_css_inline_max_bytes_;
3690 Option<bool> css_preserve_urls_;
3691 Option<bool> js_preserve_urls_;
3692 Option<bool> image_preserve_urls_;
3694 Option<int64> image_inline_max_bytes_;
3695 Option<int64> js_inline_max_bytes_;
3696 Option<int64> js_outline_min_bytes_;
3697 Option<int64> progressive_jpeg_min_bytes_;
3699 Option<int64> max_html_cache_time_ms_;
3702 Option<int64> max_html_parse_bytes_;
3704 Option<int64> min_resource_cache_time_to_rewrite_ms_;
3705 Option<int64> idle_flush_time_ms_;
3706 Option<int64> flush_buffer_limit_bytes_;
3711 Option<int64> blocking_fetch_timeout_ms_;
3715 Option<int64> image_recompress_quality_;
3718 Option<int64> image_jpeg_recompress_quality_;
3719 Option<int64> image_jpeg_recompress_quality_for_small_screens_;
3720 Option<int64> image_jpeg_quality_for_save_data_;
3721 Option<int64> image_jpeg_num_progressive_scans_;
3722 Option<int64> image_jpeg_num_progressive_scans_for_small_screens_;
3725 Option<int> image_limit_optimized_percent_;
3726 Option<int> image_limit_resize_area_percent_;
3727 Option<int> image_limit_rendered_area_percent_;
3730 Option<int64> image_webp_recompress_quality_;
3731 Option<int64> image_webp_recompress_quality_for_small_screens_;
3732 Option<int64> image_webp_animated_recompress_quality_;
3733 Option<int64> image_webp_quality_for_save_data_;
3734 Option<int64> image_webp_timeout_ms_;
3736 Option<int> image_max_rewrites_at_once_;
3737 Option<int> max_url_segment_size_;
3738 Option<int> max_url_size_;
3739 Option<int> rewrite_deadline_ms_;
3743 Option<int> domain_shard_count_;
3745 Option<EnabledEnum> enabled_;
3749 Option<bool> add_options_to_urls_;
3756 Option<bool> publicly_cache_mismatched_hashes_experimental_;
3759 Option<bool> in_place_rewriting_enabled_;
3761 Option<bool> in_place_wait_for_optimized_;
3764 Option<int> in_place_rewrite_deadline_ms_;
3769 Option<int> in_place_s_maxage_sec_;
3772 Option<bool> in_place_preemptive_rewrite_css_;
3774 Option<bool> in_place_preemptive_rewrite_css_images_;
3777 Option<bool> in_place_preemptive_rewrite_images_;
3780 Option<bool> in_place_preemptive_rewrite_javascript_;
3786 Option<bool> private_not_vary_for_ie_;
3787 Option<bool> combine_across_paths_;
3788 Option<bool> log_background_rewrites_;
3789 Option<bool> log_mobilization_samples_;
3790 Option<bool> log_rewrite_timing_;
3791 Option<bool> log_url_indices_;
3792 Option<bool> lowercase_html_names_;
3793 Option<bool> always_rewrite_css_;
3794 Option<bool> respect_vary_;
3795 Option<bool> respect_x_forwarded_proto_;
3796 Option<bool> flush_html_;
3799 Option<bool> follow_flushes_;
3802 Option<bool> serve_stale_if_fetch_error_;
3804 Option<bool> serve_xhr_access_control_headers_;
3807 Option<bool> proactively_freshen_user_facing_request_;
3810 Option<int64> serve_stale_while_revalidate_threshold_sec_;
3816 Option<bool> default_cache_html_;
3821 Option<bool> modify_caching_headers_;
3825 Option<bool> lazyload_images_after_onload_;
3828 Option<GoogleString> lazyload_images_blank_url_;
3831 Option<bool> use_blank_image_for_inline_preview_;
3835 Option<bool> inline_only_critical_images_;
3838 Option<bool> critical_images_beacon_enabled_;
3841 Option<bool> client_domain_rewrite_;
3844 Option<bool> domain_rewrite_cookies_;
3847 Option<bool> domain_rewrite_hyperlinks_;
3850 Option<bool> running_experiment_;
3853 Option<int> experiment_ga_slot_;
3856 Option<int> enroll_experiment_id_;
3860 Option<GoogleString> content_experiment_id_;
3861 Option<GoogleString> content_experiment_variant_id_;
3864 Option<bool> use_analytics_js_;
3868 Option<bool> increase_speed_tracking_;
3873 Option<bool> report_unload_time_;
3875 Option<bool> serve_rewritten_webp_urls_to_any_agent_;
3878 Option<bool> enable_defer_js_experimental_;
3881 Option<bool> disable_rewrite_on_no_transform_;
3884 Option<bool> disable_background_fetches_for_bots_;
3895 Option<bool> enable_cache_purge_;
3900 Option<bool> proactive_resource_freshening_;
3903 Option<bool> lazyload_highres_images_;
3907 Option<bool> avoid_renaming_introspective_javascript_;
3910 Option<bool> override_ie_document_mode_;
3913 Option<bool> test_instant_fetch_rewrite_deadline_;
3918 Option<bool> test_only_prioritize_critical_css_dont_apply_original_css_;
3925 Option<GoogleString> blocking_rewrite_key_;
3930 Option<int> beacon_reinstrument_time_sec_;
3934 Option<int> max_inlined_preview_images_index_;
3936 Option<int64> min_image_size_low_resolution_bytes_;
3938 Option<int64> max_image_size_low_resolution_bytes_;
3941 Option<int> rewrite_random_drop_percentage_;
3945 Option<bool> oblivious_pagespeed_urls_;
3950 Option<int64> finder_properties_cache_expiration_time_ms_;
3955 Option<int64> finder_properties_cache_refresh_time_ms_;
3958 Option<int64> experiment_cookie_duration_ms_;
3962 Option<int64> metadata_cache_staleness_threshold_ms_;
3965 Option<int64> metadata_input_errors_cache_ttl_ms_;
3969 Option<GoogleString> downstream_cache_purge_method_;
3972 Option<GoogleString> downstream_cache_purge_location_prefix_;
3976 Option<GoogleString> downstream_cache_rebeaconing_key_;
3983 Option<int64> downstream_cache_rewritten_percentage_threshold_;
3988 Option<int64> implicit_cache_ttl_ms_;
3994 Option<int64> load_from_file_cache_ttl_ms_;
3997 Option<int64> max_cacheable_response_content_length_;
4000 Option<bool> preserve_subresource_hints_;
4004 Option<bool> preserve_url_relativity_;
4006 Option<GoogleString> ga_id_;
4009 Option<bool> use_fallback_property_cache_values_;
4011 Option<bool> await_pcache_lookup_;
4013 Option<bool> enable_prioritizing_scripts_;
4015 Option<bool> rewrite_uncacheable_resources_;
4021 Option<bool> forbid_all_disabled_filters_;
4023 Option<bool> enable_aggressive_rewriters_for_mobile_;
4030 Option<bool> reject_blacklisted_;
4031 Option<int> reject_blacklisted_status_code_;
4036 Option<bool> support_noscript_enabled_;
4040 Option<bool> enable_extended_instrumentation_;
4042 Option<bool> use_experimental_js_minifier_;
4046 Option<int64> max_combined_css_bytes_;
4050 Option<int64> max_combined_js_bytes_;
4053 Option<GoogleString> pre_connect_url_;
4056 Option<int> property_cache_http_status_stability_threshold_;
4058 Option<int> max_rewrite_info_log_size_;
4064 Option<int64> override_caching_ttl_ms_;
4065 CopyOnWrite<FastWildcardGroup> override_caching_wildcard_;
4068 Option<bool> allow_logging_urls_in_log_record_;
4071 Option<bool> allow_options_to_be_set_by_cookies_;
4074 Option<GoogleString> non_cacheables_for_cache_partial_html_;
4079 Option<GoogleString> access_control_allow_origins_;
4082 Option<bool> hide_referer_using_meta_;
4088 Option<int64> max_low_res_image_size_bytes_;
4089 Option<int> max_low_res_to_full_res_image_size_percentage_;
4092 Option<GoogleString> remote_configuration_url_;
4094 Option<int64> remote_configuration_timeout_ms_;
4097 Option<int> http_cache_compression_level_;
4100 Option<GoogleString> request_option_override_;
4103 Option<GoogleString> url_signing_key_;
4106 Option<bool> accept_invalid_signatures_;
4112 Option<GoogleString> sticky_query_parameters_;
4113 Option<int64> option_cookies_duration_ms_;
4116 Option<ResponsiveDensities> responsive_image_densities_;
4122 Option<GoogleString> amp_link_pattern_;
4125 Option<bool> honor_csp_;
4129 CacheFragmentOption cache_fragment_;
4134 size_t initialized_options_;
4138 static const FilterEnumToIdAndNameEntry* filter_id_to_enum_array_[
4142 static PropertyNameMap* option_name_to_property_map_;
4145 static const PropertyBase** option_id_to_property_array_;
4153 bool options_uniqueness_checked_;
4155 bool need_to_store_experiment_data_;
4157 int experiment_percent_;
4158 std::vector<ExperimentSpec*> experiment_specs_;
4164 std::vector<NameValue*> resource_headers_;
4167 std::vector<NameValue*> custom_fetch_headers_;
4171 scoped_ptr<std::vector<ElementAttributeCategory> > url_valued_attributes_;
4173 Option<ResourceCategorySet> inline_unauthorized_resource_types_;
4175 Option<int64> noop_;
4178 Option<AllowVaryOn> allow_vary_on_;
4180 CopyOnWrite<JavascriptLibraryIdentification>
4181 javascript_library_identification_;
4183 CopyOnWrite<DomainLawyer> domain_lawyer_;
4184 FileLoadPolicy file_load_policy_;
4186 CopyOnWrite<FastWildcardGroup> allow_resources_;
4187 CopyOnWrite<FastWildcardGroup> allow_when_inlining_resources_;
4188 CopyOnWrite<FastWildcardGroup> retain_comments_;
4189 CopyOnWrite<FastWildcardGroup> lazyload_enabled_classes_;
4190 CopyOnWrite<FastWildcardGroup> css_combining_permitted_ids_;
4194 CopyOnWrite<FastWildcardGroup> blocking_rewrite_referer_urls_;
4198 typedef std::map<StringPiece, FastWildcardGroup*> FastWildcardGroupMap;
4199 FastWildcardGroupMap rejected_request_map_;
4203 SHA1Signature sha1signature_;
4205 ThreadSystem* thread_system_;
4219 scoped_ptr<ThreadSystem::ThreadId> last_thread_id_;
void set_experiment_ga_slot(int x)
x should be between 1 and 5 inclusive.
Definition: rewrite_options.h:2477
int64 CssImageInlineMaxBytes() const
Retrieve the css image inlining threshold, but return 0 if it's disabled.
void AddUrlValuedAttribute(const StringPiece &element, const StringPiece &attribute, semantic_type::Category category)
bool SupportSaveData() const
Definition: rewrite_options.h:575
EnabledEnum
Definition: rewrite_options.h:226
bool AdjustFiltersByCommaSeparatedList(const StringPiece &filters, MessageHandler *handler)
static const int64 kDefaultMaxCombinedCssBytes
Default maximum size of the combined CSS resource.
Definition: rewrite_options.h:901
static const PropertyBase * LookupOptionById(StringPiece option_id)
OptionSettingResult ParseAndSetOptionFromNameWithScope(StringPiece name, StringPiece arg, OptionScope max_scope, GoogleString *msg, MessageHandler *handler)
static void AddProperty(typename OptionClass::ValueType default_value, OptionClass RewriteOptionsSubclass::*offset, const char *id, StringPiece option_name, OptionScope scope, const char *help_text, bool safe_to_print, Properties *properties)
Adds a new Property to 'properties' (the last argument).
Definition: rewrite_options.h:3167
bool ClearSignatureForTesting()
Definition: rewrite_options.h:2945
bool SetupExperimentRewriters()
bool IsRetainedComment(StringPiece comment) const
Definition: rewrite_options.h:2833
int64 idle_flush_time_ms() const
Definition: rewrite_options.h:1785
static bool Initialize(Properties **properties)
bool MatchesDownstreamCacheRebeaconingKey(StringPiece key) const
Definition: rewrite_options.h:2257
customized at directory level (.htaccess, <Directory>)
Definition: rewrite_options.h:632
bool ModificationOK() const
Implementation class of Signature, using HMAC-SHA1 for signing.
Definition: sha1_signature.h:32
Definition: rewrite_options.h:630
void AddUrlCacheInvalidationEntry(StringPiece url_pattern, int64 timestamp_ms, bool ignores_metadata_and_pcache)
static bool IsValidOptionName(StringPiece name)
Determine if the given option name is valid/known.
virtual GoogleString SubclassSignatureLockHeld()
Definition: rewrite_options.h:2921
static const int kDefaultMaxUrlSize
Definition: rewrite_options.h:865
static const int64 kDefaultExperimentCookieDurationMs
Definition: rewrite_options.h:894
void set_downstream_cache_purge_location_prefix(StringPiece p)
Definition: rewrite_options.h:2234
Definition: rewrite_options.h:493
Maps a filter's enum (kAddHead) to its id ("ah") and name ("Add Head").
Definition: rewrite_options.h:1116
void AddResourceHeader(const StringPiece &name, const StringPiece &value)
Definition: rewrite_options.h:750
bool OptionValue(StringPiece option_name, const char **id, bool *was_set, GoogleString *value) const
Definition: rewrite_options.h:235
static bool Terminate(Properties **properties_handle)
void AddOverrideCacheTtl(StringPiece wildcard)
Definition: rewrite_options.h:2871
Definition: rewrite_options.h:637
int max_url_segment_size() const
Definition: rewrite_options.h:1803
bool InsertExperimentSpecInVector(ExperimentSpec *spec)
bool ImageOptimizationEnabled() const
static bool LooksLikeValidHost(const StringPiece &s)
std::pair< GoogleString, GoogleString > OptionStringPair
Definition: rewrite_options.h:690
Definition: rewrite_options.h:3137
Definition: rewrite_options.h:3046
virtual void InitializeOption(RewriteOptions *options) const
Definition: rewrite_options.h:3332
virtual void DisallowTroublesomeResources()
static const char kAcceptInvalidSignatures[]
Definition: rewrite_options.h:247
static const char kCacheFlushFilename[]
Definition: rewrite_options.h:432
static const char kNoneString[]
Strings for display.
Definition: rewrite_options.h:510
void Allow(StringPiece wildcard_pattern)
Definition: rewrite_options.h:2737
OptionClass RewriteOptionsSubclass::* OptionOffset
Definition: rewrite_options.h:3321
virtual bool trim_urls_in_css() const
Return false in a subclass if you want to disallow all URL trimming in CSS.
Definition: rewrite_options.h:2278
Definition: signature.h:42
Option< BeaconUrl > beacon_url_
Protected option values so that derived class can modify.
Definition: rewrite_options.h:3252
void DisableAllFilters()
Set rewrite level to kPassThrough and explicitly disable all filters.
static bool IsDeprecatedOptionName(StringPiece option_name)
static Filter LookupFilter(const StringPiece &filter_name)
Convert the filter name to a Filter.
bool EnableFiltersByCommaSeparatedList(const StringPiece &filters, MessageHandler *handler)
static const char * FilterName(Filter filter)
ExperimentSpec * GetExperimentSpec(int id) const
bool HasValidSmallScreenQualities() const
bool StringToInt(const char *in, int *out)
Definition: string_util.h:94
static bool AddByNameToFilterSet(const StringPiece &option, FilterSet *set, MessageHandler *handler)
GoogleString PurgeSetString() const
Update kFirstFilter if you add something before this.
Definition: rewrite_options.h:107
static const int kDefaultExperimentSlot
Default Custom Variable slot in which to put Experiment information.
Definition: rewrite_options.h:908
Definition: rewrite_options.h:695
void Modify()
Marks the config as modified.
virtual RewriteOptions * Clone() const
Definition: rewrite_options.h:504
int64 flush_buffer_limit_bytes() const
How much accumulated HTML will result in PSA introducing a flush.
Definition: rewrite_options.h:1793
Definition: rewrite_options.h:238
static bool ParseBeaconUrl(const StringPiece &in, BeaconUrl *out)
static bool ParseAlternateOriginDomain(const StringPiece &in, AlternateOriginDomainSpec *out, MessageHandler *handler)
int64 cache_invalidation_timestamp() const
const DomainLawyer * domain_lawyer() const
Definition: rewrite_options.h:2800
Definition: rewrite_options.h:474
void InitializeOption(RewriteOptions *options) const override
Definition: rewrite_options.h:3270
Definition: rewrite_options.h:507
void set_cache_invalidation_timestamp_mutex(ThreadSystem::RWLock *lock)
Definition: rewrite_options.h:1747
static void MergeSubclassProperties(Properties *properties)
void set_domain_shard_count(int64 x)
Definition: rewrite_options.h:1843
int64 css_outline_min_bytes() const
Definition: rewrite_options.h:1544
void DisableFiltersRequiringScriptExecution()
Disables all filters that depend on executing custom javascript.
bool IsAllowedWhenInlining(StringPiece url) const
Definition: rewrite_options.h:2819
void set_global_default(const T &val)
Definition: rewrite_options.h:3107
static const char kImageJpegNumProgressiveScans[]
Definition: rewrite_options.h:306
bool IsUrlCacheInvalidationEntriesSorted() const
static const int64 kDefaultMetadataCacheStalenessThresholdMs
Definition: rewrite_options.h:898
virtual GoogleString ToExperimentString() const
static const int kOptionsVersion
Definition: rewrite_options.h:615
void MergeHelper(const OptionTemplateBase *src)
Definition: rewrite_options.h:3078
bool ValidateAndAddResourceHeader(const StringPiece &name, const StringPiece &value, GoogleString *error_message)
int64 ImageInlineMaxBytes() const
Retrieve the image inlining threshold, but return 0 if it's disabled.
void EnableFilter(Filter filter)
void GetEnabledFiltersRequiringScriptExecution(FilterVector *filters) const
Returns the set of enabled filters that require JavaScript for execution.
virtual void DisallowResourcesForProxy()
virtual GoogleString ToExperimentDebugString() const
void AllowOnlyWhenInlining(StringPiece wildcard_pattern)
Definition: rewrite_options.h:2758
std::vector< OptionBase * > OptionBaseVector
Convenience name for a set of rewrite options.
Definition: rewrite_options.h:775
OptionScope
Definition: rewrite_options.h:629
Definition: rewrite_options.h:487
void set_default_x_header_value(StringPiece x_header_value)
Definition: rewrite_options.h:3234
Definition: javascript_library_identification.h:34
OptionSettingResult SetOptionFromName(StringPiece name, StringPiece value, GoogleString *msg)
static const int64 kDefaultFinderPropertiesCacheExpirationTimeMs
Default cache expiration value for finder properties in pcache.
Definition: rewrite_options.h:888
bool RegisterLibrary(SizeInBytes bytes, StringPiece md5_hash, StringPiece canonical_url)
Represents the content type of user-defined url-valued attributes.
Definition: rewrite_options.h:1045
Option< GoogleString > x_header_value_
The value we put for the X-Mod-Pagespeed header. Default is our version.
Definition: rewrite_options.h:3255
void set_option(const T &new_value, OptionTemplateBase< T > *option)
Definition: rewrite_options.h:3219
static bool AddCommaSeparatedListToOptionSet(const StringPiece &options, OptionSet *set, MessageHandler *handler)
int max_url_size() const
The maximum size of the entire URL. If '0', this is left unlimited.
Definition: rewrite_options.h:1816
virtual OptionSettingResult ParseAndSetOptionFromName1(StringPiece name, StringPiece arg, GoogleString *msg, MessageHandler *handler)
Definition: rewrite_options.h:1057
Definition: rewrite_options.h:789
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
static GoogleString QuoteHostPort(const GoogleString &in)
Definition: rewrite_options.h:924
void DoNotUseForSignatureComputation()
Definition: rewrite_options.h:3120
used while developing proper HTTP2 features.
Definition: rewrite_options.h:138
void ApplyAlternateOriginsToDomainLawyer(DomainLawyer *domain_lawyer, MessageHandler *handler) const
Mutate the origin domains in DomainLawyer with alternate_origin_domains_.
void AddCustomFetchHeader(const StringPiece &name, const StringPiece &value)
Specify a header to insert when fetching subresources.
Definition: thread_system.h:61
virtual bool SetFromString(StringPiece value_string, GoogleString *error_detail)=0
static const int kDefaultMaxInlinedPreviewImagesIndex
Definition: rewrite_options.h:880
void DisallowWhenInlining(StringPiece wildcard_pattern)
Like Disallow(). See IsAllowedWhenInlining().
Definition: rewrite_options.h:2764
static const char kAllow[]
Options that require special handling, e.g. non-scalar values.
Definition: rewrite_options.h:403
void set_property(const Property< T > *property)
The static properties of an Option are held in a Property<T>*.
Definition: rewrite_options.h:3088
static const char kAddResourceHeader[]
2-argument ones:
Definition: rewrite_options.h:417
int64 ImageJpegQuality() const
Image qualities and parameters, after applying the inheritance rules.
static const char * FilterId(Filter filter)
Definition: file_load_policy.h:41
HttpOptions ComputeHttpOptions() const
bool RegisterLibrary(uint64 bytes, StringPiece md5_hash, StringPiece canonical_url)
Store size, md5 hash and canonical url for library recognition.
Definition: rewrite_options.h:1314
virtual ExperimentSpec * AddExperimentSpec(const StringPiece &spec, MessageHandler *handler)
Definition: rewrite_options.h:976
const Hasher * hasher() const
Returns the hasher used for signatures and URLs to purge.
Definition: rewrite_options.h:3021
static const int64 kDefaultMaxCombinedJsBytes
Default maximum size of the combined js resource generated by JsCombiner.
Definition: rewrite_options.h:904
std::set< GoogleString > FilterIdSet
Convenience name for a set of rewrite filter ids.
Definition: rewrite_options.h:678
Definition: rewrite_options.h:633
bool SetOptionFromNameAndLog(StringPiece name, StringPiece value, MessageHandler *handler)
static void CombineQuotedHostPort(StringPieceVector *vec, size_t first_pos, GoogleString *combined_container)
static const char kLibrary[]
3-argument ones:
Definition: rewrite_options.h:428
virtual void Merge(const RewriteOptions &src)
void DisableAllFiltersNotExplicitlyEnabled()
void SetDefaultRewriteLevel(RewriteLevel level)
Definition: rewrite_options.h:1180
void PurgeUrl(StringPiece url, int64 timestamp_ms)
Purge a cache entry for an exact URL, not a wildcard.
GoogleString SafeEnabledOptionsToString() const
bool IsLazyloadEnabledForClassName(StringPiece class_name) const
Checks if lazyload images is enabled for the specified class.
Definition: rewrite_options.h:2844
virtual bool SetExperimentState(int id)
void SoftEnableFilterForTesting(Filter filter)
Definition: domain_lawyer.h:47
void Merge(Properties *properties)
void AllowWhenInlining(StringPiece wildcard_pattern)
Like Allow(). See IsAllowedWhenInlining().
Definition: rewrite_options.h:2750
const OptionBaseVector & all_options() const
Definition: rewrite_options.h:3007
Filter
Definition: rewrite_options.h:106
virtual RewriteOptions * NewOptions() const
Make an empty options object of the same type as this.
OptionSettingResult SetOptionFromQuery(StringPiece name, StringPiece value)
static int NumFilterIds()
bool IsUrlCacheValid(StringPiece url, int64 time_ms, bool search_wildcards) const
Pagespeed runs normally. Can be overridden via query param.
Definition: rewrite_options.h:232
Definition: rewrite_options.h:91
bool RequiresAddHead() const
static const int kDefaultMaxUrlSegmentSize
Definition: rewrite_options.h:873
void DisableLazyloadForClassName(StringPiece class_name)
Adds a new class name for which lazyload should be disabled.
Definition: rewrite_options.h:2838
virtual void SetRequiredExperimentFilters()
Enables filters needed by Experiment regardless of experiment.
void MergeOnlyProcessScopeOptions(const RewriteOptions &src)
bool DisableFiltersByCommaSeparatedList(const StringPiece &filters, MessageHandler *handler)
void SetExperimentStateStr(const StringPiece &experiment_index)
Property(ValueType default_value, const char *id, StringPiece option_name)
Definition: rewrite_options.h:3285
static const int kDefaultRewriteDeadlineMs
Default time to wait for rewrite before returning original resource.
Definition: rewrite_options.h:876
void AddCssCombiningWildcard(StringPiece id_wildcard)
Adds a new comment wildcard pattern to be retained.
Definition: rewrite_options.h:2849
bool NeedsDependenciesCohort() const
void InitializeOptions(const Properties *properties)
Definition: rewrite_options.h:90
Definition: rewrite_options.h:3260
int StringCaseCompare(StringPiece s1, StringPiece s2)
Case-insensitive string comparison that is locale-independent.
bool IsCacheTtlOverridden(StringPiece url) const
Is the cache TTL overridden for the given url?
Definition: rewrite_options.h:2877
static const int64 kDefaultMaxImageSizeLowResolutionBytes
Definition: rewrite_options.h:886
static const StringPiece LookupOptionNameById(StringPiece option_id)
bool UpdateCachePurgeSet(const CopyOnWrite< PurgeSet > &purge_set) LOCKS_EXCLUDED(cache_purge_mutex_.get())
virtual bool SetFromString(StringPiece value_string, GoogleString *error_detail)
Sets value_ from value_string.
Definition: rewrite_options.h:3142
Definition: copy_on_write.h:34
Definition: thread_system.h:40
OptionSettingResult
Used for return value of SetOptionFromName.
Definition: rewrite_options.h:813
bool StringToDouble(const char *in, double *out)
static const int64 kDefaultMinImageSizeLowResolutionBytes
Definition: rewrite_options.h:883
Definition: message_handler.h:39
Customized at process level and enforced as such.
Definition: rewrite_options.h:640
static Filter LookupFilterById(const StringPiece &filter_id)
DeviceType
Definition: user_agent_matcher.h:49
Definition: rewrite_options.h:481
GoogleString GetExperimentStateStr() const
bool UpdateCacheInvalidationTimestampMs(int64 timestamp_ms) LOCKS_EXCLUDED(cache_purge_mutex_.get())
static const char kNullOption[]
The option name you have when you don't have an option name.
Definition: rewrite_options.h:465
Definition: rewrite_options.h:230
void ForceEnableFilter(Filter filter)
ExperimentSpec(const StringPiece &spec, const RewriteOptions *options, MessageHandler *handler)
bool SetOptionsFromName(const OptionSet &option_set, MessageHandler *handler)
Definition: rewrite_options.h:784
void Disallow(StringPiece wildcard_pattern)
Definition: rewrite_options.h:2744
OptionSettingResult SetOptionFromRemoteConfig(StringPiece name, StringPiece value)
bool IsAllowed(StringPiece url) const
Definition: rewrite_options.h:2808
const JavascriptLibraryIdentification * javascript_library_identification() const
Definition: rewrite_options.h:1322
bool ForbidFiltersByCommaSeparatedList(const StringPiece &filters, MessageHandler *handler)
Definition: rewrite_options.h:796
void UrlValuedAttribute(int index, StringPiece *element, StringPiece *attribute, semantic_type::Category *category) const
virtual void InitializeOption(RewriteOptions *options) const =0
int id() const
Accessors.
Definition: rewrite_options.h:946
void Merge(const ExperimentSpec &spec)
void EnableExtendCacheFilters()
Definition: thread_system.h:89
bool ValidateConfiguredHttpHeader(const GoogleString &name, const GoogleString &value, GoogleString *error_message)
bool AvailableExperimentId(int id)
Definition: rewrite_options.h:84
bool IsRequestDeclined(const GoogleString &url, const RequestHeaders *request_headers) const
bool IsEqual(const RewriteOptions &that) const
Definition: rewrite_options.h:169
RewriteLevel
Definition: rewrite_options.h:779
Definition: rewrite_options.h:805
const GoogleString & signature() const
Returns the computed signature.
Definition: rewrite_options.h:2952
bool UsePerOriginPropertyCachePage() const
int size() const
Returns the number of properties.
Definition: rewrite_options.h:1080
Definition: rewrite_options.h:800
void set_option_at(int index, OptionBase *option)
Definition: rewrite_options.h:3211
bool has_cache_invalidation_timestamp_ms() const
bool ClearSignatureWithCaution()
static const int64 kDefaultFinderPropertiesCacheRefreshTimeMs
Default cache refresh value for finder properties in pcache.
Definition: rewrite_options.h:890
virtual ExperimentSpec * Clone()
Return a ExperimentSpec with all the same information as this one.
static const int kHashBytes
Number of bytes used for signature hashing.
Definition: rewrite_options.h:618
static bool ParseFromString(StringPiece value_string, bool *value)
static const int kCachePurgeBytes
Number of bytes capacity in the URL invalidation set.
Definition: rewrite_options.h:621
virtual void Merge(const OptionBase *src)
Definition: rewrite_options.h:3073
bool HasValidSaveDataQualities() const
Definition: rewrite_options.h:809
static const Filter kFirstFilter
Used for enumerating over all entries in the Filter enum.
Definition: rewrite_options.h:672
void DisableFiltersThatCantRunInAjax()
Disables all filters that cannot be run in an Ajax call.
void ComputeSignature() LOCKS_EXCLUDED(cache_purge_mutex_.get())
int64 MaxImageInlineMaxBytes() const
The larger of ImageInlineMaxBytes and CssImageInlineMaxBytes.
bool css_preserve_urls() const
Definition: rewrite_options.h:2188
void RetainComment(StringPiece comment)
Adds a new comment wildcard pattern to be retained.
Definition: rewrite_options.h:2825