binder_server.h
Go to the documentation of this file.
1 // Copyright 2021 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_SERVER_BINDER_SERVER_H
16 #define GRPC_CORE_EXT_TRANSPORT_BINDER_SERVER_BINDER_SERVER_H
17 
19 
20 #include <string>
21 
22 #include "absl/container/flat_hash_map.h"
23 #include "absl/status/status.h"
24 
26 
32 
33 // TODO(waynetu): This is part of the public API and should be moved to the
34 // include/ folder.
35 namespace grpc {
36 namespace experimental {
37 namespace binder {
38 
40 void AddEndpointBinder(const std::string& service, void* endpoint_binder);
42 
43 } // namespace binder
44 } // namespace experimental
45 } // namespace grpc
46 
48  void* endpoint_binder);
51 
52 namespace grpc_core {
53 
54 // Consume a callback, produce a transaction listener. This is used to perform
55 // testing in non-Android environments where the actual binder is not available.
57  std::function<std::unique_ptr<grpc_binder::TransactionReceiver>(
59 
62  std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
63  security_policy);
64 
65 } // namespace grpc_core
66 
67 #endif // GRPC_CORE_EXT_TRANSPORT_BINDER_SERVER_BINDER_SERVER_H
grpc
Definition: grpcpp/alarm.h:33
grpc_core::AddBinderPort
bool AddBinderPort(const std::string &addr, grpc_server *server, BinderTxReceiverFactory factory, std::shared_ptr< grpc::experimental::binder::SecurityPolicy > security_policy)
Definition: binder_server.cc:232
binder.h
grpc_core
Definition: call_metric_recorder.h:31
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc::experimental::binder::GetEndpointBinder
void * GetEndpointBinder(const std::string &service)
Definition: binder_server.cc:78
binder_security_policy.h
grpc_server
struct grpc_server grpc_server
Definition: grpc_types.h:65
grpc_core::BinderTxReceiverFactory
std::function< std::unique_ptr< grpc_binder::TransactionReceiver >(grpc_binder::TransactionReceiver::OnTransactCb)> BinderTxReceiverFactory
Definition: binder_server.h:58
grpc_add_endpoint_binder
void grpc_add_endpoint_binder(const std::string &service, void *endpoint_binder)
Definition: binder_server.cc:106
grpc::experimental::binder::RemoveEndpointBinder
void RemoveEndpointBinder(const std::string &service)
Definition: binder_server.cc:86
grpc::experimental::binder::AddEndpointBinder
void AddEndpointBinder(const std::string &service, void *endpoint_binder)
Definition: binder_server.cc:82
grpc_binder::TransactionReceiver::OnTransactCb
std::function< absl::Status(transaction_code_t, ReadableParcel *, int uid)> OnTransactCb
Definition: binder.h:80
server
Definition: examples/python/async_streaming/server.py:1
exec_ctx.h
server.h
grpc_get_endpoint_binder
void * grpc_get_endpoint_binder(const std::string &service)
Definition: binder_server.cc:123
grpc_remove_endpoint_binder
void grpc_remove_endpoint_binder(const std::string &service)
Definition: binder_server.cc:115
service
__attribute__((deprecated("Please use GRPCProtoMethod."))) @interface ProtoMethod NSString * service
Definition: ProtoMethod.h:25
addr
struct sockaddr_in addr
Definition: libuv/docs/code/tcp-echo-server/main.c:10
error_utils.h
binder_transport.h
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:38