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

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

Issue 2889683003: Rename TaskRunner::RunsTasksOnCurrentThread() in //components (Closed)
Patch Set: rebase Created 3 years, 6 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/crx_downloader.h" 5 #include "components/update_client/crx_downloader.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 return; 145 return;
146 146
147 progress_callback_.Run(result); 147 progress_callback_.Run(result);
148 } 148 }
149 149
150 // The function mutates the values of the parameters |result| and 150 // The function mutates the values of the parameters |result| and
151 // |download_metrics|. 151 // |download_metrics|.
152 void CrxDownloader::VerifyResponse(bool is_handled, 152 void CrxDownloader::VerifyResponse(bool is_handled,
153 Result result, 153 Result result,
154 DownloadMetrics download_metrics) { 154 DownloadMetrics download_metrics) {
155 DCHECK(task_runner()->RunsTasksOnCurrentThread()); 155 DCHECK(task_runner()->RunsTasksInCurrentSequence());
156 DCHECK_EQ(0, result.error); 156 DCHECK_EQ(0, result.error);
157 DCHECK_EQ(0, download_metrics.error); 157 DCHECK_EQ(0, download_metrics.error);
158 DCHECK(is_handled); 158 DCHECK(is_handled);
159 159
160 if (VerifyFileHash256(result.response, expected_hash_)) { 160 if (VerifyFileHash256(result.response, expected_hash_)) {
161 download_metrics_.push_back(download_metrics); 161 download_metrics_.push_back(download_metrics);
162 main_task_runner()->PostTask(FROM_HERE, 162 main_task_runner()->PostTask(FROM_HERE,
163 base::Bind(download_callback_, result)); 163 base::Bind(download_callback_, result));
164 return; 164 return;
165 } 165 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 return; 211 return;
212 } 212 }
213 213
214 // The download ends here since there is no url nor downloader to handle this 214 // The download ends here since there is no url nor downloader to handle this
215 // download request further. 215 // download request further.
216 main_task_runner()->PostTask(FROM_HERE, 216 main_task_runner()->PostTask(FROM_HERE,
217 base::Bind(download_callback_, result)); 217 base::Bind(download_callback_, result));
218 } 218 }
219 219
220 } // namespace update_client 220 } // namespace update_client
OLDNEW
« no previous file with comments | « components/update_client/component.cc ('k') | components/update_client/url_request_post_interceptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698