Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: components/cronet/ios/Cronet.h

Issue 2644583002: Add configuration functions for HTTP cache type to Obj-C and C++ (Closed)
Patch Set: make enum more obj-c-compatible Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/cronet/ios/Cronet.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 8
9 // TODO(mef): Remove this header after transition to bidirectional_stream_c.h 9 // TODO(mef): Remove this header after transition to bidirectional_stream_c.h
10 // See crbug.com/650462 for details. 10 // See crbug.com/650462 for details.
11 #include "cronet_c_for_grpc.h" 11 #include "cronet_c_for_grpc.h"
12 12
13 // Type of HTTP cache; public interface to private implementation defined in
14 // URLRequestContextConfig class.
15 typedef NS_ENUM(NSInteger, CRNHttpCacheType) {
16 // Disabled HTTP cache. Some data may still be temporarily stored in memory.
17 CRNHttpCacheTypeDisabled,
18 // Enable on-disk HTTP cache, including HTTP data.
19 CRNHttpCacheTypeDisk,
20 // Enable in-memory cache, including HTTP data.
21 CRNHttpCacheTypeMemory,
22 };
23
13 // A block, that takes a request, and returns YES if the request should 24 // A block, that takes a request, and returns YES if the request should
14 // be handled. 25 // be handled.
15 typedef BOOL (^RequestFilterBlock)(NSURLRequest* request); 26 typedef BOOL (^RequestFilterBlock)(NSURLRequest* request);
16 27
17 // Interface for installing Cronet. 28 // Interface for installing Cronet.
18 // TODO(gcasto): Should this macro be separate from the one defined in 29 // TODO(gcasto): Should this macro be separate from the one defined in
19 // bidirectional_stream_c.h? 30 // bidirectional_stream_c.h?
20 GRPC_SUPPORT_EXPORT 31 GRPC_SUPPORT_EXPORT
21 @interface Cronet : NSObject 32 @interface Cronet : NSObject
22 33
23 // Sets whether HTTP/2 should be supported by CronetEngine. This method only has 34 // Sets whether HTTP/2 should be supported by CronetEngine. This method only has
24 // any effect before |start| is called. 35 // any effect before |start| is called.
25 + (void)setHttp2Enabled:(BOOL)http2Enabled; 36 + (void)setHttp2Enabled:(BOOL)http2Enabled;
26 37
27 // Sets whether QUIC should be supported by CronetEngine. This method only has 38 // Sets whether QUIC should be supported by CronetEngine. This method only has
28 // any effect before |start| is called. 39 // any effect before |start| is called.
29 + (void)setQuicEnabled:(BOOL)quicEnabled; 40 + (void)setQuicEnabled:(BOOL)quicEnabled;
30 41
42 // Set HTTP Cache type to be used by CronetEngine. This method only has any
43 // effect before |start| is called. See HttpCacheType enum for available
44 // options.
45 + (void)setHttpCacheType:(CRNHttpCacheType)httpCacheType;
46
31 // Adds hint that host supports QUIC on altPort. This method only has any effect 47 // Adds hint that host supports QUIC on altPort. This method only has any effect
32 // before |start| is called. 48 // before |start| is called.
33 + (void)addQuicHint:(NSString*)host port:(int)port altPort:(int)altPort; 49 + (void)addQuicHint:(NSString*)host port:(int)port altPort:(int)altPort;
34 50
35 // Sets the User-Agent request header string to be sent with all requests. 51 // 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 52 // 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 53 // 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) 54 // 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 55 // AppleWebKit/601.1 (KHTML, like Gecko) Foo/3.0.0.0 Mobile/15G31
40 // Safari/601.1.46". 56 // Safari/601.1.46".
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 128
113 // Sets Host Resolver Rules for testing. 129 // Sets Host Resolver Rules for testing.
114 // This method must be called after |start| has been called. 130 // This method must be called after |start| has been called.
115 + (void)setHostResolverRulesForTesting:(NSString*)hostResolverRulesForTesting; 131 + (void)setHostResolverRulesForTesting:(NSString*)hostResolverRulesForTesting;
116 132
117 // Enables TestCertVerifier which accepts all certificates for testing. 133 // Enables TestCertVerifier which accepts all certificates for testing.
118 // This method only has any effect before |start| is called. 134 // This method only has any effect before |start| is called.
119 + (void)enableTestCertVerifierForTesting; 135 + (void)enableTestCertVerifierForTesting;
120 136
121 @end 137 @end
OLDNEW
« no previous file with comments | « no previous file | components/cronet/ios/Cronet.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698