OLD | NEW |
---|---|
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 #ifndef BASE_MEMORY_REF_COUNTED_DELETE_ON_MESSAGE_LOOP_H_ | 5 #ifndef BASE_MEMORY_REF_COUNTED_DELETE_ON_MESSAGE_LOOP_H_ |
6 #define BASE_MEMORY_REF_COUNTED_DELETE_ON_MESSAGE_LOOP_H_ | 6 #define BASE_MEMORY_REF_COUNTED_DELETE_ON_MESSAGE_LOOP_H_ |
7 | 7 |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 // friend class RefCountedDeleteOnMessageLoop<Foo>; | 26 // friend class RefCountedDeleteOnMessageLoop<Foo>; |
27 // friend class DeleteHelper<Foo>; | 27 // friend class DeleteHelper<Foo>; |
28 // | 28 // |
29 // ~Foo(); | 29 // ~Foo(); |
30 // }; | 30 // }; |
31 | 31 |
32 // TODO(skyostil): Rename this to RefCountedDeleteOnTaskRunner. | 32 // TODO(skyostil): Rename this to RefCountedDeleteOnTaskRunner. |
33 template <class T> | 33 template <class T> |
34 class RefCountedDeleteOnMessageLoop : public subtle::RefCountedThreadSafeBase { | 34 class RefCountedDeleteOnMessageLoop : public subtle::RefCountedThreadSafeBase { |
35 public: | 35 public: |
36 // This constructor will accept a MessageL00pProxy object, but new code should | 36 // This constructor will accept a MessageL00pProxy object, but new code should |
gab
2016/09/28 17:19:03
MessageLoopProxy no longer exists (sadly this was
fdoray
2016/09/28 18:54:50
Done.
| |
37 // prefer a SingleThreadTaskRunner. A SingleThreadTaskRunner for the | 37 // prefer a SingleThreadTaskRunner. A SingleThreadTaskRunner for the |
38 // MessageLoop on the current thread can be acquired by calling | 38 // MessageLoop on the current thread can be acquired by calling |
gab
2016/09/28 17:19:03
s/for the MessageLoop on the current thread/for th
fdoray
2016/09/28 18:54:50
Done.
| |
39 // MessageLoop::current()->task_runner(). | 39 // ThreadTaskRunnerHandle::Get(). |
40 RefCountedDeleteOnMessageLoop( | 40 RefCountedDeleteOnMessageLoop( |
41 scoped_refptr<SingleThreadTaskRunner> task_runner) | 41 scoped_refptr<SingleThreadTaskRunner> task_runner) |
42 : task_runner_(std::move(task_runner)) { | 42 : task_runner_(std::move(task_runner)) { |
43 DCHECK(task_runner_); | 43 DCHECK(task_runner_); |
44 } | 44 } |
45 | 45 |
46 void AddRef() const { | 46 void AddRef() const { |
47 subtle::RefCountedThreadSafeBase::AddRef(); | 47 subtle::RefCountedThreadSafeBase::AddRef(); |
48 } | 48 } |
49 | 49 |
(...skipping 16 matching lines...) Expand all Loading... | |
66 | 66 |
67 scoped_refptr<SingleThreadTaskRunner> task_runner_; | 67 scoped_refptr<SingleThreadTaskRunner> task_runner_; |
68 | 68 |
69 private: | 69 private: |
70 DISALLOW_COPY_AND_ASSIGN(RefCountedDeleteOnMessageLoop); | 70 DISALLOW_COPY_AND_ASSIGN(RefCountedDeleteOnMessageLoop); |
71 }; | 71 }; |
72 | 72 |
73 } // namespace base | 73 } // namespace base |
74 | 74 |
75 #endif // BASE_MEMORY_REF_COUNTED_DELETE_ON_MESSAGE_LOOP_H_ | 75 #endif // BASE_MEMORY_REF_COUNTED_DELETE_ON_MESSAGE_LOOP_H_ |
OLD | NEW |