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

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

Issue 1419473005: Fix task concurrency in components/update_client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "components/update_client/task_update.h" 4 #include "components/update_client/task_update.h"
5 5
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 23 matching lines...) Expand all
34 if (ids_.empty()) { 34 if (ids_.empty()) {
35 RunComplete(-1); 35 RunComplete(-1);
36 return; 36 return;
37 } 37 }
38 38
39 update_engine_->Update( 39 update_engine_->Update(
40 is_foreground_, ids_, crx_data_callback_, 40 is_foreground_, ids_, crx_data_callback_,
41 base::Bind(&TaskUpdate::RunComplete, base::Unretained(this))); 41 base::Bind(&TaskUpdate::RunComplete, base::Unretained(this)));
42 } 42 }
43 43
44 std::vector<std::string> TaskUpdate::GetIds() const {
45 return ids_;
46 }
47
44 void TaskUpdate::RunComplete(int error) { 48 void TaskUpdate::RunComplete(int error) {
45 DCHECK(thread_checker_.CalledOnValidThread()); 49 DCHECK(thread_checker_.CalledOnValidThread());
46 50
47 callback_.Run(this, error); 51 callback_.Run(this, error);
48 } 52 }
49 53
50 } // namespace update_client 54 } // namespace update_client
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698