Page Speed Optimization Libraries
1.13.35.1
|
Unit-test framework for wget fetcher. More...
Namespaces | |
css_util | |
url | |
Prepare for flattening of the namespaces in newer Chromiums. | |
Typedefs | |
typedef std::map< GoogleString, std::pair< int32, int32 > > | RenderedImageDimensionsMap |
typedef RefCountedPtr < CssResourceSlot > | CssResourceSlotPtr |
typedef RefCountedPtr < InlineAttributeSlot > | InlineAttributeSlotPtr |
typedef std::set < InlineAttributeSlotPtr, InlineAttributeSlotComparator > | InlineAttributeSlotSet |
typedef RefCountedPtr < InlineResourceSlot > | InlineResourceSlotPtr |
typedef std::set < InlineResourceSlotPtr, InlineResourceSlotComparator > | InlineResourceSlotSet |
typedef RefCountedPtr< Resource > | ResourcePtr |
typedef std::vector< ResourcePtr > | ResourceVector |
typedef Callback2< const GoogleUrl &, bool * > | ResourceUrlClaimant |
typedef RefCountedPtr < ResourceSlot > | ResourceSlotPtr |
typedef RefCountedPtr < HtmlResourceSlot > | HtmlResourceSlotPtr |
typedef std::vector < ResourceSlotPtr > | ResourceSlotVector |
typedef std::set < HtmlResourceSlotPtr, HtmlResourceSlotComparator > | HtmlResourceSlotSet |
typedef std::vector < ResponsiveImageCandidate > | ResponsiveImageCandidateVector |
typedef std::map< HtmlElement *, ResponsiveVirtualImages > | ResponsiveImageCandidateMap |
typedef RefCountedPtr < OutputResource > | OutputResourcePtr |
typedef std::vector < OutputResourcePtr > | OutputResourceVector |
typedef RefCountedPtr < SrcSetSlotCollection > | SrcSetSlotCollectionPtr |
typedef std::set < SrcSetSlotCollectionPtr, SrcSetSlotCollectionComparator > | SrcSetSlotCollectionSet |
typedef bool(* | WebpProgressHook )(int percent, void *user_data) |
Progress hook for WebP conversions. | |
typedef Callback2< StringPiece, bool * > | HeaderPredicateFn |
typedef std::set< Atom, AtomCompare > | AtomSet |
typedef base::StringPiece | StringPiece |
typedef std::pair< HtmlElement *, Json::Value * > | ElementJsonPair |
Pair of panel json and start Element corresponding to the panel. | |
typedef google::protobuf::io::StringOutputStream | StringOutputStream |
typedef google::protobuf::io::ArrayInputStream | ArrayInputStream |
typedef std::map< GoogleString, GoogleString > | StringStringMap |
typedef std::map< GoogleString, int > | StringIntMap |
typedef std::set< GoogleString > | StringSet |
typedef std::set< GoogleString, StringCompareInsensitive > | StringSetInsensitive |
typedef std::vector< GoogleString > | StringVector |
typedef std::vector< StringPiece > | StringPieceVector |
typedef std::vector< const GoogleString * > | ConstStringStarVector |
typedef std::vector < GoogleString * > | StringStarVector |
typedef std::vector< const char * > | CharStarVector |
typedef SymbolTable< CaseFold > | SymbolTableInsensitive |
typedef SymbolTable< CasePreserve > | SymbolTableSensitive |
typedef std::list< HtmlEvent * > | HtmlEventList |
typedef HtmlEventList::iterator | HtmlEventListIterator |
typedef std::set< const HtmlEvent * > | ConstHtmlEventSet |
typedef std::vector < PropertyPage * > | PropertyPageStarVector |
typedef RefCountedPtr < RequestContext > | RequestContextPtr |
typedef std::vector < std::unique_ptr < TcpConnectionForTesting > > | ConnectionList |
Enumerations | |
enum | FetchResponseStatus { kFetchStatusNotSet = 0, kFetchStatusOK = 1, kFetchStatusUncacheable200 = 2, kFetchStatusUncacheableError = 3, kFetchStatus4xxError = 4, kFetchStatusOtherError = 5, kFetchStatusDropped = 6, kFetchStatusEmpty = 7 } |
enum | BeaconStatus { kDoNotBeacon, kBeaconNoNonce, kBeaconWithNonce } |
enum | CriticalKeysWriteFlags { kNoRequirementsOnPriorResult = 0, kReplacePriorResult = 1, kRequirePriorSupport = 2, kSkipNonceCheck = 4 } |
enum | CspDirective { CspDirective::kChildSrc, kConnectSrc, kDefaultSrc, CspDirective::kFrameSrc, kImgSrc, CspDirective::kScriptSrc, kStyleSrc, CspDirective::kBaseUri, CspDirective::kNumSourceListDirectives } |
enum | InlineResult { INLINE_SUCCESS, INLINE_UNSUPPORTED_DEVICE, INLINE_NOT_CRITICAL, INLINE_NO_DATA, INLINE_TOO_LARGE, INLINE_CACHE_SMALL_IMAGES_UNREWRITTEN, INLINE_RESPONSIVE, INLINE_SHORTCUT, INLINE_INTERNAL_ERROR } |
See MessageForInlineResult for enum meanings. More... | |
enum | OutputResourceKind { kRewrittenResource, kOnTheFlyResource, kInlineResource, kOutlinedResource } |
enum | PropertyCacheDecodeResult { kPropertyCacheDecodeNotFound, kPropertyCacheDecodeExpired, kPropertyCacheDecodeParseError, kPropertyCacheDecodeOk } |
enum | PropertyCacheUpdateResult { kPropertyCacheUpdateNotFound, kPropertyCacheUpdateEncodeError, kPropertyCacheUpdateOk } |
enum | RenderOp { kDontRender, kRenderOnlyCspWarning, kRender } |
enum | RewriteResult { kRewriteFailed, kRewriteOk, kTooBusy } |
enum | MessageType { kInfo, kWarning, kError, kFatal } |
enum | Encoding { UNKNOWN, BASE64, PLAIN } |
enum | UrlRelativity { kAbsoluteUrl, kNetPath, kAbsolutePath, kRelativePath } |
namespace url More... | |
enum | SerfCompletionResult { kClientCancel, kSuccess, kFailure } |
Functions | |
bool | ValidateAndExpireNonce (int64 now_ms, StringPiece nonce, CriticalKeys *critical_keys) |
void | GetCriticalKeysFromProto (int64 support_percentage, const CriticalKeys &critical_keys, StringSet *keys) |
void | UpdateCriticalKeys (bool require_prior_support, const StringSet &new_set, int support_value, CriticalKeys *critical_keys) |
bool | ShouldBeacon (int64 next_beacon_timestamp_ms, const RewriteDriver &driver) |
void | WriteCriticalKeysToPropertyCache (const StringSet &new_keys, StringPiece nonce, int support_interval, CriticalKeysWriteFlags flags, StringPiece property_name, const PropertyCache *cache, const PropertyCache::Cohort *cohort, AbstractPropertyPage *page, MessageHandler *message_handler, Timer *timer) |
void | PrepareForBeaconInsertionHelper (CriticalKeys *proto, NonceGenerator *nonce_generator, RewriteDriver *driver, bool using_candidate_key_detection, BeaconMetadata *result) |
bool | UpdateCandidateKeys (const StringSet &keys, CriticalKeys *proto, bool clear_rebeacon_timestamp) |
bool | IsBeaconDataAvailable (const CriticalKeys &proto) |
CspDirective | LookupCspDirective (StringPiece name) |
Returns kNumSourceListDirectives if unrecognized. | |
Image * | NewImage (const StringPiece &original_contents, const GoogleString &url, const StringPiece &file_prefix, Image::CompressionOptions *options, Timer *timer, MessageHandler *handler) |
Image * | BlankImageWithOptions (int width, int height, ImageType type, const StringPiece &tmp_dir, Timer *timer, MessageHandler *handler, Image::CompressionOptions *options) |
int | CharToInt (char c) |
char to int without sign extension. More... | |
int | JpegIntAtPosition (const StringPiece &buf, size_t pos) |
int | GifIntAtPosition (const StringPiece &buf, size_t pos) |
int | PngIntAtPosition (const StringPiece &buf, size_t pos) |
bool | PngSectionIdIs (const char *hdr, const StringPiece &buf, size_t pos) |
const PropertyValue * | DecodeFromPropertyCacheHelper (const PropertyCache *cache, AbstractPropertyPage *page, const PropertyCache::Cohort *cohort, StringPiece property_name, int64 cache_ttl_ms, PropertyCacheDecodeResult *status) |
template<typename T > | |
T * | DecodeFromPropertyCache (const PropertyCache *cache, AbstractPropertyPage *page, const PropertyCache::Cohort *cohort, StringPiece property_name, int64 cache_ttl_ms, PropertyCacheDecodeResult *status) |
template<typename T > | |
T * | DecodeFromPropertyCache (RewriteDriver *driver, const PropertyCache::Cohort *cohort, StringPiece property_name, int64 cache_ttl_ms, PropertyCacheDecodeResult *status) |
PropertyCacheUpdateResult | UpdateInPropertyCache (const protobuf::MessageLite &value, const PropertyCache::Cohort *cohort, StringPiece property_name, bool write_cohort, AbstractPropertyPage *page) |
PropertyCacheUpdateResult | UpdateInPropertyCache (const protobuf::MessageLite &value, RewriteDriver *driver, const PropertyCache::Cohort *cohort, StringPiece property_name, bool write_cohort) |
bool | OptimizeWebp (const GoogleString &original_jpeg, int configured_quality, WebpProgressHook progress_hook, void *progress_hook_data, GoogleString *compressed_webp, MessageHandler *message_handler) |
bool | ReduceWebpImageQuality (const GoogleString &original_webp, int quality, GoogleString *compressed_webp) |
void | ApacheRequestToRequestHeaders (const request_rec &request, RequestHeaders *request_headers, HeaderPredicateFn *predicate) |
void | ApacheRequestToRequestHeaders (const request_rec &request, RequestHeaders *request_headers) |
Fully converts apache request header structure into RequestHeaders. | |
void | ApacheRequestToResponseHeaders (const request_rec &request, ResponseHeaders *headers, ResponseHeaders *err_headers) |
void | ResponseHeadersToApacheRequest (const ResponseHeaders &response_headers, request_rec *request) |
void | ErrorHeadersToApacheRequest (const ResponseHeaders &err_response_headers, request_rec *request) |
void | DisableDownstreamHeaderFilters (request_rec *request) |
Remove downstream filters that might corrupt our caching headers. | |
void | PrintHeaders (request_rec *request) |
Debug utility for printing Apache headers to stdout. | |
GoogleString | HeadersOutToString (request_rec *request) |
Get request->headers_out as a string, intended for tests. | |
GoogleString | SubprocessEnvToString (request_rec *request) |
Get request->subprocess_env as a string, intended for tests. | |
void | DisableCachingRelatedHeaders (request_rec *request) |
Updates headers related to caching (but not Cache-Control). | |
void | DisableCacheControlHeader (request_rec *request) |
template<class T > | |
apr_status_t | apache_cleanup (void *object) |
Generic deleter meant to be used with apr_pool_cleanup_register(). | |
void | Web64Encode (const StringPiece &in, GoogleString *out) |
bool | Web64Decode (const StringPiece &in, GoogleString *out) |
void | Mime64Encode (const StringPiece &in, GoogleString *out) |
bool | Mime64Decode (const StringPiece &in, GoogleString *out) |
template<class T1 , class T2 , class A1 > | |
_MemberCallback_0_1< T1, A1, true >::base * | NewCallback (T1 *obj, void(T2::*member)(A1)) |
Creates a callback that automatically gets deleted after being run. | |
template<class T1 , class T2 , class A1 > | |
_MemberCallback_0_1< T1, A1, false >::base * | NewPermanentCallback (T1 *obj, void(T2::*member)(A1)) |
Creates a callback that does not get deleted after being run. | |
template<class T1 , class T2 , class P1 , class A1 > | |
_MemberCallback_1_1< T1, P1, A1, true >::base * | NewCallback (T1 *obj, void(T2::*member)(P1, A1), typename ConstRef< P1 >::type p1) |
Creates a callback that automatically gets deleted after being run. | |
template<class T1 , class T2 , class P1 , class A1 > | |
_MemberCallback_1_1< T1, P1, A1, false >::base * | NewPermanentCallback (T1 *obj, void(T2::*member)(P1, A1), typename ConstRef< P1 >::type p1) |
Creates a callback that does not get deleted after being run. | |
template<class T1 , class T2 , class A1 , class A2 > | |
_MemberCallback_0_2< T1, A1, A2, true >::base * | NewCallback (T1 *obj, void(T2::*member)(A1, A2)) |
Creates a callback that automatically gets deleted after being run. | |
template<class T1 , class T2 , class A1 , class A2 > | |
_MemberCallback_0_2< T1, A1, A2, false >::base * | NewPermanentCallback (T1 *obj, void(T2::*member)(A1, A2)) |
Creates a callback that does not get deleted after being run. | |
template<class T1 , class T2 , class P1 , class A1 , class A2 > | |
_MemberCallback_2_1< T1, P1, A1, A2, true >::base * | NewCallback (T1 *obj, void(T2::*member)(P1, A1, A2), typename ConstRef< P1 >::type p1) |
Creates a callback that automatically gets deleted after being run. | |
template<class T1 , class T2 , class P1 , class A1 , class A2 > | |
_MemberCallback_2_1< T1, P1, A1, A2, false >::base * | NewPermanentCallback (T1 *obj, void(T2::*member)(P1, A1, A2), typename ConstRef< P1 >::type p1) |
Creates a callback that does not get deleted after being run. | |
bool | StripUtf8Bom (StringPiece *contents) |
const StringPiece | GetCharsetForBom (const StringPiece contents) |
GoogleString | StackTraceString () |
void | EscapeToJsStringLiteral (const StringPiece &original, bool add_quotes, GoogleString *escaped) |
void | EscapeToJsonStringLiteral (const StringPiece &original, bool add_quotes, GoogleString *escaped) |
template<class C > | |
Function * | MakeFunction (C *object, void(C::*run)()) |
Makes a Function* that calls a 0-arg class method. | |
template<class C > | |
Function * | MakeFunction (C *object, void(C::*run)(), void(C::*cancel)()) |
template<class C , class T > | |
Function * | MakeFunction (C *object, void(C::*run)(T), T t) |
Makes a Function* that calls a 1-arg class method. | |
template<class C , class T > | |
Function * | MakeFunction (C *object, void(C::*run)(T), void(C::*cancel)(T), T t) |
template<class C , class T , class U > | |
Function * | MakeFunction (C *object, void(C::*run)(T, U), T t, U u) |
Makes a Function* that calls a 2-arg class method. | |
template<class C , class T , class U > | |
Function * | MakeFunction (C *object, void(C::*run)(T, U), void(C::*cancel)(T, U), T t, U u) |
template<class C , class T , class U , class V > | |
Function * | MakeFunction (C *object, void(C::*run)(T, U, V), T t, U u, V v) |
Makes a Function* that calls a 3-arg class method. | |
template<class C , class T , class U , class V > | |
Function * | MakeFunction (C *object, void(C::*run)(T, U, V), void(C::*cancel)(T, U, V), T t, U u, V v) |
template<class C , class T , class U , class V , class W > | |
Function * | MakeFunction (C *object, void(C::*run)(T, U, V, W), T t, U u, V v, W w) |
Makes a Function* that calls a 4-arg class method. | |
template<class C , class T , class U , class V , class W > | |
Function * | MakeFunction (C *object, void(C::*run)(T, U, V, W), void(C::*cancel)(T, U, V, W), T t, U u, V v, W w) |
GoogleString | GTestSrcDir () |
GoogleString | GTestTempDir () |
GoogleString | GetHostname () |
Determine the local hostname. | |
bool | IsLocalhost (StringPiece host_to_test, StringPiece hostname) |
testing::PolymorphicMatcher < EqualsProtoMatcher > | EqualsProto (const GoogleString &x) |
bool | ParseProtoFromStringPiece (StringPiece sp, protobuf::MessageLite *proto) |
namespace protobuf | |
bool | ParseTextFormatProtoFromString (const GoogleString &s, protobuf::Message *proto) |
uint64 | RollingHash (const char *buf, size_t start, size_t n) |
Compute the rolling hash of buf[start : start + n - 1]. | |
uint64 | NextRollingHash (const char *buf, size_t start, size_t n, uint64 prev) |
template<class CharTransform , typename IntType > | |
IntType | HashString (const char *s, size_t len) |
size_t | JoinHash (size_t a, size_t b) |
GoogleString | IntegerToString (int i) |
GoogleString | UintToString (unsigned int i) |
GoogleString | Integer64ToString (int64 i) |
GoogleString | PointerToString (void *pointer) |
bool | StringToInt (const char *in, int *out) |
bool | StringToInt64 (const char *in, int64 *out) |
bool | StringToInt (const GoogleString &in, int *out) |
bool | StringToInt64 (const GoogleString &in, int64 *out) |
bool | StringToDouble (const char *in, double *out) |
bool | StringToDouble (GoogleString in, double *out) |
bool | StringToDouble (StringPiece in, double *out) |
StringPiece | PieceAfterEquals (StringPiece piece) |
GoogleString | StrCat (StringPiece a, StringPiece b) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i) |
namescape internal More... | |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u, StringPiece v) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u, StringPiece v, StringPiece w) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u, StringPiece v, StringPiece w, StringPiece x) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u, StringPiece v, StringPiece w, StringPiece x, StringPiece y) |
GoogleString | StrCat (StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i, StringPiece j, StringPiece k, StringPiece l, StringPiece m, StringPiece n, StringPiece o, StringPiece p, StringPiece q, StringPiece r, StringPiece s, StringPiece t, StringPiece u, StringPiece v, StringPiece w, StringPiece x, StringPiece y, StringPiece z) |
void | StrAppend (GoogleString *target, StringPiece a) |
void | StrAppend (GoogleString *target, StringPiece a, StringPiece b) |
void | StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c) |
void | StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d) |
void | StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e) |
void | StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f) |
void | StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g) |
void | StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h) |
void | StrAppend (GoogleString *target, StringPiece a, StringPiece b, StringPiece c, StringPiece d, StringPiece e, StringPiece f, StringPiece g, StringPiece h, StringPiece i) |
void | SplitStringPieceToVector (StringPiece sp, StringPiece separators, StringPieceVector *components, bool omit_empty_strings) |
void | SplitStringUsingSubstr (StringPiece full, StringPiece substr, StringPieceVector *result) |
void | BackslashEscape (StringPiece src, StringPiece to_escape, GoogleString *dest) |
GoogleString | CEscape (StringPiece src) |
bool | HasPrefixString (StringPiece str, StringPiece prefix) |
void | UpperString (GoogleString *str) |
void | LowerString (GoogleString *str) |
bool | OnlyWhitespace (const GoogleString &str) |
int | GlobalReplaceSubstring (StringPiece substring, StringPiece replacement, GoogleString *s) |
stringpiece_ssize_type | FindIgnoreCase (StringPiece haystack, StringPiece needle) |
int | GlobalEraseBracketedSubstring (StringPiece left, StringPiece right, GoogleString *string) |
GoogleString | JoinStringStar (const ConstStringStarVector &vector, StringPiece delim) |
char | UpperChar (char c) |
char | LowerChar (char c) |
char | IsHtmlSpace (char c) |
char * | strdup (const char *str) |
int | StringCaseCompare (StringPiece s1, StringPiece s2) |
Case-insensitive string comparison that is locale-independent. | |
bool | IsAsciiAlphaNumeric (char ch) |
bool | IsHexDigit (char c) |
Convenience functions. | |
bool | IsDecimalDigit (char c) |
bool | TrimWhitespace (StringPiece *str) |
void | TrimQuote (StringPiece *str) |
In-place removal of leading and trailing quote. Removes whitespace as well. | |
void | TrimUrlQuotes (StringPiece *str) |
bool | TrimLeadingWhitespace (StringPiece *str) |
Trims leading HTML whitespace. Returns true if any whitespace was trimmed. | |
bool | TrimTrailingWhitespace (StringPiece *str) |
Trims trailing HTML whitespace. Returns true if any whitespace was trimmed. | |
void | TrimWhitespace (StringPiece in, GoogleString *output) |
bool | AccumulateDecimalValue (char c, uint32 *value) |
bool | AccumulateHexValue (char c, uint32 *value) |
bool | MemCaseEqual (const char *s1, size_t size1, const char *s2, size_t size2) |
Return true iff the two strings are equal, ignoring case. | |
bool | StringCaseEqual (StringPiece s1, StringPiece s2) |
bool | StringCaseStartsWith (StringPiece str, StringPiece prefix) |
Return true iff str starts with prefix, ignoring case. | |
bool | StringCaseEndsWith (StringPiece str, StringPiece suffix) |
Return true iff str ends with suffix, ignoring case. | |
bool | StringEqualConcat (StringPiece str, StringPiece first, StringPiece second) |
int | CountCharacterMismatches (StringPiece s1, StringPiece s2) |
bool | SplitStringPieceToIntegerVector (StringPiece src, StringPiece separators, std::vector< int > *ints) |
bool | EndsInSlash (StringPiece path) |
Does a path end in slash? | |
void | EnsureEndsInSlash (GoogleString *dir) |
Make sure directory's path ends in '/'. | |
void | ParseShellLikeString (StringPiece input, std::vector< GoogleString > *output) |
int | CountSubstring (StringPiece text, StringPiece substring) |
GoogleString * | StringVectorAdd (StringVector *v) |
Appends new empty string to a StringVector and returns a pointer to it. | |
template<typename I > | |
void | AppendJoinIterator (GoogleString *dest, I start, I end, StringPiece sep) |
Append string-like objects accessed through an iterator. More... | |
template<typename C > | |
void | AppendJoinCollection (GoogleString *dest, const C &collection, StringPiece sep) |
template<typename C > | |
GoogleString | JoinCollection (const C &collection, StringPiece sep) |
const char * | BoolToString (bool b) |
Converts a boolean to string. | |
bool | IsAscii (char c) |
Using isascii with signed chars is unfortunately undefined. | |
bool | IsNonControlAscii (char c) |
bool | ConvertTimeToString (int64 time_ms, GoogleString *time_string) |
Converts time, in milliseconds, to a string. Returns false on failure. | |
bool | ConvertTimeToStringWithUs (int64 time_us, GoogleString *time_string) |
bool | ConvertStringToTime (const StringPiece &time_string, int64 *time_ms) |
const ContentType * | NameExtensionToContentType (const StringPiece &name) |
const ContentType * | MimeTypeToContentType (const StringPiece &mime_type) |
bool | ParseContentType (const StringPiece &content_type_str, GoogleString *mime_type, GoogleString *charset) |
void | MimeTypeListToContentTypeSet (const GoogleString &in, std::set< const ContentType * > *out) |
void | DataUrl (const ContentType &content_type, const Encoding encoding, const StringPiece &content, GoogleString *result) |
bool | IsDataUrl (const StringPiece url) |
Determine if the given URL is a data: URL. Cheaper than ParseDataUrl. | |
bool | IsDataImageUrl (const StringPiece url) |
Determine if the given URL is a data:image URL (aka an inlined image). | |
bool | ParseDataUrl (const StringPiece &url, const ContentType **content_type, Encoding *encoding, StringPiece *encoded_content) |
bool | DecodeDataUrlContent (Encoding encoding, const StringPiece &encoded_content, GoogleString *decoded_content) |
TYPED_TEST_CASE_P (SharedCircularBufferTestTemplate) | |
TYPED_TEST_P (SharedCircularBufferTestTemplate, TestCreate) | |
TYPED_TEST_P (SharedCircularBufferTestTemplate, TestAdd) | |
TYPED_TEST_P (SharedCircularBufferTestTemplate, TestClear) | |
TYPED_TEST_P (SharedCircularBufferTestTemplate, TestCircular) | |
REGISTER_TYPED_TEST_CASE_P (SharedCircularBufferTestTemplate, TestCreate, TestAdd, TestClear, TestCircular) | |
TYPED_TEST_CASE_P (SharedDynamicStringMapTestTemplate) | |
TYPED_TEST_P (SharedDynamicStringMapTestTemplate, TestSimple) | |
TYPED_TEST_P (SharedDynamicStringMapTestTemplate, TestCreate) | |
TYPED_TEST_P (SharedDynamicStringMapTestTemplate, TestAdd) | |
TYPED_TEST_P (SharedDynamicStringMapTestTemplate, TestQuarterFull) | |
TYPED_TEST_P (SharedDynamicStringMapTestTemplate, TestFillSingleThread) | |
TYPED_TEST_P (SharedDynamicStringMapTestTemplate, TestFillMultipleNonOverlappingThreads) | |
TYPED_TEST_P (SharedDynamicStringMapTestTemplate, TestFillMultipleOverlappingThreads) | |
REGISTER_TYPED_TEST_CASE_P (SharedDynamicStringMapTestTemplate, TestSimple, TestCreate, TestAdd, TestQuarterFull, TestFillSingleThread, TestFillMultipleNonOverlappingThreads, TestFillMultipleOverlappingThreads) | |
TYPED_TEST_CASE_P (SharedMemCacheDataTestTemplate) | |
TYPED_TEST_P (SharedMemCacheDataTestTemplate, TestFreeList) | |
TYPED_TEST_P (SharedMemCacheDataTestTemplate, TestLRU) | |
TYPED_TEST_P (SharedMemCacheDataTestTemplate, TestBlockLists) | |
REGISTER_TYPED_TEST_CASE_P (SharedMemCacheDataTestTemplate, TestFreeList, TestLRU, TestBlockLists) | |
TYPED_TEST_CASE_P (SharedMemCacheTestTemplate) | |
TYPED_TEST_P (SharedMemCacheTestTemplate, TestBasic) | |
TYPED_TEST_P (SharedMemCacheTestTemplate, TestReinsert) | |
TYPED_TEST_P (SharedMemCacheTestTemplate, TestReplacement) | |
TYPED_TEST_P (SharedMemCacheTestTemplate, TestReaderWriter) | |
TYPED_TEST_P (SharedMemCacheTestTemplate, TestConflict) | |
TYPED_TEST_P (SharedMemCacheTestTemplate, TestEvict) | |
TYPED_TEST_P (SharedMemCacheTestTemplate, TestSnapshot) | |
TYPED_TEST_P (SharedMemCacheTestTemplate, TestRegisterSnapshotFileCache) | |
TYPED_TEST_P (SharedMemCacheTestTemplate, TestCheckpointAndRestore) | |
REGISTER_TYPED_TEST_CASE_P (SharedMemCacheTestTemplate, TestBasic, TestReinsert, TestReplacement, TestReaderWriter, TestConflict, TestEvict, TestSnapshot, TestRegisterSnapshotFileCache, TestCheckpointAndRestore) | |
TYPED_TEST_CASE_P (SharedMemLockManagerTestTemplate) | |
TYPED_TEST_P (SharedMemLockManagerTestTemplate, TestBasic) | |
TYPED_TEST_P (SharedMemLockManagerTestTemplate, TestDestructorUnlock) | |
TYPED_TEST_P (SharedMemLockManagerTestTemplate, TestSteal) | |
REGISTER_TYPED_TEST_CASE_P (SharedMemLockManagerTestTemplate, TestBasic, TestDestructorUnlock, TestSteal) | |
TYPED_TEST_CASE_P (SharedMemStatisticsTestTemplate) | |
TYPED_TEST_P (SharedMemStatisticsTestTemplate, TestCreate) | |
TYPED_TEST_P (SharedMemStatisticsTestTemplate, TestSet) | |
TYPED_TEST_P (SharedMemStatisticsTestTemplate, TestClear) | |
TYPED_TEST_P (SharedMemStatisticsTestTemplate, TestAdd) | |
TYPED_TEST_P (SharedMemStatisticsTestTemplate, TestSetReturningPrevious) | |
TYPED_TEST_P (SharedMemStatisticsTestTemplate, TestHistogram) | |
TYPED_TEST_P (SharedMemStatisticsTestTemplate, TestHistogramRender) | |
TYPED_TEST_P (SharedMemStatisticsTestTemplate, TestHistogramExtremeBuckets) | |
TYPED_TEST_P (SharedMemStatisticsTestTemplate, TestHistogramNoExtraClear) | |
TYPED_TEST_P (SharedMemStatisticsTestTemplate, TestTimedVariableEmulation) | |
REGISTER_TYPED_TEST_CASE_P (SharedMemStatisticsTestTemplate, TestCreate, TestSet, TestClear, TestAdd, TestSetReturningPrevious, TestHistogram, TestHistogramRender, TestHistogramNoExtraClear, TestHistogramExtremeBuckets, TestTimedVariableEmulation) | |
TYPED_TEST_CASE_P (SharedMemTestTemplate) | |
TYPED_TEST_P (SharedMemTestTemplate, TestRewrite) | |
TYPED_TEST_P (SharedMemTestTemplate, TestRewriteReattach) | |
TYPED_TEST_P (SharedMemTestTemplate, TestLarge) | |
TYPED_TEST_P (SharedMemTestTemplate, TestDistinct) | |
TYPED_TEST_P (SharedMemTestTemplate, TestDestroy) | |
TYPED_TEST_P (SharedMemTestTemplate, TestCreateTwice) | |
TYPED_TEST_P (SharedMemTestTemplate, TestTwoKids) | |
TYPED_TEST_P (SharedMemTestTemplate, TestMutex) | |
REGISTER_TYPED_TEST_CASE_P (SharedMemTestTemplate, TestRewrite, TestRewriteReattach, TestLarge, TestDistinct, TestDestroy, TestCreateTwice, TestTwoKids, TestMutex) | |
TYPED_TEST_CASE_P (ThreadSystemTestTemplate) | |
TYPED_TEST_P (ThreadSystemTestTemplate, TestStartJoin) | |
TYPED_TEST_P (ThreadSystemTestTemplate, TestSync) | |
REGISTER_TYPED_TEST_CASE_P (ThreadSystemTestTemplate, TestStartJoin, TestSync) | |
void | ParseGflags (const char *progname, int *argc, char ***argv) |
Matcher< ImageRewriteInfo > | LogImageRewriteActivityMatcher (Matcher< const char * > id, Matcher< const GoogleString & > url, Matcher< RewriterApplication::Status > status, Matcher< bool > is_image_inlined, Matcher< bool > is_critical_image, Matcher< bool > is_url_rewritten, Matcher< int > size, Matcher< bool > try_low_res_src_insertion, Matcher< bool > low_res_src_inserted, Matcher< ImageType > low_res_image_type, Matcher< int > low_res_data_size) |
apr_pool_t * | AprCreateThreadCompatiblePool (apr_pool_t *parent_pool) |
Variables | |
const char | kGaSnippetGetTracker [] = "_modpagespeed_getRewriteTracker(" |
const char | kGaSnippetPrefix [] |
const char | kGaSnippetSuffix [] |
const int64 | kBeaconTimeoutIntervalMs = Timer::kMinuteMs |
const int64 | kHighFreqBeaconCount = 3 |
const int64 | kLowFreqBeaconMult = 100 |
const int64 | kNonceExpirationLimit = 5 |
const char | kGAExperimentSnippet [] |
Visible only for use in tests. | |
const char | kGAJsSnippet [] |
const char | kAnalyticsJsSnippet [] |
const char | kAnalyticsJsIncreaseSiteSpeedTracking [] |
const char | kAnalyticsJsIncreaseSiteSpeedTrackingMinimal [] |
const char | kContentExperimentsJsClientUrl [] |
const char | kContentExperimentsNonNumericVariantComment [] |
const char | kContentExperimentsSetChosenVariationSnippet [] |
const char | kContentExperimentsSetExpAndVariantSnippet [] |
const char | kGASpeedTracking [] |
const int | kNoQualityGiven = -1 |
const char | kPagespeedOriginalUrl [] = "mod_pagespeed_original_url" |
const char | kModPagespeedFilterName [] = "MOD_PAGESPEED_OUTPUT_FILTER" |
Filter used for HTML rewriting. | |
const char | kModPagespeedFixHeadersName [] = "MOD_PAGESPEED_FIX_HEADERS_FILTER" |
Filter used to fix headers after mod_headers runs. | |
const char | kModPagespeedInPlaceFilterName [] = "MOD_PAGESPEED_IN_PLACE_FILTER" |
const char | kModPagespeedInPlaceFixHeadersName [] |
Second filter fixes headers to avoid caching by shared proxies. More... | |
const char | kModPagespeedInPlaceCheckHeadersName [] |
const char | kPageUrl [] = "page.html" |
const char | kBackgroundFetchHeader [] = "X-Background-Fetch" |
const char | kUtf8Charset [] = "utf-8" |
The charsets we understand. Currently only those that have BOMs below. | |
const char | kUtf16BigEndianCharset [] = "utf-16be" |
const char | kUtf16LittleEndianCharset [] = "utf-16le" |
const char | kUtf32BigEndianCharset [] = "utf-32be" |
const char | kUtf32LittleEndianCharset [] = "utf-32le" |
const char | kUtf8Bom [] = "\xEF\xBB\xBF" |
The Byte-Order-Mark (BOM) for the various UTF encodings. | |
const char | kUtf16BigEndianBom [] = "\xFE\xFF" |
const char | kUtf16LittleEndianBom [] = "\xFF\xFE" |
const char | kUtf32BigEndianBom [] = "\x00\x00\xFE\xFF" |
const char | kUtf32LittleEndianBom [] = "\xFF\xFE\x00\x00" |
const uint64 | kRollingHashCharTable [256] |
Per character hash values. Exported for use in NextRollingHash. More... | |
const int | kStackBufferSize = 10000 |
const ContentType & | kContentTypeHtml |
HTML-like (i.e. rewritable) text: | |
const ContentType & | kContentTypeXhtml |
const ContentType & | kContentTypeCeHtml |
const ContentType & | kContentTypeJavascript |
Other text: | |
const ContentType & | kContentTypeCss |
const ContentType & | kContentTypeText |
const ContentType & | kContentTypeXml |
const ContentType & | kContentTypeJson |
const ContentType & | kContentTypeSourceMap |
const ContentType & | kContentTypePng |
Images: | |
const ContentType & | kContentTypeGif |
const ContentType & | kContentTypeJpeg |
const ContentType & | kContentTypeSwf |
const ContentType & | kContentTypeWebp |
const ContentType & | kContentTypeIco |
const ContentType & | kContentTypePdf |
PDF: | |
const ContentType & | kContentTypeBinaryOctetStream |
Binary/octet-stream. | |
const HttpOptions | kDefaultHttpOptionsForTests |
const HttpOptions | kDeprecatedDefaultHttpOptions |
const int | kNumIterations |
Number of iterations of nonce generation to check in tests. | |
const int | kSmallNumIterations |
Unit-test framework for wget fetcher.
Mock PropertyPage for use in unit tests.
Thread-synchronization utility class for reproducing races in unit tests.
Infrastructure for testing html parsing and rewriting.
Shared infrastructure for testing cache implementations.
Helper class for sending concurrent traffic to a cache during unit tests.
for pair
Constant for allocating stack buffers.
for StringPiece
namespace net_instaweb
for vector
namespace Json
for DCHECK
A set of utility functions for handling hostnames.
Use Chromium debug support.
Callback classes to support rewrite scheduling in CentralController.
Priority queue that supports incrementing the priority of a key.
Callback classes to support ExpensiveOperation features in CentralController.
extern "C"
Base class for tests which want a ServerContext.
for NULL
for StringSet, etc
Some common routines and constants for tests dealing with Images.
for GoogleString
A filter which does not modify the DOM, but counts statistics about it.
Base class for tests which do rewrites within CSS.
namespace Css
for ResourcePtr
DO NOT EDIT. Generated by ./google_analytics_snippet_gen.py.
Callbacks used for testing.
for size_t
for FILE
html_filter that passes data through unmodified, but logs statistics about the data as it goes by. It should be possible to create many instances of this class and insert them at different points in the rewriting flow Goal is to log: NUM_EXPLICIT_CLOSED - <tag> </tag> pairs NUM_IMPLICIT_CLOSED - <tag> for implicitly-closed tag NUM_BRIEF_CLOSED - </tag> NUM_CLOSED - Sum of above three NUM_UNCLOSED - <tag> without matching </tag> NUM_SPURIOUS_CLOSED - </tag> without preceding <tag>; UNCOUNTED RIGHT NOW! NUM_TAGS - Total number of opening tags NUM_CDATA - cdata sections NUM_COMMENTS - comments NUM_DIRECTIVES - directives NUM_DOCUMENTS - started documents NUM_IE_DIRECTIVES - ie directives Reporting: We report this information via a StatisticsLog: filter.ToString(log) Two sets of statistics (eg before and after processing) can be compared using before.Equals(after),
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http:///www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Helper class to make RewriteTestBase tests that use a custom options subclass.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Search for synchronous loads of Google Analytics similar to the following:
<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js type='text/javascript'" + "%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-XXXXX-X"); pageTracker._trackPageview(); } catch(err) {} </script>
Replace the document.write with a new snippet that loads ga.js asynchronously. Also, insert a replacement for _getTracker that converts any calls to the synchronous API to the asynchronous API. The _getTracker replacement is a new function that returns a mock tracker object. Anytime a synchronous API method is called, the mock tracker fowards it to a _gaq.push(...) call.
An alternative approach would been to find all the API calls and rewrite them to the asynchronous API. However, to be done properly, it would have had the added complication of using a JavaScript compiler.
Unit-test the RewriteContext class. This is made simplest by setting up some dummy rewriters in our test framework.
We need to include rewrite_driver.h due to covariant return of html_parse() We need to include mock_timer.h to allow upcast to Timer*.
The httpd header must be after the apache_rewrite_driver_factory.h. Otherwise, the compiler will complain "strtoul_is_not_a_portable_function_use_strtol_instead".
for apr_status_t The httpd header must be after the instaweb_context.h. Otherwise, the compiler will complain "strtoul_is_not_a_portable_function_use_strtol_instead".
Implementation of ScheduleRewriteController that uses priority queue to process rewrites in the order of most requested. Gurantees that at most one client will be waiting for a given key. Also limits the number of queued rewrites and the number of rewrites running in parallel.
Every request is tracked in a Rewrite object, the lifetime of which is described by the following state digram:
begin |
+--—v--—+ | | Queue full | STOPPED +--------—> delete <------—+ | | | +--—+--—+ | | | ScheduleRewrite() | Other Rewrite needs | +-—+ | slot in queue and | | | ScheduleRewrite() | this is oldest rewrite +--—v-—+-+ | (increments priority | in AWAITING_RETRY. | <–+ discards old request) | | QUEUED | | | <–+ ScheduleRewrite() +–+----—+ +--—+---—+ | (increments priority)| | | +--------------------—+ AWAITING | Pop Queue | RETRY | (when most requested) | | | +-—^--—+ | +--—+ | | | | ScheduleRewrite() | +--—v—+-+ | (increments priority | | | | rejects new request) | | RUNNING <—+ | | | | +–+-—+—+ | | | | | +---------------------------------—+ | NotifyFailure() | +--------------------------—> delete NotifySuccess()
RequestResultRpcClient manages the client portion of a gRPC connection. It is the client-side counterpart to RequestResultRpcHandler. See class comments below.
RpcHandler for the case there the client uses a streaming RPC to the server to attempt an operation, waits for response and then calls back to let the server know it's done.
The first message on the RPC will result in a call to HandleClientRequest(), which the client should use to notify its controller of a request. When the controller decides if it will allow the rewrite to proceed it invokes the provided callback and we return that decision to the client via NotifyClient(). Once the client completes, it sends back a final message which will result in a final call to HandleClientResult().
If the client disconnects after the call to HandleClientRequest() but before the call to HandleClientResult(), we call HandleOperationFailed() to let the subclass know.
A set of utility functions for handling character sets/encodings and related concepts like byte-order-marks (BOM). Currently the only methods relate to BOMs.
Include this file when defining an object that will reside in a pool. There are a couple of ways of defining such an object, but all of them require us to use the PoolPosition typedef. Most simply, we can extend the PoolElement type defined here—but in practice, we want to avoid multiple inheritance just to store a simple back link, and we're better off providing an accessor at pool construction time instead.
Chromium has moved scoped_ptr.h from base directory to base/memory. Thankfully, even older version we built against had it available in base/memory, just with the compatibility alias still available.
for size_t for memcpy
NOTE: THIS CODE IS DEAD. IT IS ONLY LINKED BY THE SPEED_TEST PROVING IT'S SLOWER THAN FastWildcardGroup, PLUS ITS OWN UNIT TEST.
This file defines the MultipleFrame API for reading and writing static and animated images.
DO NOT INCLUDE LIBJPEG HEADERS HERE. Doing so causes build errors on Windows.
Note: we should not include setjmp.h here, since libpng 1.2 headers include it themselves, and get unhappy if we do it ourselves.
This file provides two sets of adapters for use by {Scanline, MultipleFrame} clients wishing to use code provided by the {MultipleFrame, Scanline} classes.
Data structure operation helpers for SharedMemCache. See the top of shared_mem_cache.cc for data format descriptions.
This contains things that are common between unit tests for Worker and its subclasses, such as runtime creation and various closures.
typedef std::set<Atom, AtomCompare> net_instaweb::AtomSet |
A set of atoms can be constructed very efficiently. Note that iteration over this set will not be in alphabetical order.
typedef Callback2<StringPiece, bool*> net_instaweb::HeaderPredicateFn |
Defines a predicate function used to select which request-headers to copy. The callback sets the bool* arg (.second) to true if it wants to include the header.
The StringPiece is the name of the header.
typedef Callback2<const GoogleUrl&, bool*> net_instaweb::ResourceUrlClaimant |
Sometimes some portions of URL space need to be handled differently by dedicated resource subclasses. ResourceProvider callbacks are used to teach RewriteDriver about these, so it knows not to build regular UrlInputResource objects.
typedef google::protobuf::io::StringOutputStream net_instaweb::StringOutputStream |
|
strong |
Directives mentioned in the spec that we care (and comments for those where we don't).
Enumerator | |
---|---|
kChildSrc |
These take source list: |
kFrameSrc |
font-src doesn't actually matter for us since the Google font support only touches the loader CSS, not the font URL itself. |
kScriptSrc |
manifest-src media-src object-src |
kBaseUri |
worker-src |
kNumSourceListDirectives |
form-action frame-ancestors These take other stuff. If we actually parsed them, we would want to distinguish them so we don't stick them into the array of CspSourceList* the other stuff goes into. plugin-types sandbox —
|
Enumerator | |
---|---|
UNKNOWN |
Used only for output of ParseDataUrl. |
PLAIN |
LATIN1, ///<
|
This enumerates different states of the fetched response. This module is mostly concerned with specific failure statuses, but it's convenient to have non-failure ones in the same enum.
See MessageForInlineResult for enum meanings.
Enumerator | |
---|---|
INLINE_RESPONSIVE |
Image should not be inlined because it is part of a responsive image. |
Used to signal whether optimization was successful or not to RewriteContext::RewriteDone.
bool net_instaweb::AccumulateDecimalValue | ( | char | c, |
uint32 * | value | ||
) |
Accumulates a decimal value from 'c' into *value. Returns false and leaves *value unchanged if c is not a decimal digit.
bool net_instaweb::AccumulateHexValue | ( | char | c, |
uint32 * | value | ||
) |
Accumulates a hex value from 'c' into *value Returns false and leaves *value unchanged if c is not a hex digit.
void net_instaweb::ApacheRequestToRequestHeaders | ( | const request_rec & | request, |
RequestHeaders * | request_headers, | ||
HeaderPredicateFn * | predicate | ||
) |
Converts Apache header structure into RequestHeaders, selecting only those for which the predicate sets its bool* argument to true. If the predicate is NULL, then all the headers are transferred.
The predicate should be created with NewPermanentCallback and stored in a scoped_ptr<Callback2>, so that it is deleted after this function completes.
void net_instaweb::ApacheRequestToResponseHeaders | ( | const request_rec & | request, |
ResponseHeaders * | headers, | ||
ResponseHeaders * | err_headers | ||
) |
Converts Apache header structure (request.headers_out) into ResponseHeaders headers. If err_headers is not NULL then request.err_headers_out is copied into it. In the event that headers == err_headers, the headers from request.err_headers_out will be appended to the list of headers, but no merging occurs.
void net_instaweb::AppendJoinCollection | ( | GoogleString * | dest, |
const C & | collection, | ||
StringPiece | sep | ||
) |
Append an arbitrary iterable collection of strings such as a StringSet, StringVector, or StringPieceVector, separated by a given separator, with given initial and final strings. Argument order chosen to be consistent with StrAppend.
void net_instaweb::AppendJoinIterator | ( | GoogleString * | dest, |
I | start, | ||
I | end, | ||
StringPiece | sep | ||
) |
Append string-like objects accessed through an iterator.
Skip a lot of set-up and tear-down in empty case.
< No separator before initial element
apr_pool_t* net_instaweb::AprCreateThreadCompatiblePool | ( | apr_pool_t * | parent_pool | ) |
Creates a pool that can be used in any thread, even when run in Apache prefork.
1) This method must be called from startup phase only 2) Each pool must be accessed only from a single thread (or otherwise have its access serialized) 3) Different pools returned by this function may be safely used concurrently. 4) It's OK to just use ap_pool_create to create child pools of this one from multiple threads; those will be re-entrant too (but pools created merely as children of Apache's pools will not be reentrant in prefork)
In short, pools returned by this method are not fully threadsafe, but at least they are not thread-hostile, which is what you get with apr_pool_create in Prefork.
Note: the above is all about the release version of the pool code, the checking one has some additional locking!
WARNING: you must not call apr_pool_clear on the returned pool. The returned pool can be used to create sub-pools that can be accessed in distinct threads, due to a mutex injected into the allocator. However, if you call apr_pool_clear on the returned pool, the allocator's mutex will be freed and the pointer to it will be dangling. Subsequent allocations are likely to crash.
Image* net_instaweb::BlankImageWithOptions | ( | int | width, |
int | height, | ||
ImageType | type, | ||
const StringPiece & | tmp_dir, | ||
Timer * | timer, | ||
MessageHandler * | handler, | ||
Image::CompressionOptions * | options | ||
) |
Creates a blank image of the given dimensions and type. For now, this is assumed to be an 8-bit 4-channel image transparent image.
|
inline |
char to int without sign extension.
The following four helper functions were moved here for testability. We ran into problems with sign extension under different compiler versions, and we'd like to catch regressions on that front in the future.
bool net_instaweb::ConvertStringToTime | ( | const StringPiece & | time_string, |
int64 * | time_ms | ||
) |
Converts time in string format, to the number of milliseconds since 1970. Returns false on failure.
bool net_instaweb::ConvertTimeToStringWithUs | ( | int64 | time_us, |
GoogleString * | time_string | ||
) |
Converts time, in microseconds, to a string with accuracy at us. Returns false on failure.
int net_instaweb::CountCharacterMismatches | ( | StringPiece | s1, |
StringPiece | s2 | ||
) |
Return the number of mismatched chars in two strings. Useful for string comparisons without short-circuiting to prevent timing attacks. See http://codahale.com/a-lesson-in-timing-attacks/
int net_instaweb::CountSubstring | ( | StringPiece | text, |
StringPiece | substring | ||
) |
Counts the number of times that substring appears in text Note: for a substring that can overlap itself, it counts not necessarily disjoint occurrences of the substring. For example: "aaa" appears in "aaaaa" 3 times, not once
void net_instaweb::DataUrl | ( | const ContentType & | content_type, |
const Encoding | encoding, | ||
const StringPiece & | content, | ||
GoogleString * | result | ||
) |
Create a data: url from the given content-type and content. See: http://en.wikipedia.org/wiki/Data_URI_scheme
The ENCODING indicates how to encode the content; for binary data this is UTF8, for ascii / Latin1 it's LATIN1. If you have ascii without high bits or NULs, use LATIN1. If you have alphanumeric data, use PLAIN (which doesn't encode at all).
Note in particular that IE<=7 does not support this, so it makes us UserAgent-dependent. It also pretty much requires outgoing content to be compressed as we tend to base64-encode the content.
T* net_instaweb::DecodeFromPropertyCache | ( | const PropertyCache * | cache, |
AbstractPropertyPage * | page, | ||
const PropertyCache::Cohort * | cohort, | ||
StringPiece | property_name, | ||
int64 | cache_ttl_ms, | ||
PropertyCacheDecodeResult * | status | ||
) |
Decodes a protobuf of type T from the property named 'property_name' in the cohort 'cohort_name' in the given property cache, and makes sure it has not exceeded its TTL of 'cache_ttl_ms' (a value of -1 will disable this check).
*status will denote the decoding state; if it's kPropertyCacheDecodeOk then a pointer to a freshly allocated decoded proto is returned; otherwise NULL is returned.
*status set by helper
T* net_instaweb::DecodeFromPropertyCache | ( | RewriteDriver * | driver, |
const PropertyCache::Cohort * | cohort, | ||
StringPiece | property_name, | ||
int64 | cache_ttl_ms, | ||
PropertyCacheDecodeResult * | status | ||
) |
Wrapper version of the above function that gets the property cache and the property page from the given driver.
const PropertyValue* net_instaweb::DecodeFromPropertyCacheHelper | ( | const PropertyCache * | cache, |
AbstractPropertyPage * | page, | ||
const PropertyCache::Cohort * | cohort, | ||
StringPiece | property_name, | ||
int64 | cache_ttl_ms, | ||
PropertyCacheDecodeResult * | status | ||
) |
Returns PropertyValue object for given cohort and property name, setting *status and returning NULL if any errors were found.
void net_instaweb::DisableCacheControlHeader | ( | request_rec * | request | ) |
Updates caching headers to ensure the resulting response is not cached. Removes any max-age specification, and adds max-age=0, no-cache.
void net_instaweb::ErrorHeadersToApacheRequest | ( | const ResponseHeaders & | err_response_headers, |
request_rec * | request | ||
) |
Converts ResponseHeaders into Apache request err_headers. This function does not alter the status code or the major/minor version of the Apache request.
void net_instaweb::EscapeToJsonStringLiteral | ( | const StringPiece & | original, |
bool | add_quotes, | ||
GoogleString * | escaped | ||
) |
Appends version of original escaped for JSON string syntax to *escaped, (optionally with quotes, if asked).
Warning: this is dangerous if you have non-ASCII characters, in that it doesn't interpret the input encoding, and will just blindly turn them into escapes. However, it will ensure that the output won't have any dangerous characters that can cause format sniff.
void net_instaweb::EscapeToJsStringLiteral | ( | const StringPiece & | original, |
bool | add_quotes, | ||
GoogleString * | escaped | ||
) |
Appends version of original escaped for JS string syntax, safe for inclusion into HTML, to *escaped, (optionally with quotes, if asked).
stringpiece_ssize_type net_instaweb::FindIgnoreCase | ( | StringPiece | haystack, |
StringPiece | needle | ||
) |
Returns the index of the start of needle in haystack, or StringPiece::npos if it's not present.
const StringPiece net_instaweb::GetCharsetForBom | ( | const StringPiece | contents | ) |
Return the charset string for the given contents' BOM if any. If the contents start with one of the BOMs defined above then the corresponding charset is returned, otherwise an empty StringPiece.
void net_instaweb::GetCriticalKeysFromProto | ( | int64 | support_percentage, |
const CriticalKeys & | critical_keys, | ||
StringSet * | keys | ||
) |
Generate a list of the critical keys from a proto, storing it into keys. Takes into account legacy keys that may have been added before. A key is considered critical if its support is at least support_percentage of the maximum possible support value (which ramps up as beacon results arrive). When support_percentage = 0, any support is sufficient; when support_percentage = 100 all beacon results must support criticality.
int net_instaweb::GlobalEraseBracketedSubstring | ( | StringPiece | left, |
StringPiece | right, | ||
GoogleString * | string | ||
) |
Erase shortest substrings in string bracketed by left and right, working from the left. ("[", "]", "abc[def]g[h]i]j[k") -> "abcgi]j[k" Returns the number of substrings erased.
int net_instaweb::GlobalReplaceSubstring | ( | StringPiece | substring, |
StringPiece | replacement, | ||
GoogleString * | s | ||
) |
Replaces all instances of 'substring' in 's' with 'replacement'. Returns the number of instances replaced. Replacements are not subject to re-matching.
NOTE: The string pieces must not overlap 's'.
|
inline |
A hash function for strings that can be used both in a case-sensitive and case-insensitive way
This implemention is based on code in third_party/chromium/src/base/hash_tables.h.
bool net_instaweb::HasPrefixString | ( | StringPiece | str, |
StringPiece | prefix | ||
) |
|
inline |
Determines whether the character is a US Ascii number or letter. This is preferable to isalnum() for working with computer languages, as opposed to human languages.
|
inline |
Based on the CriticalKeys data seen so far, describe whether beacon metadata is available. This returns false until data is received.
|
inline |
Check if given character is an HTML (or CSS) space (not the same as isspace, and not locale-dependent!). Note in particular that isspace always includes '' and HTML does not. See: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#space-character http://www.w3.org/TR/CSS21/grammar.html
bool net_instaweb::IsLocalhost | ( | StringPiece | host_to_test, |
StringPiece | hostname | ||
) |
Determine if the given host is localhost or a variant thereof: localhost, 127.0.0.1 (IPv4), ::1 (IPv6), or hostname (the local hostname).
TODO(sligocki): Cover other representations of IPv6 localhost IP?
TODO(matterbury): Handle all 127.0.0.0/8 address since they are 'localhost'.
|
inline |
Tests if c is a standard (non-control) ASCII char 0x20-0x7E. Note: This does not include TAB (0x09), LF (0x0A) or CR (0x0D).
|
inline |
Combine two hash values in a reasonable way. Here to avoid excessive mysticism in the remainder of the code.
< Uses different prime multipliers.
GoogleString net_instaweb::JoinStringStar | ( | const ConstStringStarVector & | vector, |
StringPiece | delim | ||
) |
Output a string which is the combination of all values in vector, separated by delim. Does not ignore empty strings in vector. So: JoinStringStar({"foo", "", "bar"}, ", ") == "foo, , bar". (Pseudocode)
Matcher<ImageRewriteInfo> net_instaweb::LogImageRewriteActivityMatcher | ( | Matcher< const char * > | id, |
Matcher< const GoogleString & > | url, | ||
Matcher< RewriterApplication::Status > | status, | ||
Matcher< bool > | is_image_inlined, | ||
Matcher< bool > | is_critical_image, | ||
Matcher< bool > | is_url_rewritten, | ||
Matcher< int > | size, | ||
Matcher< bool > | try_low_res_src_insertion, | ||
Matcher< bool > | low_res_src_inserted, | ||
Matcher< ImageType > | low_res_image_type, | ||
Matcher< int > | low_res_data_size | ||
) |
A custom matcher to match more than 10 arguments allowed by MOCK_METHOD* macros.
|
inline |
lower-case a single character and return it. tolower() changes based on locale. We don't want this!
Function* net_instaweb::MakeFunction | ( | C * | object, |
void(C::*)() | run, | ||
void(C::*)() | cancel | ||
) |
Makes a Function* that calls a 0-arg class method, or a 0-arg cancel method.
Function* net_instaweb::MakeFunction | ( | C * | object, |
void(C::*)(T) | run, | ||
void(C::*)(T) | cancel, | ||
T | t | ||
) |
Makes a Function* that calls a 1-arg class method, or a 1-arg cancel method.
Function* net_instaweb::MakeFunction | ( | C * | object, |
void(C::*)(T, U) | run, | ||
void(C::*)(T, U) | cancel, | ||
T | t, | ||
U | u | ||
) |
Makes a Function* that calls a 2-arg class method, or a 2-arg cancel method.
Function* net_instaweb::MakeFunction | ( | C * | object, |
void(C::*)(T, U, V) | run, | ||
void(C::*)(T, U, V) | cancel, | ||
T | t, | ||
U | u, | ||
V | v | ||
) |
Makes a Function* that calls a 3-arg class method, or a 3-arg cancel method.
Function* net_instaweb::MakeFunction | ( | C * | object, |
void(C::*)(T, U, V, W) | run, | ||
void(C::*)(T, U, V, W) | cancel, | ||
T | t, | ||
U | u, | ||
V | v, | ||
W | w | ||
) |
Makes a Function* that calls a 4-arg class method, or a 4-arg cancel method.
void net_instaweb::MimeTypeListToContentTypeSet | ( | const GoogleString & | in, |
std::set< const ContentType * > * | out | ||
) |
Splits comma-separated string to elements and tries to match each one with a recognized content type. The out set will be cleared first and must be present.
const ContentType* net_instaweb::NameExtensionToContentType | ( | const StringPiece & | name | ) |
Given a name (file or url), see if it has the canonical extension corresponding to a particular content type.
Image* net_instaweb::NewImage | ( | const StringPiece & | original_contents, |
const GoogleString & | url, | ||
const StringPiece & | file_prefix, | ||
Image::CompressionOptions * | options, | ||
Timer * | timer, | ||
MessageHandler * | handler | ||
) |
Image owns none of its inputs. All of the arguments to NewImage(...) (the original_contents in particular) must outlive the Image object itself. The intent is that an Image is created in a scoped fashion from an existing known resource.
The options should be set via Image::SetOptions after construction, before the image is used for anything but determining its natural dimension size.
|
inline |
Given the rolling hash prev of buf[start - 1 : start + n - 2], efficiently compute the hash of buf[start : start + n - 1]. Note that this indexes buf[start - 1], so we can't just use a StringPiece here. We eschew StringPiece in any case, because of efficiency.
Note that to get efficient operation here for fixed n (eg when we're doing something like Rabin-Karp string matching), we must inline the computation of shift amounts and then hoist them as loop invariants. That is why this function (intended for use in an inner loop) is inlined.
In a reasonable loop, the following two tests should be eliminated based on contextual information, if our compiler is optimizing enough.
< rotate left 1
Corner case: shift by >= 64 bits is not defined in C. gcc had better constant-fold this to a rotate! (It appears to.) We inline in large part to ensure the truthiness of this fact.
rotate left by shift (equiv to rotating left n times).
bool net_instaweb::OptimizeWebp | ( | const GoogleString & | original_jpeg, |
int | configured_quality, | ||
WebpProgressHook | progress_hook, | ||
void * | progress_hook_data, | ||
GoogleString * | compressed_webp, | ||
MessageHandler * | message_handler | ||
) |
Optimizer in the style of pagespeed/kernel/image/jpeg_optimizer.h that creates a webp-formatted image in compressed_webp from the jpeg image in original_jpeg. Indicates failure by returning false, in which case compressed_webp may be filled with junk.
bool net_instaweb::ParseContentType | ( | const StringPiece & | content_type_str, |
GoogleString * | mime_type, | ||
GoogleString * | charset | ||
) |
Extracts mime_type and charset from a string of the form "<mime_type>; charset=<charset>". If mime_type or charset is not specified, they will be populated with the empty string. Returns true if either a mime_type or a charset was extracted.
bool net_instaweb::ParseDataUrl | ( | const StringPiece & | url, |
const ContentType ** | content_type, | ||
Encoding * | encoding, | ||
StringPiece * | encoded_content | ||
) |
Dismantle a data: url into its component pieces, but do not decode the content. Note that encoded_content will be a substring of the input url and shares its lifetime. Invalidates all outputs if url does not parse.
void net_instaweb::ParseShellLikeString | ( | StringPiece | input, |
std::vector< GoogleString > * | output | ||
) |
Given a string such as: a b "c d" e 'f g' Parse it into a vector: ["a", "b", "c d", "e", "f g"] NOTE: actually used for html doctype recognition, so assumes HtmlSpace separation.
StringPiece net_instaweb::PieceAfterEquals | ( | StringPiece | piece | ) |
Returns the part of the piece after the first '=', trimming any white space found at the beginning or end of the resulting piece. Returns an empty string if '=' was not found.
void net_instaweb::PrepareForBeaconInsertionHelper | ( | CriticalKeys * | proto, |
NonceGenerator * | nonce_generator, | ||
RewriteDriver * | driver, | ||
bool | using_candidate_key_detection, | ||
BeaconMetadata * | result | ||
) |
Given a set of candidate critical keys, decide whether beaconing should take place. We should always beacon if there's new critical key data. Otherwise re-beaconing is based on a time and request interval, and 2 modes of beaconing frequency are supported. At first, beaconing occurs at a high frequency until we have collected kHighFreqBeaconCount beacons; after that, we transition into low frequency beaconing mode, where beaconing occurs less often. We also track the number of expired nonces since the last valid beacon was received to see if beaconing is set up correctly, and if it looks like it isn't, only do low frequency beaconing. Sets status and nonce appropriately in *result (nonce will be empty if no nonce is required). If candidate keys are not required, keys may be empty (but new candidate detection will not occur). If result->status != kDontBeacon, caller should write proto back to the property cache using UpdateInPropertyCache.
bool net_instaweb::ReduceWebpImageQuality | ( | const GoogleString & | original_webp, |
int | quality, | ||
GoogleString * | compressed_webp | ||
) |
Reduce the quality of the webp image. Indicates failure by returning false. WebP quality varies from 1 to 100. Original image will be returned if input quality is <1.
void net_instaweb::ResponseHeadersToApacheRequest | ( | const ResponseHeaders & | response_headers, |
request_rec * | request | ||
) |
Converts the ResponseHeaders to the output headers. This function does not alter the status code or the major/minor version of the Apache request.
bool net_instaweb::SplitStringPieceToIntegerVector | ( | StringPiece | src, |
StringPiece | separators, | ||
std::vector< int > * | ints | ||
) |
Parse a list of integers into a vector. Empty values are ignored. Returns true if all non-empty values are converted into integers.
void net_instaweb::SplitStringPieceToVector | ( | StringPiece | sp, |
StringPiece | separators, | ||
StringPieceVector * | components, | ||
bool | omit_empty_strings | ||
) |
Split sp into pieces that are separated by any character in the given string of separators, and push those pieces in order onto components.
void net_instaweb::SplitStringUsingSubstr | ( | StringPiece | full, |
StringPiece | substr, | ||
StringPieceVector * | result | ||
) |
Splits string 'full' using substr by searching it incrementally from left. Empty tokens are removed from the final result.
|
inline |
namescape internal
Supports 9 or more arguments
bool net_instaweb::StringEqualConcat | ( | StringPiece | str, |
StringPiece | first, | ||
StringPiece | second | ||
) |
Return true if str is equal to the concatenation of first and second. Note that this respects case.
bool net_instaweb::StringToDouble | ( | const char * | in, |
double * | out | ||
) |
Parses valid floating point number and returns true if string contains only that floating point number (ignoring leading/trailing whitespace). Note: This also parses hex and exponential float notation.
|
inline |
If there are embedded nulls, always fail.
|
inline |
NOTE: For a string of the form "45x", this sets *out = 45 but returns false. It sets *out = 0 given "Junk45" or "".
bool net_instaweb::StripUtf8Bom | ( | StringPiece * | contents | ) |
Strips any initial UTF-8 BOM (Byte Order Mark) from the given contents. Returns true if a BOM was stripped, false if not.
In addition to specifying the encoding in the ContentType header, one can also specify it at the beginning of the file using a Byte Order Mark.
Bytes Encoding Form 00 00 FE FF UTF-32, big-endian FF FE 00 00 UTF-32, little-endian FE FF UTF-16, big-endian FF FE UTF-16, little-endian EF BB BF UTF-8 See: http://www.unicode.org/faq/utf_bom.html
void net_instaweb::TrimUrlQuotes | ( | StringPiece * | str | ) |
In-place removal of multiple levels of leading and trailing quotes, include url-escaped quotes, optionally backslashed. Removes whitespace as well.
bool net_instaweb::TrimWhitespace | ( | StringPiece * | str | ) |
In-place removal of leading and trailing HTML whitespace. Returns true if any whitespace was trimmed.
|
inline |
Non-destructive TrimWhitespace. WARNING: in should not point inside output!
< Mutable copy
< Modifies temp
bool net_instaweb::UpdateCandidateKeys | ( | const StringSet & | keys, |
CriticalKeys * | proto, | ||
bool | clear_rebeacon_timestamp | ||
) |
Update the candidate key set in proto. If new candidate keys are detected, they are inserted into proto with a support value of 0, and true is returned. Otherwise returns false. If clear_rebeacon_timestamp is set, the rebeacon timestamp field in the proto is cleared to force rebeaconing on the next request.
void net_instaweb::UpdateCriticalKeys | ( | bool | require_prior_support, |
const StringSet & | new_set, | ||
int | support_value, | ||
CriticalKeys * | critical_keys | ||
) |
Add support for new_set to existing support. The new_set should be obtained from a fully-validated beacon result – this means PrepareForBeaconInsertion should have been called if required, and the resulting nonce should have been checked. If require_prior_support then there must be an existing support entry (possibly 0) for new support to be registered.
|
inline |
Updates the property 'property_name' in cohort 'cohort_name' of the property cache managed by the rewrite driver with the new value of the proto T. If 'write_cohort' is true, will also additionally write out the cohort to the cache backing.
|
inline |
See also: ./src/third_party/css_parser/src/strings/ascii_ctype.h We probably don't want our core string header file to have a dependecy on the Google CSS parser, so for now we'll write this here: upper-case a single character and return it. toupper() changes based on locale. We don't want this!
bool net_instaweb::ValidateAndExpireNonce | ( | int64 | now_ms, |
StringPiece | nonce, | ||
CriticalKeys * | critical_keys | ||
) |
Check whether the given nonce is valid, invalidating any expired nonce entries we might encounter. To avoid the need to copy and clear the nonce list, we invalidate the entry used and any expired entries by clearing the nonce value and timestamp. These entries will be reused by AddNonceToCriticalSelectors.
void net_instaweb::WriteCriticalKeysToPropertyCache | ( | const StringSet & | new_keys, |
StringPiece | nonce, | ||
int | support_interval, | ||
CriticalKeysWriteFlags | flags, | ||
StringPiece | property_name, | ||
const PropertyCache * | cache, | ||
const PropertyCache::Cohort * | cohort, | ||
AbstractPropertyPage * | page, | ||
MessageHandler * | message_handler, | ||
Timer * | timer | ||
) |
Update the property cache with a new set of keys. This will update the support value for the new keys. If require_prior_support is set, any keys that are not already present in the property cache will be ignored (to prevent spurious keys from being injected). Note that it only increases the support value for the new keys, it does not decay values that are not present. PrepareForBeaconInsertion should have been called previously if !should_replace_prior_result and nonces must be checked.
const int64 net_instaweb::kBeaconTimeoutIntervalMs = Timer::kMinuteMs |
The amount of time after generating a nonce that we will accept it as valid. This keeps an attacker from accumulating large numbers of valid nonces to send many beacon responses at once.
const HttpOptions net_instaweb::kDeprecatedDefaultHttpOptions |
const char net_instaweb::kGaSnippetSuffix[] |
const int64 net_instaweb::kHighFreqBeaconCount = 3 |
The number of valid beacons received that will switch from high frequency to low frequency beaconing.
const int64 net_instaweb::kLowFreqBeaconMult = 100 |
The multiplier to apply to RewriteOptions::beacon_reinstrument_time_sec() to determine the low frequency beaconing interval. For example, the default value rebeaconing value is 5 seconds, so we will rebeacon every 5 seconds in high frequency mode, and every 500 seconds (~8 minutes) in low frequency mode.
const char net_instaweb::kModPagespeedInPlaceCheckHeadersName[] |
Third filter checks headers for cacheability and writes the recorded resource to our cache.
const char net_instaweb::kModPagespeedInPlaceFilterName[] = "MOD_PAGESPEED_IN_PLACE_FILTER" |
Filters used for In-Place Resource Optimization. First filter stores un-gzipped contents.
const char net_instaweb::kModPagespeedInPlaceFixHeadersName[] |
Second filter fixes headers to avoid caching by shared proxies.
const int64 net_instaweb::kNonceExpirationLimit = 5 |
The limit on the number of nonces that can expire before we stop trying to do high frequency beaconing. This is a signal that beacons are not configured correctly and so we drop into low frequency beaconing mode.
const int net_instaweb::kNoQualityGiven = -1 |
Quality taken when no quality is passed through flags or when no quality is retrieved from JpegUtils::GetImageQualityFromImage.
const uint64 net_instaweb::kRollingHashCharTable[256] |
Per character hash values. Exported for use in NextRollingHash.
Rolling hash for char buffers based on a polynomial lookup table. See http://en.wikipedia.org/wiki/Rolling_hash
const int net_instaweb::kStackBufferSize = 10000 |
Size of stack buffer for read-blocks. This can't be too big or it will blow the stack, which may be set small in multi-threaded environments.