| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
| 6 | 6 |
| 7 #include "bidirectional_stream_c.h" | 7 #include "cronet_c_for_grpc.h" |
| 8 | 8 |
| 9 // A block, that takes a request, and returns YES if the request should | 9 // A block, that takes a request, and returns YES if the request should |
| 10 // be handled. | 10 // be handled. |
| 11 typedef BOOL (^RequestFilterBlock)(NSURLRequest* request); | 11 typedef BOOL (^RequestFilterBlock)(NSURLRequest* request); |
| 12 | 12 |
| 13 // Interface for installing Cronet. | 13 // Interface for installing Cronet. |
| 14 // TODO(gcasto): Should this macro be separate from the one defined in | 14 CRONET_EXPORT |
| 15 // bidirectional_stream_c.h? | |
| 16 GRPC_SUPPORT_EXPORT | |
| 17 @interface Cronet : NSObject | 15 @interface Cronet : NSObject |
| 18 | 16 |
| 19 // Sets whether HTTP/2 should be supported by CronetEngine. This method only has | 17 // Sets whether HTTP/2 should be supported by CronetEngine. This method only has |
| 20 // any effect before |start| is called. | 18 // any effect before |start| is called. |
| 21 + (void)setHttp2Enabled:(BOOL)http2Enabled; | 19 + (void)setHttp2Enabled:(BOOL)http2Enabled; |
| 22 | 20 |
| 23 // Sets whether QUIC should be supported by CronetEngine. This method only has | 21 // Sets whether QUIC should be supported by CronetEngine. This method only has |
| 24 // any effect before |start| is called. | 22 // any effect before |start| is called. |
| 25 + (void)setQuicEnabled:(BOOL)quicEnabled; | 23 + (void)setQuicEnabled:(BOOL)quicEnabled; |
| 26 | 24 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 82 |
| 85 // Stop net-internals logging and flush file to disk. If a logging session is | 83 // Stop net-internals logging and flush file to disk. If a logging session is |
| 86 // not in progress this call is ignored. | 84 // not in progress this call is ignored. |
| 87 + (void)stopNetLog; | 85 + (void)stopNetLog; |
| 88 | 86 |
| 89 // Returns the full user-agent that the stack uses. | 87 // Returns the full user-agent that the stack uses. |
| 90 // This is the exact string servers will see. | 88 // This is the exact string servers will see. |
| 91 + (NSString*)getUserAgent; | 89 + (NSString*)getUserAgent; |
| 92 | 90 |
| 93 // Get a pointer to global instance of cronet_engine for GRPC C API. | 91 // Get a pointer to global instance of cronet_engine for GRPC C API. |
| 94 + (stream_engine*)getGlobalEngine; | 92 + (cronet_engine*)getGlobalEngine; |
| 95 | 93 |
| 96 // Returns differences in metrics collected by Cronet since the last call to | 94 // Returns differences in metrics collected by Cronet since the last call to |
| 97 // getGlobalMetricsDeltas, serialized as a [protobuf] | 95 // getGlobalMetricsDeltas, serialized as a [protobuf] |
| 98 // (https://developers.google.com/protocol-buffers). | 96 // (https://developers.google.com/protocol-buffers). |
| 99 // | 97 // |
| 100 // Cronet starts collecting these metrics after the first call to | 98 // Cronet starts collecting these metrics after the first call to |
| 101 // getGlobalMetricsDeltras, so the first call returns no | 99 // getGlobalMetricsDeltras, so the first call returns no |
| 102 // useful data as no metrics have yet been collected. | 100 // useful data as no metrics have yet been collected. |
| 103 + (NSData*)getGlobalMetricsDeltas; | 101 + (NSData*)getGlobalMetricsDeltas; |
| 104 | 102 |
| 105 // Sets Host Resolver Rules for testing. | 103 // Sets Host Resolver Rules for testing. |
| 106 // This method must be called after |start| has been called. | 104 // This method only has any effect before |start| is called. |
| 107 + (void)setHostResolverRulesForTesting:(NSString*)hostResolverRulesForTesting; | 105 + (void)setHostResolverRulesForTesting:(NSString*)hostResolverRulesForTesting; |
| 108 | 106 |
| 109 // Enables TestCertVerifier which accepts all certificates for testing. | 107 // Enables TestCertVerifier which accepts all certificates for testing. |
| 110 // This method only has any effect before |start| is called. | 108 // This method only has any effect before |start| is called. |
| 111 + (void)enableTestCertVerifierForTesting; | 109 + (void)enableTestCertVerifierForTesting; |
| 112 | 110 |
| 113 @end | 111 @end |
| OLD | NEW |