OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_CHILD_THREAD_SAFE_SENDER_H_ | 5 #ifndef CONTENT_CHILD_THREAD_SAFE_SENDER_H_ |
6 #define CONTENT_CHILD_THREAD_SAFE_SENDER_H_ | 6 #define CONTENT_CHILD_THREAD_SAFE_SENDER_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 namespace content { | 21 namespace content { |
22 class ChildThreadImpl; | 22 class ChildThreadImpl; |
23 | 23 |
24 // The class of Sender returned by ChildThreadImpl::thread_safe_sender(). | 24 // The class of Sender returned by ChildThreadImpl::thread_safe_sender(). |
25 class CONTENT_EXPORT ThreadSafeSender | 25 class CONTENT_EXPORT ThreadSafeSender |
26 : public IPC::Sender, | 26 : public IPC::Sender, |
27 public base::RefCountedThreadSafe<ThreadSafeSender> { | 27 public base::RefCountedThreadSafe<ThreadSafeSender> { |
28 public: | 28 public: |
29 bool Send(IPC::Message* msg) override; | 29 bool Send(IPC::Message* msg) override; |
30 | 30 |
31 protected: | |
32 ThreadSafeSender(); // for testing | |
nasko
2015/03/18 22:21:44
nit: I'd put the comment above and expand it to ex
nhiroki
2015/03/18 23:14:37
Agree. And it'd be far better that implementation
| |
33 ~ThreadSafeSender() override; | |
34 | |
31 private: | 35 private: |
32 friend class ChildThreadImpl; // for construction | 36 friend class ChildThreadImpl; // for construction |
33 friend class IndexedDBDispatcherTest; | 37 friend class IndexedDBDispatcherTest; |
34 friend class WebIDBCursorImplTest; | 38 friend class WebIDBCursorImplTest; |
35 friend class base::RefCountedThreadSafe<ThreadSafeSender>; | 39 friend class base::RefCountedThreadSafe<ThreadSafeSender>; |
36 | 40 |
37 ThreadSafeSender(const scoped_refptr<base::MessageLoopProxy>& main_loop, | 41 ThreadSafeSender(const scoped_refptr<base::MessageLoopProxy>& main_loop, |
38 const scoped_refptr<IPC::SyncMessageFilter>& sync_filter); | 42 const scoped_refptr<IPC::SyncMessageFilter>& sync_filter); |
39 ~ThreadSafeSender() override; | |
40 | 43 |
41 scoped_refptr<base::MessageLoopProxy> main_loop_; | 44 scoped_refptr<base::MessageLoopProxy> main_loop_; |
42 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; | 45 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; |
43 | 46 |
44 DISALLOW_COPY_AND_ASSIGN(ThreadSafeSender); | 47 DISALLOW_COPY_AND_ASSIGN(ThreadSafeSender); |
45 }; | 48 }; |
46 | 49 |
47 } // namespace content | 50 } // namespace content |
48 | 51 |
49 #endif // CONTENT_CHILD_THREAD_SAFE_SENDER_H_ | 52 #endif // CONTENT_CHILD_THREAD_SAFE_SENDER_H_ |
OLD | NEW |