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

Side by Side Diff: ipc/ipc_channel.h

Issue 2173303002: Revert of Support early associated interface binding on ChannelMojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicit-channel-ipc-task-runner
Patch Set: Created 4 years, 5 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.mojom ('k') | ipc/ipc_channel_mojo.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CHANNEL_H_ 5 #ifndef IPC_IPC_CHANNEL_H_
6 #define IPC_IPC_CHANNEL_H_ 6 #define IPC_IPC_CHANNEL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // Helper interface a Channel may implement to expose support for associated 96 // Helper interface a Channel may implement to expose support for associated
97 // Mojo interfaces. 97 // Mojo interfaces.
98 class IPC_EXPORT AssociatedInterfaceSupport { 98 class IPC_EXPORT AssociatedInterfaceSupport {
99 public: 99 public:
100 using GenericAssociatedInterfaceFactory = 100 using GenericAssociatedInterfaceFactory =
101 base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>; 101 base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>;
102 102
103 virtual ~AssociatedInterfaceSupport() {} 103 virtual ~AssociatedInterfaceSupport() {}
104 104
105 // Accesses the AssociatedGroup used to associate new interface endpoints 105 // Accesses the AssociatedGroup used to associate new interface endpoints
106 // with this Channel. Must be safe to call from any thread. 106 // with this Channel.
107 virtual mojo::AssociatedGroup* GetAssociatedGroup() = 0; 107 virtual mojo::AssociatedGroup* GetAssociatedGroup() = 0;
108 108
109 // Adds an interface factory to this channel for interface |name|. Must be 109 // Adds an interface factory to this channel for interface |name|.
110 // safe to call from any thread.
111 virtual void AddGenericAssociatedInterface( 110 virtual void AddGenericAssociatedInterface(
112 const std::string& name, 111 const std::string& name,
113 const GenericAssociatedInterfaceFactory& factory) = 0; 112 const GenericAssociatedInterfaceFactory& factory) = 0;
114 113
115 // Requests an associated interface from the remote endpoint. 114 // Requests an associated interface from the remote endpoint.
116 virtual void GetGenericRemoteAssociatedInterface( 115 virtual void GetGenericRemoteAssociatedInterface(
117 const std::string& name, 116 const std::string& name,
118 mojo::ScopedInterfaceEndpointHandle handle) = 0; 117 mojo::ScopedInterfaceEndpointHandle handle) = 0;
119 118
119 // Sets the TaskRunner on which to support proxied dispatch for associated
120 // interfaces.
121 virtual void SetProxyTaskRunner(
122 scoped_refptr<base::SingleThreadTaskRunner> task_runner) = 0;
123
120 // Template helper to add an interface factory to this channel. 124 // Template helper to add an interface factory to this channel.
121 template <typename Interface> 125 template <typename Interface>
122 using AssociatedInterfaceFactory = 126 using AssociatedInterfaceFactory =
123 base::Callback<void(mojo::AssociatedInterfaceRequest<Interface>)>; 127 base::Callback<void(mojo::AssociatedInterfaceRequest<Interface>)>;
124 template <typename Interface> 128 template <typename Interface>
125 void AddAssociatedInterface( 129 void AddAssociatedInterface(
126 const AssociatedInterfaceFactory<Interface>& factory) { 130 const AssociatedInterfaceFactory<Interface>& factory) {
127 AddGenericAssociatedInterface( 131 AddGenericAssociatedInterface(
128 Interface::Name_, 132 Interface::Name_,
129 base::Bind(&BindAssociatedInterfaceRequest<Interface>, factory)); 133 base::Bind(&BindAssociatedInterfaceRequest<Interface>, factory));
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 344
341 #if defined(OS_POSIX) 345 #if defined(OS_POSIX)
342 // SocketPair() creates a pair of socket FDs suitable for using with 346 // SocketPair() creates a pair of socket FDs suitable for using with
343 // IPC::Channel. 347 // IPC::Channel.
344 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); 348 IPC_EXPORT bool SocketPair(int* fd1, int* fd2);
345 #endif 349 #endif
346 350
347 } // namespace IPC 351 } // namespace IPC
348 352
349 #endif // IPC_IPC_CHANNEL_H_ 353 #endif // IPC_IPC_CHANNEL_H_
OLDNEW
« no previous file with comments | « ipc/ipc.mojom ('k') | ipc/ipc_channel_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698