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

Side by Side Diff: base/threading/thread_task_runner_handle.cc

Issue 2053503004: Replace forward declarations with includes in TaskRunner APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self-review Created 4 years, 6 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
« no previous file with comments | « base/threading/thread_task_runner_handle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/threading/thread_task_runner_handle.h" 5 #include "base/threading/thread_task_runner_handle.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/single_thread_task_runner.h"
12 #include "base/threading/sequenced_task_runner_handle.h" 11 #include "base/threading/sequenced_task_runner_handle.h"
13 #include "base/threading/thread_local.h" 12 #include "base/threading/thread_local.h"
14 13
15 namespace base { 14 namespace base {
16 15
17 namespace { 16 namespace {
18 17
19 base::LazyInstance<base::ThreadLocalPointer<ThreadTaskRunnerHandle>>::Leaky 18 base::LazyInstance<base::ThreadLocalPointer<ThreadTaskRunnerHandle>>::Leaky
20 lazy_tls_ptr = LAZY_INSTANCE_INITIALIZER; 19 lazy_tls_ptr = LAZY_INSTANCE_INITIALIZER;
21 20
(...skipping 21 matching lines...) Expand all
43 lazy_tls_ptr.Pointer()->Set(this); 42 lazy_tls_ptr.Pointer()->Set(this);
44 } 43 }
45 44
46 ThreadTaskRunnerHandle::~ThreadTaskRunnerHandle() { 45 ThreadTaskRunnerHandle::~ThreadTaskRunnerHandle() {
47 DCHECK(task_runner_->BelongsToCurrentThread()); 46 DCHECK(task_runner_->BelongsToCurrentThread());
48 DCHECK_EQ(lazy_tls_ptr.Pointer()->Get(), this); 47 DCHECK_EQ(lazy_tls_ptr.Pointer()->Get(), this);
49 lazy_tls_ptr.Pointer()->Set(nullptr); 48 lazy_tls_ptr.Pointer()->Set(nullptr);
50 } 49 }
51 50
52 } // namespace base 51 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/thread_task_runner_handle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698