aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--build.yaml23
-rw-r--r--include/grpc/impl/codegen/port_platform.h3
-rw-r--r--src/core/lib/iomgr/error_apple.cc (renamed from src/core/lib/iomgr/error_apple.mm)2
-rw-r--r--src/core/lib/iomgr/iomgr_cfstream.cc66
-rw-r--r--src/core/lib/iomgr/iomgr_cfstream.h26
-rw-r--r--src/core/lib/iomgr/port.h4
-rw-r--r--src/core/lib/iomgr/tcp_cfstream.cc (renamed from src/core/lib/iomgr/tcp_cfstream.mm)2
-rw-r--r--src/core/lib/iomgr/tcp_cfstream.h2
-rw-r--r--src/core/lib/iomgr/tcp_cfstream_sync.cc (renamed from src/core/lib/iomgr/tcp_cfstream_sync.mm)2
-rw-r--r--src/core/lib/iomgr/tcp_cfstream_sync.h2
-rw-r--r--src/core/lib/iomgr/tcp_client_cfstream.cc (renamed from src/core/lib/iomgr/tcp_client_cfstream.mm)2
-rw-r--r--templates/gRPC-Core.podspec.template10
12 files changed, 19 insertions, 125 deletions
diff --git a/build.yaml b/build.yaml
index 73fd2cd0e9..ae0a1246ba 100644
--- a/build.yaml
+++ b/build.yaml
@@ -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
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index bf1bf3df6a..01ce5f03e9 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -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 */
diff --git a/src/core/lib/iomgr/error_apple.mm b/src/core/lib/iomgr/error_apple.cc
index 6976a798d4..e8f98bf0ba 100644
--- a/src/core/lib/iomgr/error_apple.mm
+++ b/src/core/lib/iomgr/error_apple.cc
@@ -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>
diff --git a/src/core/lib/iomgr/iomgr_cfstream.cc b/src/core/lib/iomgr/iomgr_cfstream.cc
deleted file mode 100644
index 2fde202b8a..0000000000
--- a/src/core/lib/iomgr/iomgr_cfstream.cc
+++ /dev/null
@@ -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 */
diff --git a/src/core/lib/iomgr/iomgr_cfstream.h b/src/core/lib/iomgr/iomgr_cfstream.h
deleted file mode 100644
index 19bc859bd5..0000000000
--- a/src/core/lib/iomgr/iomgr_cfstream.h
+++ /dev/null
@@ -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 */
diff --git a/src/core/lib/iomgr/port.h b/src/core/lib/iomgr/port.h
index e1ca43aecc..a1a029e1bf 100644
--- a/src/core/lib/iomgr/port.h
+++ b/src/core/lib/iomgr/port.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
diff --git a/src/core/lib/iomgr/tcp_cfstream.mm b/src/core/lib/iomgr/tcp_cfstream.cc
index 04086aef6f..7705b6dcd1 100644
--- a/src/core/lib/iomgr/tcp_cfstream.mm
+++ b/src/core/lib/iomgr/tcp_cfstream.cc
@@ -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>
diff --git a/src/core/lib/iomgr/tcp_cfstream.h b/src/core/lib/iomgr/tcp_cfstream.h
index dedcad4941..9f52f6a5de 100644
--- a/src/core/lib/iomgr/tcp_cfstream.h
+++ b/src/core/lib/iomgr/tcp_cfstream.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"
diff --git a/src/core/lib/iomgr/tcp_cfstream_sync.mm b/src/core/lib/iomgr/tcp_cfstream_sync.cc
index 0c371ea238..bc5bd0a600 100644
--- a/src/core/lib/iomgr/tcp_cfstream_sync.mm
+++ b/src/core/lib/iomgr/tcp_cfstream_sync.cc
@@ -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>
diff --git a/src/core/lib/iomgr/tcp_cfstream_sync.h b/src/core/lib/iomgr/tcp_cfstream_sync.h
index ef9d41de26..9e1d8fbed9 100644
--- a/src/core/lib/iomgr/tcp_cfstream_sync.h
+++ b/src/core/lib/iomgr/tcp_cfstream_sync.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"
diff --git a/src/core/lib/iomgr/tcp_client_cfstream.mm b/src/core/lib/iomgr/tcp_client_cfstream.cc
index c2c77bd9ca..61606ffd11 100644
--- a/src/core/lib/iomgr/tcp_client_cfstream.mm
+++ b/src/core/lib/iomgr/tcp_client_cfstream.cc
@@ -22,7 +22,7 @@
#ifdef GRPC_CFSTREAM_TCP_CLIENT
-#include <Foundation/Foundation.h>
+#include <CoreFoundation/CoreFoundation.h>
#include <string.h>
diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template
index ff19aa313d..8704a8a138 100644
--- a/templates/gRPC-Core.podspec.template
+++ b/templates/gRPC-Core.podspec.template
@@ -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|