Chromium Code Reviews| 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 "bidirectional_stream_c.h" |
| 8 #include "components/cronet/url_request_context_config.h" | |
|
mef
2017/01/18 22:39:51
Cronet.h is public header, distributed with Cronet
lilyhoughton
2017/01/19 16:17:15
Done.
| |
| 8 | 9 |
| 9 // TODO(mef): Remove this header after transition to bidirectional_stream_c.h | 10 // TODO(mef): Remove this header after transition to bidirectional_stream_c.h |
| 10 // See crbug.com/650462 for details. | 11 // See crbug.com/650462 for details. |
| 11 #include "cronet_c_for_grpc.h" | 12 #include "cronet_c_for_grpc.h" |
| 12 | 13 |
| 14 typedef cronet::URLRequestContextConfig::HttpCacheType HttpCacheType; | |
| 15 | |
| 13 // A block, that takes a request, and returns YES if the request should | 16 // A block, that takes a request, and returns YES if the request should |
| 14 // be handled. | 17 // be handled. |
| 15 typedef BOOL (^RequestFilterBlock)(NSURLRequest* request); | 18 typedef BOOL (^RequestFilterBlock)(NSURLRequest* request); |
| 16 | 19 |
| 17 // Interface for installing Cronet. | 20 // Interface for installing Cronet. |
| 18 // TODO(gcasto): Should this macro be separate from the one defined in | 21 // TODO(gcasto): Should this macro be separate from the one defined in |
| 19 // bidirectional_stream_c.h? | 22 // bidirectional_stream_c.h? |
| 20 GRPC_SUPPORT_EXPORT | 23 GRPC_SUPPORT_EXPORT |
| 21 @interface Cronet : NSObject | 24 @interface Cronet : NSObject |
| 22 | 25 |
| 23 // Sets whether HTTP/2 should be supported by CronetEngine. This method only has | 26 // Sets whether HTTP/2 should be supported by CronetEngine. This method only has |
| 24 // any effect before |start| is called. | 27 // any effect before |start| is called. |
| 25 + (void)setHttp2Enabled:(BOOL)http2Enabled; | 28 + (void)setHttp2Enabled:(BOOL)http2Enabled; |
| 26 | 29 |
| 27 // Sets whether QUIC should be supported by CronetEngine. This method only has | 30 // Sets whether QUIC should be supported by CronetEngine. This method only has |
| 28 // any effect before |start| is called. | 31 // any effect before |start| is called. |
| 29 + (void)setQuicEnabled:(BOOL)quicEnabled; | 32 + (void)setQuicEnabled:(BOOL)quicEnabled; |
| 30 | 33 |
| 34 // Set HTTP Cache type to be used by CronetEngine. This method only has any | |
|
mef
2017/01/18 22:39:51
nit: remove extra space. Provide more elaborate co
lilyhoughton
2017/01/19 16:17:15
Done.
| |
| 35 // effect before |start| is called. | |
| 36 + (void)setHttpCacheType:(HttpCacheType)http_cache; | |
| 37 | |
| 31 // Adds hint that host supports QUIC on altPort. This method only has any effect | 38 // Adds hint that host supports QUIC on altPort. This method only has any effect |
| 32 // before |start| is called. | 39 // before |start| is called. |
| 33 + (void)addQuicHint:(NSString*)host port:(int)port altPort:(int)altPort; | 40 + (void)addQuicHint:(NSString*)host port:(int)port altPort:(int)altPort; |
| 34 | 41 |
| 35 // Sets the User-Agent request header string to be sent with all requests. | 42 // Sets the User-Agent request header string to be sent with all requests. |
| 36 // If |partial| is set to YES, then actual user agent value is based on device | 43 // If |partial| is set to YES, then actual user agent value is based on device |
| 37 // model, OS version, and |userAgent| argument. For example "Foo/3.0.0.0" is | 44 // model, OS version, and |userAgent| argument. For example "Foo/3.0.0.0" is |
| 38 // sent as "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3 like Mac OS X) | 45 // sent as "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3 like Mac OS X) |
| 39 // AppleWebKit/601.1 (KHTML, like Gecko) Foo/3.0.0.0 Mobile/15G31 | 46 // AppleWebKit/601.1 (KHTML, like Gecko) Foo/3.0.0.0 Mobile/15G31 |
| 40 // Safari/601.1.46". | 47 // Safari/601.1.46". |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 | 119 |
| 113 // Sets Host Resolver Rules for testing. | 120 // Sets Host Resolver Rules for testing. |
| 114 // This method must be called after |start| has been called. | 121 // This method must be called after |start| has been called. |
| 115 + (void)setHostResolverRulesForTesting:(NSString*)hostResolverRulesForTesting; | 122 + (void)setHostResolverRulesForTesting:(NSString*)hostResolverRulesForTesting; |
| 116 | 123 |
| 117 // Enables TestCertVerifier which accepts all certificates for testing. | 124 // Enables TestCertVerifier which accepts all certificates for testing. |
| 118 // This method only has any effect before |start| is called. | 125 // This method only has any effect before |start| is called. |
| 119 + (void)enableTestCertVerifierForTesting; | 126 + (void)enableTestCertVerifierForTesting; |
| 120 | 127 |
| 121 @end | 128 @end |
| OLD | NEW |