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

Side by Side Diff: components/update_client/url_fetcher_downloader.cc

Issue 2378173002: Precache per-resource cap should be applied on network bytes used (Closed)
Patch Set: Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "components/update_client/url_fetcher_downloader.h" 5 #include "components/update_client/url_fetcher_downloader.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 main_task_runner()->PostTask( 92 main_task_runner()->PostTask(
93 FROM_HERE, 93 FROM_HERE,
94 base::Bind(&UrlFetcherDownloader::OnDownloadComplete, 94 base::Bind(&UrlFetcherDownloader::OnDownloadComplete,
95 base::Unretained(this), is_handled, result, download_metrics)); 95 base::Unretained(this), is_handled, result, download_metrics));
96 } 96 }
97 97
98 void UrlFetcherDownloader::OnURLFetchDownloadProgress( 98 void UrlFetcherDownloader::OnURLFetchDownloadProgress(
99 const net::URLFetcher* source, 99 const net::URLFetcher* source,
100 int64_t current, 100 int64_t current,
101 int64_t total) { 101 int64_t total,
102 int64_t current_network_bytes) {
102 DCHECK(thread_checker_.CalledOnValidThread()); 103 DCHECK(thread_checker_.CalledOnValidThread());
103 104
104 downloaded_bytes_ = current; 105 downloaded_bytes_ = current;
105 total_bytes_ = total; 106 total_bytes_ = total;
106 107
107 Result result; 108 Result result;
108 result.downloaded_bytes = downloaded_bytes_; 109 result.downloaded_bytes = downloaded_bytes_;
109 result.total_bytes = total_bytes_; 110 result.total_bytes = total_bytes_;
110 111
111 OnDownloadProgress(result); 112 OnDownloadProgress(result);
112 } 113 }
113 114
114 } // namespace update_client 115 } // namespace update_client
OLDNEW
« no previous file with comments | « components/update_client/url_fetcher_downloader.h ('k') | content/browser/speech/speech_recognition_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698