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

Side by Side Diff: media/base/bind_to_current_loop.h

Issue 1852953002: Fix a bunch of IWYU violators that don't include scoped_ptr.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 (c) 2015 The Chromium Authors. All rights reserved. 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 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 #ifndef MEDIA_BASE_BIND_TO_CURRENT_LOOP_H_ 5 #ifndef MEDIA_BASE_BIND_TO_CURRENT_LOOP_H_
6 #define MEDIA_BASE_BIND_TO_CURRENT_LOOP_H_ 6 #define MEDIA_BASE_BIND_TO_CURRENT_LOOP_H_
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h" 11 #include "base/memory/scoped_vector.h"
11 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
12 #include "base/thread_task_runner_handle.h" 13 #include "base/thread_task_runner_handle.h"
13 14
14 // This is a helper utility for base::Bind()ing callbacks to the current 15 // This is a helper utility for base::Bind()ing callbacks to the current
15 // MessageLoop. The typical use is when |a| (of class |A|) wants to hand a 16 // MessageLoop. The typical use is when |a| (of class |A|) wants to hand a
16 // callback such as base::Bind(&A::AMethod, a) to |b|, but needs to ensure that 17 // callback such as base::Bind(&A::AMethod, a) to |b|, but needs to ensure that
17 // when |b| executes the callback, it does so on |a|'s current MessageLoop. 18 // when |b| executes the callback, it does so on |a|'s current MessageLoop.
18 // 19 //
19 // Typical usage: request to be called back on the current thread: 20 // Typical usage: request to be called back on the current thread:
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 template<typename T> 62 template<typename T>
62 static base::Callback<T> BindToCurrentLoop( 63 static base::Callback<T> BindToCurrentLoop(
63 const base::Callback<T>& cb) { 64 const base::Callback<T>& cb) {
64 return base::Bind(&internal::TrampolineHelper<T>::Run, 65 return base::Bind(&internal::TrampolineHelper<T>::Run,
65 base::ThreadTaskRunnerHandle::Get(), cb); 66 base::ThreadTaskRunnerHandle::Get(), cb);
66 } 67 }
67 68
68 } // namespace media 69 } // namespace media
69 70
70 #endif // MEDIA_BASE_BIND_TO_CURRENT_LOOP_H_ 71 #endif // MEDIA_BASE_BIND_TO_CURRENT_LOOP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698