24 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_EXPERIMENT_UTIL_H_
25 #define NET_INSTAWEB_REWRITER_PUBLIC_EXPERIMENT_UTIL_H_
31 namespace net_instaweb {
34 class ResponseHeaders;
36 class UserAgentMatcher;
38 namespace experiment {
40 enum ExperimentState {
49 kForceNoExperiment = -2,
52 kExperimentNotSet = -1,
60 const char kExperimentCookie[] =
"PageSpeedExperiment";
61 const char kExperimentCookiePrefix[] =
"PageSpeedExperiment=";
65 bool GetExperimentCookieState(
const RequestHeaders& headers,
int* value);
69 void RemoveExperimentCookie(RequestHeaders *headers);
74 void SetExperimentCookie(ResponseHeaders* headers,
int state,
75 const StringPiece& url, int64 expiration_time_ms);
78 int DetermineExperimentState(
const RewriteOptions* options,
79 const RequestHeaders& headers,
80 const UserAgentMatcher& matcher);
83 bool AnyActiveExperiments(
const RewriteOptions* options);
90 int CookieStringToState(
const StringPiece& cookie_str);
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24