mirror of
https://codeberg.org/kiss-community/repo
synced 2024-08-23 06:26:17 +00:00
53 lines
2.2 KiB
Diff
53 lines
2.2 KiB
Diff
--- a/components/web_resource/web_resource_service.cc
|
|
+++ b/components/web_resource/web_resource_service.cc
|
|
@@ -128,48 +128,7 @@ bool WebResourceService::GetFetchSchedul
|
|
// Initializes the fetching of data from the resource server. Data
|
|
// load calls OnSimpleLoaderComplete.
|
|
void WebResourceService::StartFetch() {
|
|
- // Set to false so that next fetch can be scheduled after this fetch or
|
|
- // if we receive notification that resource is allowed.
|
|
- fetch_scheduled_ = false;
|
|
- // Check whether fetching is allowed.
|
|
- if (!resource_request_allowed_notifier_->ResourceRequestsAllowed())
|
|
- return;
|
|
-
|
|
- // First, put our next cache load on the MessageLoop.
|
|
- ScheduleFetch(cache_update_delay_ms_);
|
|
-
|
|
- // Set cache update time in preferences.
|
|
- prefs_->SetString(last_update_time_pref_name_,
|
|
- base::NumberToString(base::Time::Now().ToDoubleT()));
|
|
-
|
|
- // If we are still fetching data, exit.
|
|
- if (in_fetch_)
|
|
- return;
|
|
- in_fetch_ = true;
|
|
-
|
|
- GURL web_resource_server =
|
|
- application_locale_.empty()
|
|
- ? web_resource_server_
|
|
- : google_util::AppendGoogleLocaleParam(web_resource_server_,
|
|
- application_locale_);
|
|
-
|
|
- DVLOG(1) << "WebResourceService StartFetch " << web_resource_server;
|
|
- auto resource_request = std::make_unique<network::ResourceRequest>();
|
|
- resource_request->url = web_resource_server;
|
|
- // Do not let url fetcher affect existing state in system context
|
|
- // (by setting cookies, for example).
|
|
- resource_request->load_flags = net::LOAD_DISABLE_CACHE |
|
|
- net::LOAD_DO_NOT_SEND_COOKIES |
|
|
- net::LOAD_DO_NOT_SAVE_COOKIES;
|
|
- // TODO(https://crbug.com/808498): Re-add data use measurement once
|
|
- // SimpleURLLoader supports it.
|
|
- // ID=data_use_measurement::DataUseUserData::WEB_RESOURCE_SERVICE
|
|
- simple_url_loader_ = network::SimpleURLLoader::Create(
|
|
- std::move(resource_request), traffic_annotation_);
|
|
- simple_url_loader_->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
|
|
- url_loader_factory_.get(),
|
|
- base::BindOnce(&WebResourceService::OnSimpleLoaderComplete,
|
|
- base::Unretained(this)));
|
|
+ in_fetch_ = false;
|
|
}
|
|
|
|
void WebResourceService::EndFetch() {
|