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

Side by Side Diff: content/browser/after_startup_task_poster_impl.cc

Issue 949293002: Implement a poor man's PostAfterStartupTask() function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
(Empty)
1 // Copyright (c) 2015 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 "content/browser/after_startup_task_poster_impl.h"
6 #include "base/task_runner.h"
7
8 namespace content {
9
10 namespace {
11
12 AfterStartupTaskPoster* g_task_poster = nullptr;
13
14 }
15
16 void DefaultAfterStartupTaskPoster::PostAfterStartup(
17 const tracked_objects::Location& from_here,
18 const scoped_refptr<base::TaskRunner>& task_runner,
19 const base::Closure& task) {
20 task_runner->PostTask(from_here, task);
21 }
22
23 void DefaultAfterStartupTaskPoster::PostAfterStartupAndReply(
24 const tracked_objects::Location& from_here,
25 const scoped_refptr<base::TaskRunner>& task_runner,
26 const base::Closure& task,
27 const base::Closure& reply) {
28 task_runner->PostTaskAndReply(from_here, task, reply);
29 }
30
31 AfterStartupTaskPoster& GetAfterStartupTaskPoster() {
32 DCHECK(g_task_poster) ;
33 return *g_task_poster;
34 }
35
36 void SetAfterStartupTaskPoster(AfterStartupTaskPoster* task_poster) {
37 DCHECK(task_poster);
38 DCHECK(!g_task_poster);
39 g_task_poster = task_poster;
40 }
41
42 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698