Commit cc58c0d6 authored by kapishnikov's avatar kapishnikov Committed by Commit bot

Export only Cronet API symbols and hide all others.

BUG=601972

Review URL: https://codereview.chromium.org/1915683002

Cr-Commit-Position: refs/heads/master@{#389874}
parent 0da498c0
...@@ -773,6 +773,7 @@ ...@@ -773,6 +773,7 @@
'-fdata-sections', '-fdata-sections',
'-ffunction-sections', '-ffunction-sections',
'-fno-rtti', '-fno-rtti',
'-fvisibility=hidden'
'-fvisibility-inlines-hidden', '-fvisibility-inlines-hidden',
'-Wno-sign-promo', '-Wno-sign-promo',
'-Wno-missing-field-initializers', '-Wno-missing-field-initializers',
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "cronet_c_for_grpc.h" #include "cronet_c_for_grpc.h"
// Interface for installing Cronet. // Interface for installing Cronet.
CRONET_EXPORT
@interface Cronet : NSObject @interface Cronet : NSObject
// Sets whether HTTP/2 should be supported by CronetEngine. This method only has // Sets whether HTTP/2 should be supported by CronetEngine. This method only has
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef COMPONENTS_CRONET_IOS_CRONET_C_FOR_GRPC_H_ #ifndef COMPONENTS_CRONET_IOS_CRONET_C_FOR_GRPC_H_
#define COMPONENTS_CRONET_IOS_CRONET_C_FOR_GRPC_H_ #define COMPONENTS_CRONET_IOS_CRONET_C_FOR_GRPC_H_
#define CRONET_EXPORT __attribute__((visibility("default")))
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -127,6 +129,7 @@ typedef struct cronet_bidirectional_stream_callback { ...@@ -127,6 +129,7 @@ typedef struct cronet_bidirectional_stream_callback {
* *
* Both |calback| and |engine| must remain valid until stream is destroyed. * Both |calback| and |engine| must remain valid until stream is destroyed.
*/ */
CRONET_EXPORT
cronet_bidirectional_stream* cronet_bidirectional_stream_create( cronet_bidirectional_stream* cronet_bidirectional_stream_create(
cronet_engine* engine, cronet_engine* engine,
void* annotation, void* annotation,
...@@ -138,6 +141,7 @@ cronet_bidirectional_stream* cronet_bidirectional_stream_create( ...@@ -138,6 +141,7 @@ cronet_bidirectional_stream* cronet_bidirectional_stream_create(
* network thread, but is posted, so |stream| is valid until calling task is * network thread, but is posted, so |stream| is valid until calling task is
* complete. * complete.
*/ */
CRONET_EXPORT
int cronet_bidirectional_stream_destroy(cronet_bidirectional_stream* stream); int cronet_bidirectional_stream_destroy(cronet_bidirectional_stream* stream);
/* Start the stream by sending request to |url| using |method| and |headers|. If /* Start the stream by sending request to |url| using |method| and |headers|. If
...@@ -145,6 +149,7 @@ int cronet_bidirectional_stream_destroy(cronet_bidirectional_stream* stream); ...@@ -145,6 +149,7 @@ int cronet_bidirectional_stream_destroy(cronet_bidirectional_stream* stream);
* is HTTP verb, with PUT having a special meaning to mark idempotent request, * is HTTP verb, with PUT having a special meaning to mark idempotent request,
* which could use QUIC 0-RTT. * which could use QUIC 0-RTT.
*/ */
CRONET_EXPORT
int cronet_bidirectional_stream_start( int cronet_bidirectional_stream_start(
cronet_bidirectional_stream* stream, cronet_bidirectional_stream* stream,
const char* url, const char* url,
...@@ -162,6 +167,7 @@ int cronet_bidirectional_stream_start( ...@@ -162,6 +167,7 @@ int cronet_bidirectional_stream_start(
* there's an error. The callback's on_succeeded() method is also invoked if * there's an error. The callback's on_succeeded() method is also invoked if
* there is no more data to read and |end_of_stream| was previously sent. * there is no more data to read and |end_of_stream| was previously sent.
*/ */
CRONET_EXPORT
int cronet_bidirectional_stream_read(cronet_bidirectional_stream* stream, int cronet_bidirectional_stream_read(cronet_bidirectional_stream* stream,
char* buffer, char* buffer,
int capacity); int capacity);
...@@ -175,6 +181,7 @@ int cronet_bidirectional_stream_read(cronet_bidirectional_stream* stream, ...@@ -175,6 +181,7 @@ int cronet_bidirectional_stream_read(cronet_bidirectional_stream* stream,
* The callback's on_succeeded() method is also invoked if |end_of_stream| is * The callback's on_succeeded() method is also invoked if |end_of_stream| is
* set and all response data has been read. * set and all response data has been read.
*/ */
CRONET_EXPORT
int cronet_bidirectional_stream_write(cronet_bidirectional_stream* stream, int cronet_bidirectional_stream_write(cronet_bidirectional_stream* stream,
const char* buffer, const char* buffer,
int buffer_length, int buffer_length,
...@@ -189,12 +196,14 @@ int cronet_bidirectional_stream_write(cronet_bidirectional_stream* stream, ...@@ -189,12 +196,14 @@ int cronet_bidirectional_stream_write(cronet_bidirectional_stream* stream,
* be invoked. At most one callback method may be invoked after * be invoked. At most one callback method may be invoked after
* cronet_bidirectional_stream_cancel() has completed. * cronet_bidirectional_stream_cancel() has completed.
*/ */
CRONET_EXPORT
int cronet_bidirectional_stream_cancel(cronet_bidirectional_stream* stream); int cronet_bidirectional_stream_cancel(cronet_bidirectional_stream* stream);
/* Returns true if the |stream| was successfully started and is now done /* Returns true if the |stream| was successfully started and is now done
* (succeeded, canceled, or failed). * (succeeded, canceled, or failed).
* Returns false if the |stream| stream is not yet started or is in progress. * Returns false if the |stream| stream is not yet started or is in progress.
*/ */
CRONET_EXPORT
bool cronet_bidirectional_stream_is_done(cronet_bidirectional_stream* stream); bool cronet_bidirectional_stream_is_done(cronet_bidirectional_stream* stream);
#ifdef __cplusplus #ifdef __cplusplus
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment