From 39a434304425938b573f4c72c987d61b1ee37fd6 Mon Sep 17 00:00:00 2001 From: Cheng-Yu Chung Date: Tue, 6 Dec 2022 03:11:42 +0800 Subject: [PATCH] Revert "Remove `include/grpc/impl/codegen/gpr_slice.h` (#31774)" (#31805) This reverts commit ac1dee8ac11efaadb56c665c42920868b73cae29. --- BUILD | 1 + CMakeLists.txt | 4 ++ Makefile | 3 + build_autogenerated.yaml | 4 ++ gRPC-Core.podspec | 1 + grpc.gemspec | 1 + include/grpc/impl/codegen/gpr_slice.h | 71 +++++++++++++++++++ include/grpc/impl/codegen/slice.h | 20 ++++++ include/grpc/module.modulemap | 1 + package.xml | 1 + .../credentials/oauth2/oauth2_credentials.cc | 3 +- .../tsi/alts/handshaker/alts_tsi_utils.cc | 4 +- test/core/security/fetch_oauth2.cc | 4 +- test/core/slice/c_slice_buffer_test.cc | 8 +-- .../core/surface/public_headers_must_be_c89.c | 1 + .../alts_handshaker_service_api_test_lib.cc | 4 +- .../handshaker/alts_tsi_handshaker_test.cc | 2 +- test/core/util/fuzzer_corpus_test.cc | 2 +- test/core/util/passthru_endpoint.cc | 6 +- test/cpp/util/cli_call.cc | 2 +- tools/doxygen/Doxyfile.c++ | 1 + tools/doxygen/Doxyfile.c++.internal | 1 + tools/doxygen/Doxyfile.core | 1 + tools/doxygen/Doxyfile.core.internal | 1 + 24 files changed, 130 insertions(+), 17 deletions(-) create mode 100644 include/grpc/impl/codegen/gpr_slice.h diff --git a/BUILD b/BUILD index 3e6b8d97c97..8a279fae625 100644 --- a/BUILD +++ b/BUILD @@ -180,6 +180,7 @@ GPR_PUBLIC_HDRS = [ "include/grpc/impl/codegen/atm_gcc_sync.h", "include/grpc/impl/codegen/atm_windows.h", "include/grpc/impl/codegen/fork.h", + "include/grpc/impl/codegen/gpr_slice.h", "include/grpc/impl/codegen/gpr_types.h", "include/grpc/impl/codegen/log.h", "include/grpc/impl/codegen/port_platform.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 663728281f3..e2b237d9499 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1617,6 +1617,7 @@ foreach(_hdr include/grpc/impl/codegen/atm_gcc_sync.h include/grpc/impl/codegen/atm_windows.h include/grpc/impl/codegen/fork.h + include/grpc/impl/codegen/gpr_slice.h include/grpc/impl/codegen/gpr_types.h include/grpc/impl/codegen/log.h include/grpc/impl/codegen/port_platform.h @@ -2456,6 +2457,7 @@ foreach(_hdr include/grpc/impl/codegen/compression_types.h include/grpc/impl/codegen/connectivity_state.h include/grpc/impl/codegen/fork.h + include/grpc/impl/codegen/gpr_slice.h include/grpc/impl/codegen/gpr_types.h include/grpc/impl/codegen/grpc_types.h include/grpc/impl/codegen/log.h @@ -3061,6 +3063,7 @@ foreach(_hdr include/grpc/impl/codegen/compression_types.h include/grpc/impl/codegen/connectivity_state.h include/grpc/impl/codegen/fork.h + include/grpc/impl/codegen/gpr_slice.h include/grpc/impl/codegen/gpr_types.h include/grpc/impl/codegen/grpc_types.h include/grpc/impl/codegen/log.h @@ -4538,6 +4541,7 @@ foreach(_hdr include/grpc/impl/codegen/compression_types.h include/grpc/impl/codegen/connectivity_state.h include/grpc/impl/codegen/fork.h + include/grpc/impl/codegen/gpr_slice.h include/grpc/impl/codegen/gpr_types.h include/grpc/impl/codegen/grpc_types.h include/grpc/impl/codegen/log.h diff --git a/Makefile b/Makefile index 25b0cc7500e..79bd679cde3 100644 --- a/Makefile +++ b/Makefile @@ -889,6 +889,7 @@ PUBLIC_HEADERS_C += \ include/grpc/impl/codegen/atm_gcc_sync.h \ include/grpc/impl/codegen/atm_windows.h \ include/grpc/impl/codegen/fork.h \ + include/grpc/impl/codegen/gpr_slice.h \ include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/log.h \ include/grpc/impl/codegen/port_platform.h \ @@ -1690,6 +1691,7 @@ PUBLIC_HEADERS_C += \ include/grpc/impl/codegen/compression_types.h \ include/grpc/impl/codegen/connectivity_state.h \ include/grpc/impl/codegen/fork.h \ + include/grpc/impl/codegen/gpr_slice.h \ include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/grpc_types.h \ include/grpc/impl/codegen/log.h \ @@ -2155,6 +2157,7 @@ PUBLIC_HEADERS_C += \ include/grpc/impl/codegen/compression_types.h \ include/grpc/impl/codegen/connectivity_state.h \ include/grpc/impl/codegen/fork.h \ + include/grpc/impl/codegen/gpr_slice.h \ include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/grpc_types.h \ include/grpc/impl/codegen/log.h \ diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 51b5006e55d..3233fda672c 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -142,6 +142,7 @@ libs: - include/grpc/impl/codegen/atm_gcc_sync.h - include/grpc/impl/codegen/atm_windows.h - include/grpc/impl/codegen/fork.h + - include/grpc/impl/codegen/gpr_slice.h - include/grpc/impl/codegen/gpr_types.h - include/grpc/impl/codegen/log.h - include/grpc/impl/codegen/port_platform.h @@ -279,6 +280,7 @@ libs: - include/grpc/impl/codegen/compression_types.h - include/grpc/impl/codegen/connectivity_state.h - include/grpc/impl/codegen/fork.h + - include/grpc/impl/codegen/gpr_slice.h - include/grpc/impl/codegen/gpr_types.h - include/grpc/impl/codegen/grpc_types.h - include/grpc/impl/codegen/log.h @@ -1856,6 +1858,7 @@ libs: - include/grpc/impl/codegen/compression_types.h - include/grpc/impl/codegen/connectivity_state.h - include/grpc/impl/codegen/fork.h + - include/grpc/impl/codegen/gpr_slice.h - include/grpc/impl/codegen/gpr_types.h - include/grpc/impl/codegen/grpc_types.h - include/grpc/impl/codegen/log.h @@ -3390,6 +3393,7 @@ libs: - include/grpc/impl/codegen/compression_types.h - include/grpc/impl/codegen/connectivity_state.h - include/grpc/impl/codegen/fork.h + - include/grpc/impl/codegen/gpr_slice.h - include/grpc/impl/codegen/gpr_types.h - include/grpc/impl/codegen/grpc_types.h - include/grpc/impl/codegen/log.h diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index fa5edaf59ea..664116e0db6 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -130,6 +130,7 @@ Pod::Spec.new do |s| 'include/grpc/impl/codegen/compression_types.h', 'include/grpc/impl/codegen/connectivity_state.h', 'include/grpc/impl/codegen/fork.h', + 'include/grpc/impl/codegen/gpr_slice.h', 'include/grpc/impl/codegen/gpr_types.h', 'include/grpc/impl/codegen/grpc_types.h', 'include/grpc/impl/codegen/log.h', diff --git a/grpc.gemspec b/grpc.gemspec index ed319848b35..5cabc734dbc 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -73,6 +73,7 @@ Gem::Specification.new do |s| s.files += %w( include/grpc/impl/codegen/compression_types.h ) s.files += %w( include/grpc/impl/codegen/connectivity_state.h ) s.files += %w( include/grpc/impl/codegen/fork.h ) + s.files += %w( include/grpc/impl/codegen/gpr_slice.h ) s.files += %w( include/grpc/impl/codegen/gpr_types.h ) s.files += %w( include/grpc/impl/codegen/grpc_types.h ) s.files += %w( include/grpc/impl/codegen/log.h ) diff --git a/include/grpc/impl/codegen/gpr_slice.h b/include/grpc/impl/codegen/gpr_slice.h new file mode 100644 index 00000000000..8782ba3f8da --- /dev/null +++ b/include/grpc/impl/codegen/gpr_slice.h @@ -0,0 +1,71 @@ +/* + * + * Copyright 2016 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_IMPL_CODEGEN_GPR_SLICE_H +#define GRPC_IMPL_CODEGEN_GPR_SLICE_H + +// IWYU pragma: private + +/** WARNING: Please do not use this header. This was added as a temporary + * measure to not break some of the external projects that depend on + * gpr_slice_* functions. We are actively working on moving all the + * gpr_slice_* references to grpc_slice_* and this file will be removed + */ + +/* TODO (sreek) - Allowed by default but will be very soon turned off */ +#define GRPC_ALLOW_GPR_SLICE_FUNCTIONS 1 + +#ifdef GRPC_ALLOW_GPR_SLICE_FUNCTIONS + +#define gpr_slice_refcount grpc_slice_refcount +#define gpr_slice grpc_slice +#define gpr_slice_buffer grpc_slice_buffer + +#define gpr_slice_ref grpc_slice_ref +#define gpr_slice_unref grpc_slice_unref +#define gpr_slice_new grpc_slice_new +#define gpr_slice_new_with_user_data grpc_slice_new_with_user_data +#define gpr_slice_new_with_len grpc_slice_new_with_len +#define gpr_slice_malloc grpc_slice_malloc +#define gpr_slice_from_copied_string grpc_slice_from_copied_string +#define gpr_slice_from_copied_buffer grpc_slice_from_copied_buffer +#define gpr_slice_from_static_string grpc_slice_from_static_string +#define gpr_slice_sub grpc_slice_sub +#define gpr_slice_sub_no_ref grpc_slice_sub_no_ref +#define gpr_slice_split_tail grpc_slice_split_tail +#define gpr_slice_split_head grpc_slice_split_head +#define gpr_slice_cmp grpc_slice_cmp +#define gpr_slice_str_cmp grpc_slice_str_cmp + +#define gpr_slice_buffer grpc_slice_buffer +#define gpr_slice_buffer_init grpc_slice_buffer_init +#define gpr_slice_buffer_destroy grpc_slice_buffer_destroy +#define gpr_slice_buffer_add grpc_slice_buffer_add +#define gpr_slice_buffer_add_indexed grpc_slice_buffer_add_indexed +#define gpr_slice_buffer_addn grpc_slice_buffer_addn +#define gpr_slice_buffer_tiny_add grpc_slice_buffer_tiny_add +#define gpr_slice_buffer_pop grpc_slice_buffer_pop +#define gpr_slice_buffer_reset_and_unref grpc_slice_buffer_reset_and_unref +#define gpr_slice_buffer_swap grpc_slice_buffer_swap +#define gpr_slice_buffer_move_into grpc_slice_buffer_move_into +#define gpr_slice_buffer_trim_end grpc_slice_buffer_trim_end +#define gpr_slice_buffer_move_first grpc_slice_buffer_move_first +#define gpr_slice_buffer_take_first grpc_slice_buffer_take_first + +#endif /* GRPC_ALLOW_GPR_SLICE_FUNCTIONS */ + +#endif /* GRPC_IMPL_CODEGEN_GPR_SLICE_H */ diff --git a/include/grpc/impl/codegen/slice.h b/include/grpc/impl/codegen/slice.h index 2bc1e9248b1..33c1f1b37bd 100644 --- a/include/grpc/impl/codegen/slice.h +++ b/include/grpc/impl/codegen/slice.h @@ -25,6 +25,8 @@ #include +#include + typedef struct grpc_slice grpc_slice; /** Slice API @@ -109,4 +111,22 @@ typedef struct grpc_slice_buffer { GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(slice) #define GRPC_SLICE_IS_EMPTY(slice) (GRPC_SLICE_LENGTH(slice) == 0) +#ifdef GRPC_ALLOW_GPR_SLICE_FUNCTIONS + +/* Duplicate GPR_* definitions */ +#define GPR_SLICE_START_PTR(slice) \ + ((slice).refcount ? (slice).data.refcounted.bytes \ + : (slice).data.inlined.bytes) +#define GPR_SLICE_LENGTH(slice) \ + ((slice).refcount ? (slice).data.refcounted.length \ + : (slice).data.inlined.length) +#define GPR_SLICE_SET_LENGTH(slice, newlen) \ + ((slice).refcount ? ((slice).data.refcounted.length = (size_t)(newlen)) \ + : ((slice).data.inlined.length = (uint8_t)(newlen))) +#define GPR_SLICE_END_PTR(slice) \ + GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(slice) +#define GPR_SLICE_IS_EMPTY(slice) (GRPC_SLICE_LENGTH(slice) == 0) + +#endif /* GRPC_ALLOW_GPR_SLICE_FUNCTIONS */ + #endif /* GRPC_IMPL_CODEGEN_SLICE_H */ diff --git a/include/grpc/module.modulemap b/include/grpc/module.modulemap index 4d0881f712e..f279bb0dbae 100644 --- a/include/grpc/module.modulemap +++ b/include/grpc/module.modulemap @@ -17,6 +17,7 @@ header "byte_buffer.h" header "impl/codegen/compression_types.h" header "impl/codegen/connectivity_state.h" header "impl/codegen/fork.h" + header "impl/codegen/gpr_slice.h" header "impl/codegen/gpr_types.h" header "impl/codegen/grpc_types.h" header "impl/codegen/log.h" diff --git a/package.xml b/package.xml index 477e697a886..f0325e19bf5 100644 --- a/package.xml +++ b/package.xml @@ -55,6 +55,7 @@ + diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc index c13b89236a9..678c3b2c0c2 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -528,7 +529,7 @@ void MaybeAddToBody(const char* field_name, const char* field, body->push_back(absl::StrFormat("&%s=%s", field_name, field)); } -grpc_error_handle LoadTokenFile(const char* path, grpc_slice* token) { +grpc_error_handle LoadTokenFile(const char* path, gpr_slice* token) { grpc_error_handle err = grpc_load_file(path, 1, token); if (!err.ok()) return err; if (GRPC_SLICE_LENGTH(*token) == 0) { diff --git a/src/core/tsi/alts/handshaker/alts_tsi_utils.cc b/src/core/tsi/alts/handshaker/alts_tsi_utils.cc index 4464ae22d8a..18626a55fb5 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +++ b/src/core/tsi/alts/handshaker/alts_tsi_utils.cc @@ -49,9 +49,9 @@ grpc_gcp_HandshakerResp* alts_tsi_utils_deserialize_response( grpc_byte_buffer_reader bbr; grpc_byte_buffer_reader_init(&bbr, resp_buffer); grpc_slice slice = grpc_byte_buffer_reader_readall(&bbr); - size_t buf_size = GRPC_SLICE_LENGTH(slice); + size_t buf_size = GPR_SLICE_LENGTH(slice); void* buf = upb_Arena_Malloc(arena, buf_size); - memcpy(buf, reinterpret_cast(GRPC_SLICE_START_PTR(slice)), + memcpy(buf, reinterpret_cast(GPR_SLICE_START_PTR(slice)), buf_size); grpc_gcp_HandshakerResp* resp = grpc_gcp_HandshakerResp_parse( reinterpret_cast(buf), buf_size, arena); diff --git a/test/core/security/fetch_oauth2.cc b/test/core/security/fetch_oauth2.cc index e72a007cc87..b9f08dcda21 100644 --- a/test/core/security/fetch_oauth2.cc +++ b/test/core/security/fetch_oauth2.cc @@ -50,7 +50,7 @@ static grpc_call_credentials* create_sts_creds(const char* json_file_path) { auto status = grpc::experimental::StsCredentialsOptionsFromJson( reinterpret_cast(GRPC_SLICE_START_PTR(sts_options_slice)), &options); - grpc_slice_unref(sts_options_slice); + gpr_slice_unref(sts_options_slice); if (!status.ok()) { gpr_log(GPR_ERROR, "%s", status.error_message().c_str()); return nullptr; @@ -71,7 +71,7 @@ static grpc_call_credentials* create_refresh_token_creds( grpc_call_credentials* result = grpc_google_refresh_token_credentials_create( reinterpret_cast GRPC_SLICE_START_PTR(refresh_token), nullptr); - grpc_slice_unref(refresh_token); + gpr_slice_unref(refresh_token); return result; } diff --git a/test/core/slice/c_slice_buffer_test.cc b/test/core/slice/c_slice_buffer_test.cc index 3ec3f764ac3..7abb87ef083 100644 --- a/test/core/slice/c_slice_buffer_test.cc +++ b/test/core/slice/c_slice_buffer_test.cc @@ -156,25 +156,25 @@ void test_slice_buffer_first() { } grpc_slice* first = grpc_slice_buffer_peek_first(&buf); - ASSERT_EQ(GRPC_SLICE_LENGTH(*first), GRPC_SLICE_LENGTH(slices[0])); + ASSERT_EQ(GPR_SLICE_LENGTH(*first), GPR_SLICE_LENGTH(slices[0])); ASSERT_EQ(buf.count, 3); ASSERT_EQ(buf.length, 12); grpc_slice_buffer_sub_first(&buf, 1, 2); first = grpc_slice_buffer_peek_first(&buf); - ASSERT_EQ(GRPC_SLICE_LENGTH(*first), 1); + ASSERT_EQ(GPR_SLICE_LENGTH(*first), 1); ASSERT_EQ(buf.count, 3); ASSERT_EQ(buf.length, 10); grpc_slice_buffer_remove_first(&buf); first = grpc_slice_buffer_peek_first(&buf); - ASSERT_EQ(GRPC_SLICE_LENGTH(*first), GRPC_SLICE_LENGTH(slices[1])); + ASSERT_EQ(GPR_SLICE_LENGTH(*first), GPR_SLICE_LENGTH(slices[1])); ASSERT_EQ(buf.count, 2); ASSERT_EQ(buf.length, 9); grpc_slice_buffer_remove_first(&buf); first = grpc_slice_buffer_peek_first(&buf); - ASSERT_EQ(GRPC_SLICE_LENGTH(*first), GRPC_SLICE_LENGTH(slices[2])); + ASSERT_EQ(GPR_SLICE_LENGTH(*first), GPR_SLICE_LENGTH(slices[2])); ASSERT_EQ(buf.count, 1); ASSERT_EQ(buf.length, 5); diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c index 566f6397b37..b878887f589 100644 --- a/test/core/surface/public_headers_must_be_c89.c +++ b/test/core/surface/public_headers_must_be_c89.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc index 936c338b1ad..c23a684b94e 100644 --- a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc +++ b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc @@ -43,9 +43,9 @@ bool grpc_gcp_handshaker_resp_set_peer_rpc_versions( grpc_gcp_HandshakerReq* grpc_gcp_handshaker_req_decode(grpc_slice slice, upb_Arena* arena) { - size_t buf_size = GRPC_SLICE_LENGTH(slice); + size_t buf_size = GPR_SLICE_LENGTH(slice); void* buf = upb_Arena_Malloc(arena, buf_size); - memcpy(buf, reinterpret_cast(GRPC_SLICE_START_PTR(slice)), + memcpy(buf, reinterpret_cast(GPR_SLICE_START_PTR(slice)), buf_size); grpc_gcp_HandshakerReq* resp = grpc_gcp_HandshakerReq_parse( reinterpret_cast(buf), buf_size, arena); diff --git a/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc b/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc index fc3b36bc6ff..e443cba672a 100644 --- a/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc +++ b/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc @@ -225,7 +225,7 @@ static grpc_byte_buffer* generate_handshaker_response( } size_t buf_len; char* buf = grpc_gcp_HandshakerResp_serialize(resp, arena.ptr(), &buf_len); - grpc_slice slice = grpc_slice_from_copied_buffer(buf, buf_len); + grpc_slice slice = gpr_slice_from_copied_buffer(buf, buf_len); if (type == INVALID) { grpc_slice bad_slice = grpc_slice_split_head(&slice, GRPC_SLICE_LENGTH(slice) - 1); diff --git a/test/core/util/fuzzer_corpus_test.cc b/test/core/util/fuzzer_corpus_test.cc index b3d4609fc37..73ce3e3c532 100644 --- a/test/core/util/fuzzer_corpus_test.cc +++ b/test/core/util/fuzzer_corpus_test.cc @@ -62,7 +62,7 @@ TEST_P(FuzzerCorpusTest, RunOneExample) { size_t length = GRPC_SLICE_LENGTH(buffer); void* data = gpr_malloc(length); if (length > 0) { - memcpy(data, GRPC_SLICE_START_PTR(buffer), length); + memcpy(data, GPR_SLICE_START_PTR(buffer), length); } grpc_slice_unref(buffer); LLVMFuzzerTestOneInput(static_cast(data), length); diff --git a/test/core/util/passthru_endpoint.cc b/test/core/util/passthru_endpoint.cc index 7fde1a56efc..4fdd8b9bde6 100644 --- a/test/core/util/passthru_endpoint.cc +++ b/test/core/util/passthru_endpoint.cc @@ -207,7 +207,7 @@ static void do_pending_write_op_locked(half* m, grpc_error_handle error) { other->on_read != nullptr ? other->on_read_out : &other->read_buffer; while (max_writable > 0) { grpc_slice slice = grpc_slice_buffer_take_first(slices); - uint64_t slice_length = GRPC_SLICE_LENGTH(slice); + uint64_t slice_length = GPR_SLICE_LENGTH(slice); GPR_ASSERT(slice_length > 0); grpc_slice split1, split2; uint64_t split_length = 0; @@ -230,7 +230,7 @@ static void do_pending_write_op_locked(half* m, grpc_error_handle error) { // Write a copy of the slice to the destination to be read grpc_slice_buffer_add_indexed(dest, split1); // Re-insert split2 into source for next iteration. - if (GRPC_SLICE_LENGTH(split2) > 0) { + if (GPR_SLICE_LENGTH(split2) > 0) { grpc_slice_buffer_undo_take_first(slices, split2); } else { grpc_slice_unref(split2); @@ -277,7 +277,7 @@ static void me_write(grpc_endpoint* ep, grpc_slice_buffer* slices, m->pending_write_op.slices = &m->write_buffer; GPR_ASSERT(m->pending_write_op.slices->count == 0); for (int i = 0; i < static_cast(slices->count); i++) { - if (GRPC_SLICE_LENGTH(slices->slices[i]) > 0) { + if (GPR_SLICE_LENGTH(slices->slices[i]) > 0) { grpc_slice_buffer_add_indexed(m->pending_write_op.slices, grpc_slice_copy(slices->slices[i])); } diff --git a/test/cpp/util/cli_call.cc b/test/cpp/util/cli_call.cc index b6f16fad1dd..9f8f1c99369 100644 --- a/test/cpp/util/cli_call.cc +++ b/test/cpp/util/cli_call.cc @@ -91,7 +91,7 @@ void CliCall::Write(const std::string& request) { void* got_tag; bool ok; - grpc_slice s = grpc_slice_from_copied_buffer(request.data(), request.size()); + gpr_slice s = gpr_slice_from_copied_buffer(request.data(), request.size()); grpc::Slice req_slice(s, grpc::Slice::STEAL_REF); grpc::ByteBuffer send_buffer(&req_slice, 1); call_->Write(send_buffer, tag(2)); diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index cf0d48f81b9..b16d94a9a98 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -903,6 +903,7 @@ include/grpc/impl/codegen/byte_buffer_reader.h \ include/grpc/impl/codegen/compression_types.h \ include/grpc/impl/codegen/connectivity_state.h \ include/grpc/impl/codegen/fork.h \ +include/grpc/impl/codegen/gpr_slice.h \ include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/grpc_types.h \ include/grpc/impl/codegen/log.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index ab2875a2df7..4f9608eccce 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -903,6 +903,7 @@ include/grpc/impl/codegen/byte_buffer_reader.h \ include/grpc/impl/codegen/compression_types.h \ include/grpc/impl/codegen/connectivity_state.h \ include/grpc/impl/codegen/fork.h \ +include/grpc/impl/codegen/gpr_slice.h \ include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/grpc_types.h \ include/grpc/impl/codegen/log.h \ diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index 12943922b28..0ff22348db0 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -833,6 +833,7 @@ include/grpc/impl/codegen/byte_buffer_reader.h \ include/grpc/impl/codegen/compression_types.h \ include/grpc/impl/codegen/connectivity_state.h \ include/grpc/impl/codegen/fork.h \ +include/grpc/impl/codegen/gpr_slice.h \ include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/grpc_types.h \ include/grpc/impl/codegen/log.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 1ad80f6db14..dfc07b57004 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -833,6 +833,7 @@ include/grpc/impl/codegen/byte_buffer_reader.h \ include/grpc/impl/codegen/compression_types.h \ include/grpc/impl/codegen/connectivity_state.h \ include/grpc/impl/codegen/fork.h \ +include/grpc/impl/codegen/gpr_slice.h \ include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/grpc_types.h \ include/grpc/impl/codegen/log.h \