OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_EMBEDDER_CHANNEL_INIT_H_ | 5 #ifndef MOJO_EMBEDDER_CHANNEL_INIT_H_ |
6 #define MOJO_EMBEDDER_CHANNEL_INIT_H_ | 6 #define MOJO_EMBEDDER_CHANNEL_INIT_H_ |
7 | 7 |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Notifies the channel that we (hence it) will soon be destroyed. | 39 // Notifies the channel that we (hence it) will soon be destroyed. |
40 void WillDestroySoon(); | 40 void WillDestroySoon(); |
41 | 41 |
42 private: | 42 private: |
43 // Invoked on the thread on which this object lives once the channel has been | 43 // Invoked on the thread on which this object lives once the channel has been |
44 // established. (This is a static method that takes a weak pointer to self, | 44 // established. (This is a static method that takes a weak pointer to self, |
45 // since we want to destroy the channel even if we're destroyed.) | 45 // since we want to destroy the channel even if we're destroyed.) |
46 static void OnCreatedChannel(base::WeakPtr<ChannelInit> self, | 46 static void OnCreatedChannel(base::WeakPtr<ChannelInit> self, |
47 scoped_refptr<base::TaskRunner> io_thread, | 47 scoped_refptr<base::TaskRunner> io_thread, |
48 embedder::ChannelInfo* channel); | 48 ChannelInfo* channel); |
49 | 49 |
50 scoped_refptr<base::TaskRunner> io_thread_task_runner_; | 50 scoped_refptr<base::TaskRunner> io_thread_task_runner_; |
51 | 51 |
52 // If non-null the channel has been established. | 52 // If non-null the channel has been established. |
53 embedder::ChannelInfo* channel_info_; | 53 ChannelInfo* channel_info_; |
54 | 54 |
55 base::WeakPtrFactory<ChannelInit> weak_factory_; | 55 base::WeakPtrFactory<ChannelInit> weak_factory_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(ChannelInit); | 57 DISALLOW_COPY_AND_ASSIGN(ChannelInit); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace embedder | 60 } // namespace embedder |
61 } // namespace mojo | 61 } // namespace mojo |
62 | 62 |
63 #endif // MOJO_EMBEDDER_CHANNEL_INIT_H_ | 63 #endif // MOJO_EMBEDDER_CHANNEL_INIT_H_ |
OLD | NEW |