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

Side by Side Diff: chrome/browser/extensions/activity_log/activity_log_task_runner.cc

Issue 2980503002: [Extensions][TaskScheduler] Update ActivityLog for scheduling migration (Closed)
Patch Set: Revert to set for testing Created 3 years, 5 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/activity_log/activity_log_task_runner.h"
6
7 #include "base/sequenced_task_runner.h"
8 #include "base/task_scheduler/lazy_task_runner.h"
9
10 namespace extensions {
11
12 namespace {
13 base::TaskRunner* g_task_runner_for_testing = nullptr;
14 }
15
16 const scoped_refptr<base::TaskRunner> GetActivityLogTaskRunner() {
17 if (g_task_runner_for_testing)
18 return g_task_runner_for_testing;
19
20 static base::LazySequencedTaskRunner task_runner =
gab 2017/07/20 16:26:43 The documentation states to put this in the anonym
Devlin 2017/07/27 13:41:19 Sure thing; done.
21 LAZY_SEQUENCED_TASK_RUNNER_INITIALIZER(
22 base::TaskTraits({base::MayBlock(), base::TaskPriority::BACKGROUND}));
23 return task_runner.Get();
24 }
25
26 void SetActivityLogTaskRunnerForTesting(base::TaskRunner* task_runner) {
27 g_task_runner_for_testing = task_runner;
28 }
29
30 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698