Use cc rather than mm files and merge cfstream related files into core

reviewable/pr15069/r1
Muxi Yan 7 years ago
parent c7d57f1157
commit a70102b1eb
  1. 23
      build.yaml
  2. 3
      include/grpc/impl/codegen/port_platform.h
  3. 2
      src/core/lib/iomgr/error_apple.cc
  4. 66
      src/core/lib/iomgr/iomgr_cfstream.cc
  5. 26
      src/core/lib/iomgr/iomgr_cfstream.h
  6. 4
      src/core/lib/iomgr/port.h
  7. 2
      src/core/lib/iomgr/tcp_cfstream.cc
  8. 2
      src/core/lib/iomgr/tcp_cfstream.h
  9. 2
      src/core/lib/iomgr/tcp_cfstream_sync.cc
  10. 2
      src/core/lib/iomgr/tcp_cfstream_sync.h
  11. 2
      src/core/lib/iomgr/tcp_client_cfstream.cc
  12. 10
      templates/gRPC-Core.podspec.template

@ -259,6 +259,7 @@ filegroups:
- src/core/lib/iomgr/endpoint_pair_uv.cc
- src/core/lib/iomgr/endpoint_pair_windows.cc
- src/core/lib/iomgr/error.cc
- src/core/lib/iomgr/error_apple.cc
- src/core/lib/iomgr/ev_epoll1_linux.cc
- src/core/lib/iomgr/ev_epollex_linux.cc
- src/core/lib/iomgr/ev_epollsig_linux.cc
@ -274,7 +275,6 @@ filegroups:
- src/core/lib/iomgr/gethostname_sysconf.cc
- src/core/lib/iomgr/iocp_windows.cc
- src/core/lib/iomgr/iomgr.cc
- src/core/lib/iomgr/iomgr_cfstream.cc
- src/core/lib/iomgr/iomgr_custom.cc
- src/core/lib/iomgr/iomgr_internal.cc
- src/core/lib/iomgr/iomgr_posix.cc
@ -306,7 +306,10 @@ filegroups:
- src/core/lib/iomgr/socket_utils_uv.cc
- src/core/lib/iomgr/socket_utils_windows.cc
- src/core/lib/iomgr/socket_windows.cc
- src/core/lib/iomgr/tcp_cfstream.cc
- src/core/lib/iomgr/tcp_cfstream_sync.cc
- src/core/lib/iomgr/tcp_client.cc
- src/core/lib/iomgr/tcp_client_cfstream.cc
- src/core/lib/iomgr/tcp_client_custom.cc
- src/core/lib/iomgr/tcp_client_posix.cc
- src/core/lib/iomgr/tcp_client_windows.cc
@ -436,6 +439,7 @@ filegroups:
- src/core/lib/iomgr/endpoint.h
- src/core/lib/iomgr/endpoint_pair.h
- src/core/lib/iomgr/error.h
- src/core/lib/iomgr/error_apple.h
- src/core/lib/iomgr/error_internal.h
- src/core/lib/iomgr/ev_epoll1_linux.h
- src/core/lib/iomgr/ev_epollex_linux.h
@ -447,7 +451,6 @@ filegroups:
- src/core/lib/iomgr/gethostname.h
- src/core/lib/iomgr/iocp_windows.h
- src/core/lib/iomgr/iomgr.h
- src/core/lib/iomgr/iomgr_cfstream.h
- src/core/lib/iomgr/iomgr_custom.h
- src/core/lib/iomgr/iomgr_internal.h
- src/core/lib/iomgr/iomgr_posix.h
@ -478,6 +481,8 @@ filegroups:
- src/core/lib/iomgr/socket_utils_posix.h
- src/core/lib/iomgr/socket_windows.h
- src/core/lib/iomgr/sys_epoll_wrapper.h
- src/core/lib/iomgr/tcp_cfstream.h
- src/core/lib/iomgr/tcp_cfstream_sync.h
- src/core/lib/iomgr/tcp_client.h
- src/core/lib/iomgr/tcp_client_posix.h
- src/core/lib/iomgr/tcp_custom.h
@ -1336,20 +1341,6 @@ filegroups:
deps:
- grpc++
- grpc
- name: grpc_cfstream
language: objc++
headers:
- src/core/lib/iomgr/error_apple.h
- src/core/lib/iomgr/tcp_cfstream.h
- src/core/lib/iomgr/tcp_cfstream_sync.h
src:
- src/core/lib/iomgr/error_apple.mm
- src/core/lib/iomgr/tcp_cfstream.mm
- src/core/lib/iomgr/tcp_cfstream_sync.mm
- src/core/lib/iomgr/tcp_client_cfstream.mm
uses:
- gpr_base_headers
- grpc_base_headers
libs:
- name: address_sorting
build: all

@ -227,7 +227,10 @@
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
/* TODO(mxyan): Remove when CFStream becomes default */
#ifndef GRPC_CFSTREAM
#define GPR_SUPPORT_CHANNELS_FROM_FD 1
#endif
#ifdef _LP64
#define GPR_ARCH_64 1
#else /* _LP64 */

@ -19,7 +19,7 @@
#include <grpc/support/port_platform.h>
#ifdef GPR_APPLE
#import <Foundation/Foundation.h>
#include <CoreFoundation/CoreFoundation.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>

@ -1,66 +0,0 @@
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_CFSTREAM_IOMGR
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/iomgr_posix.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_posix.h"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/iomgr/timer.h"
extern grpc_tcp_client_vtable grpc_posix_tcp_client_vtable;
extern grpc_timer_vtable grpc_generic_timer_vtable;
extern grpc_pollset_vtable grpc_posix_pollset_vtable;
extern grpc_pollset_set_vtable grpc_posix_pollset_set_vtable;
extern grpc_address_resolver_vtable grpc_posix_resolver_vtable;
static void iomgr_platform_init(void) {
grpc_wakeup_fd_global_init();
grpc_event_engine_init();
}
static void iomgr_platform_flush(void) {}
static void iomgr_platform_shutdown(void) {
grpc_event_engine_shutdown();
grpc_wakeup_fd_global_destroy();
}
static grpc_iomgr_platform_vtable vtable = {
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown};
void grpc_set_default_iomgr_platform() {
grpc_set_tcp_client_impl(&grpc_posix_tcp_client_vtable);
grpc_set_tcp_server_impl(nullptr);
grpc_set_timer_impl(&grpc_generic_timer_vtable);
grpc_set_pollset_vtable(&grpc_posix_pollset_vtable);
grpc_set_pollset_set_vtable(&grpc_posix_pollset_set_vtable);
grpc_set_resolver_impl(&grpc_posix_resolver_vtable);
grpc_set_iomgr_platform_vtable(&vtable);
}
#endif /* GRPC_CFSTREAM_IOMGR */

@ -1,26 +0,0 @@
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_LIB_IOMGR_IOMGR_CFSTREAM_H
#define GRPC_CORE_LIB_IOMGR_IOMGR_CFSTREAM_H
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/iomgr_internal.h"
#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_CFSTREAM_H */

@ -98,7 +98,7 @@
#define GRPC_POSIX_FORK 1
#define GRPC_POSIX_NO_SPECIAL_WAKEUP_FD 1
#ifdef GRPC_CFSTREAM
#define GRPC_CFSTREAM_IOMGR 1
#define GRPC_POSIX_SOCKET_IOMGR 1
#define GRPC_CFSTREAM_TCP 1
#define GRPC_CFSTREAM_TCP_CLIENT 1
#define GRPC_POSIX_SOCKET_ARES_EV_DRIVER 1
@ -110,6 +110,8 @@
#define GRPC_POSIX_SOCKET_RESOLVE_ADDRESS 1
#define GRPC_POSIX_SOCKET_SOCKADDR 1
#define GRPC_POSIX_SOCKET_SOCKET_FACTORY 1
#define GRPC_POSIX_SOCKET_TCP 1
#define GRPC_POSIX_SOCKET_TCP_SERVER 1
#define GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON 1
#define GRPC_POSIX_SOCKET_UTILS_COMMON 1
#else

@ -21,7 +21,7 @@
#ifdef GRPC_CFSTREAM_TCP
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import "src/core/lib/iomgr/tcp_cfstream.h"
#include <grpc/slice_buffer.h>

@ -33,7 +33,7 @@
#ifdef GRPC_CFSTREAM
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/endpoint.h"

@ -20,7 +20,7 @@
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_CFSTREAM
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import "src/core/lib/iomgr/tcp_cfstream_sync.h"
#include <grpc/support/atm.h>

@ -24,7 +24,7 @@
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_CFSTREAM
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/lockfree_event.h"

@ -22,7 +22,7 @@
#ifdef GRPC_CFSTREAM_TCP_CLIENT
#include <Foundation/Foundation.h>
#include <CoreFoundation/CoreFoundation.h>
#include <string.h>

@ -68,14 +68,6 @@
excl = grpc_private_files(libs)
return [file for file in out if not file in excl]
def cfstream_private_headers(libs):
out = grpc_lib_files(libs, ("grpc_cfstream",), ("headers",))
return out
def cfstream_private_files(libs):
out = grpc_lib_files(libs, ("grpc_cfstream",), ("src", "headers"))
return out
def ruby_multiline_list(files, indent):
return (',\n' + indent*' ').join('\'%s\'' % f for f in files)
%>
@ -189,8 +181,6 @@
ss.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1'
}
ss.source_files = ${ruby_multiline_list(cfstream_private_files(filegroups), 22)}
ss.private_header_files = ${ruby_multiline_list(cfstream_private_headers(filegroups), 30)}
end
s.subspec 'Cronet-Interface' do |ss|

Loading…
Cancel
Save