-
Notifications
You must be signed in to change notification settings - Fork 0
/
023.patch
54 lines (53 loc) · 2.28 KB
/
023.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- a/components/web_resource/web_resource_service.cc 2018-06-26
03:26:28.000000000 -0400
+++ b/components/web_resource/web_resource_service.cc.new
2018-07-13 12:48:24.354548270 -0400
@@ -123,48 +123,7 @@
// 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() {