OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_COMMON_CHILD_THREAD_H_ | 5 #ifndef CONTENT_COMMON_CHILD_THREAD_H_ |
6 #define CONTENT_COMMON_CHILD_THREAD_H_ | 6 #define CONTENT_COMMON_CHILD_THREAD_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 QuotaDispatcher* quota_dispatcher() const { | 92 QuotaDispatcher* quota_dispatcher() const { |
93 return quota_dispatcher_.get(); | 93 return quota_dispatcher_.get(); |
94 } | 94 } |
95 | 95 |
96 // Safe to call on any thread, as long as it's guaranteed that the thread's | 96 // Safe to call on any thread, as long as it's guaranteed that the thread's |
97 // lifetime is less than the main thread. The |filter| returned may only | 97 // lifetime is less than the main thread. The |filter| returned may only |
98 // be used on background threads. | 98 // be used on background threads. |
99 IPC::SyncMessageFilter* sync_message_filter() const { | 99 IPC::SyncMessageFilter* sync_message_filter() const { |
100 return sync_message_filter_; | 100 return sync_message_filter_.get(); |
101 } | 101 } |
102 | 102 |
103 // The getter should only be called on the main thread, however the | 103 // The getter should only be called on the main thread, however the |
104 // IPC::Sender it returns may be safely called on any thread including | 104 // IPC::Sender it returns may be safely called on any thread including |
105 // the main thread. | 105 // the main thread. |
106 ThreadSafeSender* thread_safe_sender() const { | 106 ThreadSafeSender* thread_safe_sender() const { |
107 return thread_safe_sender_; | 107 return thread_safe_sender_.get(); |
108 } | 108 } |
109 | 109 |
110 ChildHistogramMessageFilter* child_histogram_message_filter() const { | 110 ChildHistogramMessageFilter* child_histogram_message_filter() const { |
111 return histogram_message_filter_.get(); | 111 return histogram_message_filter_.get(); |
112 } | 112 } |
113 | 113 |
114 base::MessageLoop* message_loop() const { return message_loop_; } | 114 base::MessageLoop* message_loop() const { return message_loop_; } |
115 | 115 |
116 // Returns the one child thread. | 116 // Returns the one child thread. |
117 static ChildThread* current(); | 117 static ChildThread* current(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 scoped_refptr<ChildResourceMessageFilter> resource_message_filter_; | 184 scoped_refptr<ChildResourceMessageFilter> resource_message_filter_; |
185 | 185 |
186 base::WeakPtrFactory<ChildThread> channel_connected_factory_; | 186 base::WeakPtrFactory<ChildThread> channel_connected_factory_; |
187 | 187 |
188 DISALLOW_COPY_AND_ASSIGN(ChildThread); | 188 DISALLOW_COPY_AND_ASSIGN(ChildThread); |
189 }; | 189 }; |
190 | 190 |
191 } // namespace content | 191 } // namespace content |
192 | 192 |
193 #endif // CONTENT_COMMON_CHILD_THREAD_H_ | 193 #endif // CONTENT_COMMON_CHILD_THREAD_H_ |
OLD | NEW |