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

Side by Side Diff: content/child/scoped_child_process_reference.cc

Issue 1967823004: Fix include path for moved thread_task_runner_handle.h header in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a1_move_task_runner_handle
Patch Set: Created 4 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/child/scoped_child_process_reference.h" 5 #include "content/child/scoped_child_process_reference.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.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/threading/thread_task_runner_handle.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "content/child/child_process.h" 12 #include "content/child/child_process.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 ScopedChildProcessReference::ScopedChildProcessReference() 16 ScopedChildProcessReference::ScopedChildProcessReference()
17 : has_reference_(true) { 17 : has_reference_(true) {
18 ChildProcess::current()->AddRefProcess(); 18 ChildProcess::current()->AddRefProcess();
19 } 19 }
20 20
21 ScopedChildProcessReference::~ScopedChildProcessReference() { 21 ScopedChildProcessReference::~ScopedChildProcessReference() {
22 if (has_reference_) 22 if (has_reference_)
23 ChildProcess::current()->ReleaseProcess(); 23 ChildProcess::current()->ReleaseProcess();
24 } 24 }
25 25
26 void ScopedChildProcessReference::ReleaseWithDelay( 26 void ScopedChildProcessReference::ReleaseWithDelay(
27 const base::TimeDelta& delay) { 27 const base::TimeDelta& delay) {
28 DCHECK(has_reference_); 28 DCHECK(has_reference_);
29 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 29 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
30 FROM_HERE, base::Bind(&ChildProcess::ReleaseProcess, 30 FROM_HERE, base::Bind(&ChildProcess::ReleaseProcess,
31 base::Unretained(ChildProcess::current())), 31 base::Unretained(ChildProcess::current())),
32 delay); 32 delay);
33 has_reference_ = false; 33 has_reference_ = false;
34 } 34 }
35 35
36 } // namespace content 36 } // namespace content
OLDNEW
« no previous file with comments | « content/child/power_monitor_broadcast_source.cc ('k') | content/child/service_worker/service_worker_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698