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

Side by Side Diff: ipc/ipc_channel.h

Issue 2147493006: Adds Channel-associated interface support on ChannelProxy's thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 | « no previous file | 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
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 13
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/files/scoped_file.h" 15 #include "base/files/scoped_file.h"
16 #include "base/memory/ref_counted.h"
16 #include "base/process/process.h" 17 #include "base/process/process.h"
18 #include "base/single_thread_task_runner.h"
17 #include "build/build_config.h" 19 #include "build/build_config.h"
18 #include "ipc/ipc_channel_handle.h" 20 #include "ipc/ipc_channel_handle.h"
19 #include "ipc/ipc_endpoint.h" 21 #include "ipc/ipc_endpoint.h"
20 #include "ipc/ipc_message.h" 22 #include "ipc/ipc_message.h"
21 #include "mojo/public/cpp/bindings/associated_group.h" 23 #include "mojo/public/cpp/bindings/associated_group.h"
22 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" 24 #include "mojo/public/cpp/bindings/associated_interface_ptr.h"
23 #include "mojo/public/cpp/bindings/associated_interface_request.h" 25 #include "mojo/public/cpp/bindings/associated_interface_request.h"
24 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" 26 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
25 27
26 #if defined(OS_POSIX) 28 #if defined(OS_POSIX)
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Adds an interface factory to this channel for interface |name|. 115 // Adds an interface factory to this channel for interface |name|.
114 virtual void AddGenericAssociatedInterface( 116 virtual void AddGenericAssociatedInterface(
115 const std::string& name, 117 const std::string& name,
116 const GenericAssociatedInterfaceFactory& factory) = 0; 118 const GenericAssociatedInterfaceFactory& factory) = 0;
117 119
118 // Requests an associated interface from the remote endpoint. 120 // Requests an associated interface from the remote endpoint.
119 virtual void GetGenericRemoteAssociatedInterface( 121 virtual void GetGenericRemoteAssociatedInterface(
120 const std::string& name, 122 const std::string& name,
121 mojo::ScopedInterfaceEndpointHandle handle) = 0; 123 mojo::ScopedInterfaceEndpointHandle handle) = 0;
122 124
125 // Sets the TaskRunner on which to support proxied dispatch for associated
126 // interfaces.
127 virtual void SetProxyTaskRunner(
128 scoped_refptr<base::SingleThreadTaskRunner> task_runner) = 0;
129
123 // Template helper to add an interface factory to this channel. 130 // Template helper to add an interface factory to this channel.
124 template <typename Interface> 131 template <typename Interface>
125 using AssociatedInterfaceFactory = 132 using AssociatedInterfaceFactory =
126 base::Callback<void(mojo::AssociatedInterfaceRequest<Interface>)>; 133 base::Callback<void(mojo::AssociatedInterfaceRequest<Interface>)>;
127 template <typename Interface> 134 template <typename Interface>
128 void AddAssociatedInterface( 135 void AddAssociatedInterface(
129 const AssociatedInterfaceFactory<Interface>& factory) { 136 const AssociatedInterfaceFactory<Interface>& factory) {
130 AddGenericAssociatedInterface( 137 AddGenericAssociatedInterface(
131 Interface::Name_, 138 Interface::Name_,
132 base::Bind(&BindAssociatedInterfaceRequest<Interface>, factory)); 139 base::Bind(&BindAssociatedInterfaceRequest<Interface>, factory));
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 356
350 #if defined(OS_POSIX) 357 #if defined(OS_POSIX)
351 // SocketPair() creates a pair of socket FDs suitable for using with 358 // SocketPair() creates a pair of socket FDs suitable for using with
352 // IPC::Channel. 359 // IPC::Channel.
353 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); 360 IPC_EXPORT bool SocketPair(int* fd1, int* fd2);
354 #endif 361 #endif
355 362
356 } // namespace IPC 363 } // namespace IPC
357 364
358 #endif // IPC_IPC_CHANNEL_H_ 365 #endif // IPC_IPC_CHANNEL_H_
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_channel_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698