1 //
2 //
3 // Copyright 2016 gRPC authors.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 //
18
19 // This file has empty implementation of all the functions exposed by the cronet
20 // library, so we can build it in all environments
21
22 #include <grpc/support/port_platform.h>
23
24 #include "absl/log/check.h"
25 #include "third_party/objective_c/Cronet/bidirectional_stream_c.h"
26
27 #ifdef GRPC_COMPILE_WITH_CRONET
28 // link with the real CRONET library in the build system
29 #else
30 // Phony implementation of cronet API just to test for build-ability
bidirectional_stream_create(stream_engine *,void *,bidirectional_stream_callback *)31 bidirectional_stream* bidirectional_stream_create(
32 stream_engine* /*engine*/, void* /*annotation*/,
33 bidirectional_stream_callback* /*callback*/) {
34 CHECK(0);
35 return nullptr;
36 }
37
bidirectional_stream_destroy(bidirectional_stream *)38 int bidirectional_stream_destroy(bidirectional_stream* /*stream*/) {
39 CHECK(0);
40 return 0;
41 }
42
bidirectional_stream_start(bidirectional_stream *,const char *,int,const char *,const bidirectional_stream_header_array *,bool)43 int bidirectional_stream_start(
44 bidirectional_stream* /*stream*/, const char* /*url*/, int /*priority*/,
45 const char* /*method*/,
46 const bidirectional_stream_header_array* /*headers*/,
47 bool /*end_of_stream*/) {
48 CHECK(0);
49 return 0;
50 }
51
bidirectional_stream_read(bidirectional_stream *,char *,int)52 int bidirectional_stream_read(bidirectional_stream* /*stream*/,
53 char* /*buffer*/, int /*capacity*/) {
54 CHECK(0);
55 return 0;
56 }
57
bidirectional_stream_write(bidirectional_stream *,const char *,int,bool)58 int bidirectional_stream_write(bidirectional_stream* /*stream*/,
59 const char* /*buffer*/, int /*count*/,
60 bool /*end_of_stream*/) {
61 CHECK(0);
62 return 0;
63 }
64
bidirectional_stream_cancel(bidirectional_stream *)65 void bidirectional_stream_cancel(bidirectional_stream* /*stream*/) { CHECK(0); }
66
bidirectional_stream_disable_auto_flush(bidirectional_stream *,bool)67 void bidirectional_stream_disable_auto_flush(bidirectional_stream* /*stream*/,
68 bool /*disable_auto_flush*/) {
69 CHECK(0);
70 }
71
bidirectional_stream_delay_request_headers_until_flush(bidirectional_stream *,bool)72 void bidirectional_stream_delay_request_headers_until_flush(
73 bidirectional_stream* /*stream*/, bool /*delay_headers_until_flush*/) {
74 CHECK(0);
75 }
76
bidirectional_stream_flush(bidirectional_stream *)77 void bidirectional_stream_flush(bidirectional_stream* /*stream*/) { CHECK(0); }
78
79 #endif // GRPC_COMPILE_WITH_CRONET
80