| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 BLIMP_NET_BLIMP_MESSAGE_THREAD_PIPE_H_ | 5 #ifndef BLIMP_NET_BLIMP_MESSAGE_THREAD_PIPE_H_ |
| 6 #define BLIMP_NET_BLIMP_MESSAGE_THREAD_PIPE_H_ | 6 #define BLIMP_NET_BLIMP_MESSAGE_THREAD_PIPE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "blimp/net/blimp_net_export.h" | 12 #include "blimp/net/blimp_net_export.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class SequencedTaskRunner; | 15 class SequencedTaskRunner; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace blimp { | 18 namespace blimp { |
| 19 | 19 |
| 20 class BlimpMessage; | |
| 21 class BlimpMessageProcessor; | 20 class BlimpMessageProcessor; |
| 22 | 21 |
| 23 // Uni-directional MessageProcessor "pipe" that accepts messages on | 22 // Uni-directional MessageProcessor "pipe" that accepts messages on |
| 24 // one thread and dispatches them to a MessageProcessor on a different | 23 // one thread and dispatches them to a MessageProcessor on a different |
| 25 // thread. | 24 // thread. |
| 26 // | 25 // |
| 27 // Typical usage involves: | 26 // Typical usage involves: |
| 28 // 1. Create the pipe on the "main" thread, specifying the target thread's | 27 // 1. Create the pipe on the "main" thread, specifying the target thread's |
| 29 // task runner. | 28 // task runner. |
| 30 // 2. Take one or more MessageProcessor proxies from it. | 29 // 2. Take one or more MessageProcessor proxies from it. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 59 | 58 |
| 60 // Allows |this| to be safely detached from existing proxies on deletion. | 59 // Allows |this| to be safely detached from existing proxies on deletion. |
| 61 base::WeakPtrFactory<BlimpMessageThreadPipe> weak_factory_; | 60 base::WeakPtrFactory<BlimpMessageThreadPipe> weak_factory_; |
| 62 | 61 |
| 63 DISALLOW_COPY_AND_ASSIGN(BlimpMessageThreadPipe); | 62 DISALLOW_COPY_AND_ASSIGN(BlimpMessageThreadPipe); |
| 64 }; | 63 }; |
| 65 | 64 |
| 66 } // namespace blimp | 65 } // namespace blimp |
| 67 | 66 |
| 68 #endif // BLIMP_NET_BLIMP_MESSAGE_THREAD_PIPE_H_ | 67 #endif // BLIMP_NET_BLIMP_MESSAGE_THREAD_PIPE_H_ |
| OLD | NEW |