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

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

Powered by Google App Engine
This is Rietveld 408576698