|
bool | net_instaweb::ValidateAndExpireNonce (int64 now_ms, StringPiece nonce, CriticalKeys *critical_keys) |
|
void | net_instaweb::GetCriticalKeysFromProto (int64 support_percentage, const CriticalKeys &critical_keys, StringSet *keys) |
|
void | net_instaweb::UpdateCriticalKeys (bool require_prior_support, const StringSet &new_set, int support_value, CriticalKeys *critical_keys) |
|
bool | net_instaweb::ShouldBeacon (int64 next_beacon_timestamp_ms, const RewriteDriver &driver) |
|
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) |
|
void | net_instaweb::PrepareForBeaconInsertionHelper (CriticalKeys *proto, NonceGenerator *nonce_generator, RewriteDriver *driver, bool using_candidate_key_detection, BeaconMetadata *result) |
|
bool | net_instaweb::UpdateCandidateKeys (const StringSet &keys, CriticalKeys *proto, bool clear_rebeacon_timestamp) |
|
bool | net_instaweb::IsBeaconDataAvailable (const CriticalKeys &proto) |
|
This contains some utilities for working with the critical_keys proto, and for updating support values. This is primarily used by CriticalSelectorFinder and CriticalImagesFinder. These finders use the critical_keys proto to store a "support value" for each possible key (image URL or selector name) in the property cache. When a beacon result arrives, the support for each critical key in the result is increased by support_interval. When a new beacon is sent, existing support is decayed by multiplying by support_interval/(support_interval+1) and rounding down. This means that a single key returned with a beacon will be considered critical until support_interval subsequent beacons have been injected. Because support decays exponentially, repeated support for a key in multiple beacon results cause that key to be considered critical longer: two beacon results will expire after somewhat less than twice as long, three after rather less than three times as long, and so forth. This class also handles converting over old protobufs that did not use the support system.