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

Side by Side Diff: ipc/ipc_mojo_bootstrap.h

Issue 2668153003: Mojo C++ Bindings: Eliminate unbound ThreadSafeInterfacePtr (Closed)
Patch Set: format and rebase... Created 3 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
« no previous file with comments | « ipc/ipc_message_pipe_reader.h ('k') | ipc/ipc_mojo_bootstrap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 IPC_IPC_MOJO_BOOTSTRAP_H_ 5 #ifndef IPC_IPC_MOJO_BOOTSTRAP_H_
6 #define IPC_IPC_MOJO_BOOTSTRAP_H_ 6 #define IPC_IPC_MOJO_BOOTSTRAP_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 13 matching lines...) Expand all
24 // MojoBootstrap establishes a pair of associated interfaces between two 24 // MojoBootstrap establishes a pair of associated interfaces between two
25 // processes in Chrome. 25 // processes in Chrome.
26 // 26 //
27 // Clients should implement MojoBootstrap::Delegate to get the associated pipes 27 // Clients should implement MojoBootstrap::Delegate to get the associated pipes
28 // from MojoBootstrap object. 28 // from MojoBootstrap object.
29 // 29 //
30 // This lives on IO thread other than Create(), which can be called from 30 // This lives on IO thread other than Create(), which can be called from
31 // UI thread as Channel::Create() can be. 31 // UI thread as Channel::Create() can be.
32 class IPC_EXPORT MojoBootstrap { 32 class IPC_EXPORT MojoBootstrap {
33 public: 33 public:
34 class Delegate {
35 public:
36 virtual ~Delegate() {}
37
38 virtual void OnPipesAvailable(mojom::ChannelAssociatedPtr sender,
39 mojom::ChannelAssociatedRequest receiver) = 0;
40 };
41
42 virtual ~MojoBootstrap() {} 34 virtual ~MojoBootstrap() {}
43 35
44 // Create the MojoBootstrap instance, using |handle| as the message pipe, in 36 // Create the MojoBootstrap instance, using |handle| as the message pipe, in
45 // mode as specified by |mode|. The result is passed to |delegate|. 37 // mode as specified by |mode|. The result is passed to |delegate|.
46 static std::unique_ptr<MojoBootstrap> Create( 38 static std::unique_ptr<MojoBootstrap> Create(
47 mojo::ScopedMessagePipeHandle handle, 39 mojo::ScopedMessagePipeHandle handle,
48 Channel::Mode mode, 40 Channel::Mode mode,
49 Delegate* delegate,
50 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner); 41 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner);
51 42
52 // Start the handshake over the underlying message pipe. 43 // Start the handshake over the underlying message pipe.
53 virtual void Connect() = 0; 44 virtual void Connect(mojom::ChannelAssociatedPtr* sender,
45 mojom::ChannelAssociatedRequest* receiver) = 0;
54 46
55 // Stop transmitting messages and start queueing them instead. 47 // Stop transmitting messages and start queueing them instead.
56 virtual void Pause() = 0; 48 virtual void Pause() = 0;
57 49
58 // Stop queuing new messages and start transmitting them instead. 50 // Stop queuing new messages and start transmitting them instead.
59 virtual void Unpause() = 0; 51 virtual void Unpause() = 0;
60 52
61 // Flush outgoing messages which were queued before Start(). 53 // Flush outgoing messages which were queued before Start().
62 virtual void Flush() = 0; 54 virtual void Flush() = 0;
63 55
64 virtual mojo::AssociatedGroup* GetAssociatedGroup() = 0; 56 virtual mojo::AssociatedGroup* GetAssociatedGroup() = 0;
65 }; 57 };
66 58
67 } // namespace IPC 59 } // namespace IPC
68 60
69 #endif // IPC_IPC_MOJO_BOOTSTRAP_H_ 61 #endif // IPC_IPC_MOJO_BOOTSTRAP_H_
OLDNEW
« no previous file with comments | « ipc/ipc_message_pipe_reader.h ('k') | ipc/ipc_mojo_bootstrap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698