Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: components/precache/core/precache_fetcher.h

Issue 2303653002: Precache per-resource cap should be applied on network bytes used (Closed)
Patch Set: Addressed mmenke comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PRECACHE_CORE_PRECACHE_FETCHER_H_ 5 #ifndef COMPONENTS_PRECACHE_CORE_PRECACHE_FETCHER_H_
6 #define COMPONENTS_PRECACHE_CORE_PRECACHE_FETCHER_H_ 6 #define COMPONENTS_PRECACHE_CORE_PRECACHE_FETCHER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // the specified URL using the specified request context. 247 // the specified URL using the specified request context.
248 Fetcher(net::URLRequestContextGetter* request_context, 248 Fetcher(net::URLRequestContextGetter* request_context,
249 const GURL& url, 249 const GURL& url,
250 const std::string& referrer, 250 const std::string& referrer,
251 const base::Callback<void(const Fetcher&)>& callback, 251 const base::Callback<void(const Fetcher&)>& callback,
252 bool is_resource_request, 252 bool is_resource_request,
253 size_t max_bytes); 253 size_t max_bytes);
254 ~Fetcher() override; 254 ~Fetcher() override;
255 void OnURLFetchDownloadProgress(const net::URLFetcher* source, 255 void OnURLFetchDownloadProgress(const net::URLFetcher* source,
256 int64_t current, 256 int64_t current,
257 int64_t total) override; 257 int64_t total,
258 int64_t current_network_bytes) override;
258 void OnURLFetchComplete(const net::URLFetcher* source) override; 259 void OnURLFetchComplete(const net::URLFetcher* source) override;
259 int64_t response_bytes() const { return response_bytes_; } 260 int64_t response_bytes() const { return response_bytes_; }
260 int64_t network_response_bytes() const { return network_response_bytes_; } 261 int64_t network_response_bytes() const { return network_response_bytes_; }
261 const net::URLFetcher* network_url_fetcher() const { 262 const net::URLFetcher* network_url_fetcher() const {
262 return network_url_fetcher_.get(); 263 return network_url_fetcher_.get();
263 } 264 }
264 const GURL& url() const { return url_; } 265 const GURL& url() const { return url_; }
265 const std::string& referrer() const { return referrer_; } 266 const std::string& referrer() const { return referrer_; }
266 bool is_resource_request() const { return is_resource_request_; } 267 bool is_resource_request() const { return is_resource_request_; }
267 bool was_cached() const { return was_cached_; } 268 bool was_cached() const { return was_cached_; }
(...skipping 18 matching lines...) Expand all
286 int64_t response_bytes_; 287 int64_t response_bytes_;
287 int64_t network_response_bytes_; 288 int64_t network_response_bytes_;
288 bool was_cached_; 289 bool was_cached_;
289 290
290 DISALLOW_COPY_AND_ASSIGN(Fetcher); 291 DISALLOW_COPY_AND_ASSIGN(Fetcher);
291 }; 292 };
292 293
293 } // namespace precache 294 } // namespace precache
294 295
295 #endif // COMPONENTS_PRECACHE_CORE_PRECACHE_FETCHER_H_ 296 #endif // COMPONENTS_PRECACHE_CORE_PRECACHE_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698