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

Side by Side Diff: chrome/browser/chromeos/login/users/fake_chrome_user_manager.cc

Issue 2726523002: Pass Callback to TaskRunner by value and consume it on invocation (1) (Closed)
Patch Set: erase Closure* Created 3 years, 8 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 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 4
5 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" 5 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/callback.h"
9 #include "base/command_line.h" 10 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
11 #include "base/sys_info.h" 12 #include "base/sys_info.h"
12 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" 13 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
13 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" 14 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h"
14 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" 15 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h"
15 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 16 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
16 #include "chrome/browser/chromeos/profiles/profile_helper.h" 17 #include "chrome/browser/chromeos/profiles/profile_helper.h"
17 #include "chrome/browser/chromeos/settings/cros_settings.h" 18 #include "chrome/browser/chromeos/settings/cros_settings.h"
18 #include "chrome/grit/theme_resources.h" 19 #include "chrome/grit/theme_resources.h"
(...skipping 10 matching lines...) Expand all
29 class FakeTaskRunner : public base::TaskRunner { 30 class FakeTaskRunner : public base::TaskRunner {
30 public: 31 public:
31 FakeTaskRunner() = default; 32 FakeTaskRunner() = default;
32 33
33 protected: 34 protected:
34 ~FakeTaskRunner() override {} 35 ~FakeTaskRunner() override {}
35 36
36 private: 37 private:
37 // base::TaskRunner overrides. 38 // base::TaskRunner overrides.
38 bool PostDelayedTask(const tracked_objects::Location& from_here, 39 bool PostDelayedTask(const tracked_objects::Location& from_here,
39 const base::Closure& task, 40 base::Closure task,
40 base::TimeDelta delay) override { 41 base::TimeDelta delay) override {
41 task.Run(); 42 std::move(task).Run();
42 return true; 43 return true;
43 } 44 }
44 bool RunsTasksOnCurrentThread() const override { return true; } 45 bool RunsTasksOnCurrentThread() const override { return true; }
45 46
46 DISALLOW_COPY_AND_ASSIGN(FakeTaskRunner); 47 DISALLOW_COPY_AND_ASSIGN(FakeTaskRunner);
47 }; 48 };
48 49
49 } // namespace 50 } // namespace
50 51
51 namespace chromeos { 52 namespace chromeos {
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 if (active_account_id_.is_valid()) { 631 if (active_account_id_.is_valid()) {
631 for (auto* user : users_) { 632 for (auto* user : users_) {
632 if (user->GetAccountId() == active_account_id_) 633 if (user->GetAccountId() == active_account_id_)
633 return user; 634 return user;
634 } 635 }
635 } 636 }
636 return users_[0]; 637 return users_[0];
637 } 638 }
638 639
639 } // namespace chromeos 640 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698