const std::string& i,
const base::FilePath& p,
bool file_ownership_passed,
- const GURL& u,
const std::set<int>& request_ids)
: extension_id(i),
path(p),
file_ownership_passed(file_ownership_passed),
- download_url(u),
request_ids(request_ids) {}
ExtensionUpdater::FetchedCRXFile::FetchedCRXFile()
- : path(), file_ownership_passed(true), download_url() {}
+ : path(), file_ownership_passed(true) {}
ExtensionUpdater::FetchedCRXFile::~FetchedCRXFile() {}
kStartupWaitSeconds * 8));
}
- // Read the persisted next check time, and use that if it isn't too soon.
- // Otherwise pick something random.
+ // Read the persisted next check time, and use that if it isn't too soon
+ // or too late. Otherwise pick something random.
Time saved_next = Time::FromInternalValue(prefs_->GetInt64(
pref_names::kNextUpdateCheck));
Time earliest = now + TimeDelta::FromSeconds(kStartupWaitSeconds);
- if (saved_next >= earliest) {
+ Time latest = now + TimeDelta::FromSeconds(frequency_seconds_);
+ if (saved_next >= earliest && saved_next <= latest) {
return saved_next - now;
} else {
return TimeDelta::FromSeconds(RandInt(kStartupWaitSeconds,
VLOG(2) << download_url << " written to " << path.value();
- FetchedCRXFile fetched(id, path, file_ownership_passed, download_url,
- request_ids);
+ FetchedCRXFile fetched(id, path, file_ownership_passed, request_ids);
fetched_crx_files_.push(fetched);
// MaybeInstallCRXFile() removes extensions from |in_progress_ids_| after
if (service_->UpdateExtension(crx_file.extension_id,
crx_file.path,
crx_file.file_ownership_passed,
- crx_file.download_url,
&installer)) {
crx_install_is_running_ = true;
current_crx_file_ = crx_file;