Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: third_party/mojo/src/mojo/edk/embedder/channel_init.h

Issue 877993004: Revert "Update mojo sdk to rev 8d45c89c30b230843c5bd6dd0693a555750946c0" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_EDK_EMBEDDER_CHANNEL_INIT_H_ 5 #ifndef MOJO_EDK_EMBEDDER_CHANNEL_INIT_H_
6 #define MOJO_EDK_EMBEDDER_CHANNEL_INIT_H_ 6 #define MOJO_EDK_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 10 matching lines...) Expand all
21 namespace embedder { 21 namespace embedder {
22 22
23 // |ChannelInit| handles creation (and destruction) of the Mojo channel. It is 23 // |ChannelInit| handles creation (and destruction) of the Mojo channel. It is
24 // not thread-safe, but may be used on any single thread (with a |MessageLoop|). 24 // not thread-safe, but may be used on any single thread (with a |MessageLoop|).
25 class MOJO_SYSTEM_IMPL_EXPORT ChannelInit { 25 class MOJO_SYSTEM_IMPL_EXPORT ChannelInit {
26 public: 26 public:
27 ChannelInit(); 27 ChannelInit();
28 ~ChannelInit(); 28 ~ChannelInit();
29 29
30 // Initializes the channel. This takes ownership of |file|. Returns the 30 // Initializes the channel. This takes ownership of |file|. Returns the
31 // primordial |MessagePipe| for the channel. 31 // primordial MessagePipe for the channel.
32 mojo::ScopedMessagePipeHandle Init( 32 mojo::ScopedMessagePipeHandle Init(
33 base::PlatformFile file, 33 base::PlatformFile file,
34 scoped_refptr<base::TaskRunner> io_thread_task_runner); 34 scoped_refptr<base::TaskRunner> io_thread_task_runner);
35 35
36 // Notifies the channel that we (hence it) will soon be destroyed. 36 // Notifies the channel that we (hence it) will soon be destroyed.
37 void WillDestroySoon(); 37 void WillDestroySoon();
38 38
39 private: 39 private:
40 // Invoked on the thread on which this object lives once the channel has been 40 // Invoked on the thread on which this object lives once the channel has been
41 // established. (This is a static method that takes a weak pointer to self, 41 // established. (This is a static method that takes a weak pointer to self,
42 // since we want to destroy the channel even if we're destroyed.) 42 // since we want to destroy the channel even if we're destroyed.)
43 static void OnCreatedChannel(base::WeakPtr<ChannelInit> self, 43 static void OnCreatedChannel(base::WeakPtr<ChannelInit> self,
44 scoped_refptr<base::TaskRunner> io_thread,
44 ChannelInfo* channel); 45 ChannelInfo* channel);
45 46
47 scoped_refptr<base::TaskRunner> io_thread_task_runner_;
48
46 // If non-null the channel has been established. 49 // If non-null the channel has been established.
47 ChannelInfo* channel_info_; 50 ChannelInfo* channel_info_;
48 51
49 base::WeakPtrFactory<ChannelInit> weak_factory_; 52 base::WeakPtrFactory<ChannelInit> weak_factory_;
50 53
51 DISALLOW_COPY_AND_ASSIGN(ChannelInit); 54 DISALLOW_COPY_AND_ASSIGN(ChannelInit);
52 }; 55 };
53 56
54 } // namespace embedder 57 } // namespace embedder
55 } // namespace mojo 58 } // namespace mojo
56 59
57 #endif // MOJO_EDK_EMBEDDER_CHANNEL_INIT_H_ 60 #endif // MOJO_EDK_EMBEDDER_CHANNEL_INIT_H_
OLDNEW
« no previous file with comments | « third_party/mojo/src/mojo/edk/embedder/DEPS ('k') | third_party/mojo/src/mojo/edk/embedder/channel_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698