Lines Matching refs:update_state
301 const UpdateState update_state) const { in UpdateCanStart()
315 result->backoff_expiry = update_state.backoff_expiry; in UpdateCanStart()
316 result->scatter_wait_period = update_state.scatter_wait_period; in UpdateCanStart()
317 result->scatter_check_threshold = update_state.scatter_check_threshold; in UpdateCanStart()
332 ec, state, error, &backoff_url_result, update_state); in UpdateCanStart()
361 if (!update_state.interactive) { in UpdateCanStart()
377 UpdateScattering(ec, state, error, &scatter_result, update_state); in UpdateCanStart()
399 if (update_state.p2p_sharing_disabled) { in UpdateCanStart()
407 if (update_state.p2p_downloading_disabled) { in UpdateCanStart()
409 } else if (update_state.interactive) { in UpdateCanStart()
411 } else if (update_state.p2p_num_attempts >= kMaxP2PAttempts) { in UpdateCanStart()
414 } else if (!update_state.p2p_first_attempted.is_null() && in UpdateCanStart()
416 update_state.p2p_first_attempted + in UpdateCanStart()
592 const UpdateState& update_state) const { in UpdateBackoffAndDownloadUrl()
594 DCHECK_GE(update_state.download_errors_max, 0); in UpdateBackoffAndDownloadUrl()
598 result->backoff_expiry = update_state.backoff_expiry; in UpdateBackoffAndDownloadUrl()
608 if (update_state.is_backoff_disabled) { in UpdateBackoffAndDownloadUrl()
610 } else if (update_state.interactive) { in UpdateBackoffAndDownloadUrl()
612 } else if (update_state.is_delta_payload) { in UpdateBackoffAndDownloadUrl()
621 if (may_backoff && !update_state.backoff_expiry.is_null() && in UpdateBackoffAndDownloadUrl()
622 !ec->IsWallclockTimeGreaterThan(update_state.backoff_expiry)) { in UpdateBackoffAndDownloadUrl()
642 int url_idx = update_state.last_download_url_idx; in UpdateBackoffAndDownloadUrl()
659 const int num_urls = update_state.download_urls.size(); in UpdateBackoffAndDownloadUrl()
661 int url_num_errors = update_state.last_download_url_num_errors; in UpdateBackoffAndDownloadUrl()
664 for (const auto& err_tuple : update_state.download_errors) { in UpdateBackoffAndDownloadUrl()
694 if (!update_state.failures_last_updated.is_null() && in UpdateBackoffAndDownloadUrl()
695 err_time <= update_state.failures_last_updated) in UpdateBackoffAndDownloadUrl()
718 url_num_errors > update_state.download_errors_max) in UpdateBackoffAndDownloadUrl()
743 !IsUrlUsable(update_state.download_urls[url_idx], http_allowed)); in UpdateBackoffAndDownloadUrl()
759 min(update_state.num_failures, static_cast<int>(sizeof(int)) * 8 - 2); in UpdateBackoffAndDownloadUrl()
786 const UpdateState& update_state) const { in UpdateScattering()
788 DCHECK(update_state.scatter_wait_period >= kZeroInterval); in UpdateScattering()
789 DCHECK_GE(update_state.scatter_check_threshold, 0); in UpdateScattering()
819 TimeDelta wait_period = update_state.scatter_wait_period; in UpdateScattering()
827 Time wait_expires = (update_state.first_seen + in UpdateScattering()
828 min(wait_period, update_state.scatter_wait_period_max)); in UpdateScattering()
836 int check_threshold = update_state.scatter_check_threshold; in UpdateScattering()
838 check_threshold = prng.RandMinMax(update_state.scatter_check_threshold_min, in UpdateScattering()
839 update_state.scatter_check_threshold_max); in UpdateScattering()
847 if (check_threshold > update_state.scatter_check_threshold_max) in UpdateScattering()
851 if (check_threshold > 0 && update_state.num_checks >= check_threshold) in UpdateScattering()
856 if (is_scattering && wait_period == update_state.scatter_wait_period && in UpdateScattering()
857 check_threshold == update_state.scatter_check_threshold) in UpdateScattering()