OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // A block, that takes a request, and returns YES if the request should | 7 // A block, that takes a request, and returns YES if the request should |
8 // be handled. | 8 // be handled. |
9 typedef BOOL(^RequestFilterBlock)(NSURLRequest *request); | 9 typedef BOOL(^RequestFilterBlock)(NSURLRequest *request); |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... | |
35 // nil, persistence is not enabled. The default is for SDCH to be disabled. | 35 // nil, persistence is not enabled. The default is for SDCH to be disabled. |
36 + (void)setSDCHEnabled:(BOOL)sdchEnabled | 36 + (void)setSDCHEnabled:(BOOL)sdchEnabled |
37 withPrefStore:(NSString *)filename; | 37 withPrefStore:(NSString *)filename; |
38 | 38 |
39 // |userAgent| is expected to be of the form Product/Version. | 39 // |userAgent| is expected to be of the form Product/Version. |
40 // Example: Foo/3.0.0.0 | 40 // Example: Foo/3.0.0.0 |
41 // | 41 // |
42 // This method only has any effect before |install| is called. | 42 // This method only has any effect before |install| is called. |
43 + (void)setPartialUserAgent:(NSString *)userAgent; | 43 + (void)setPartialUserAgent:(NSString *)userAgent; |
44 | 44 |
45 // |userAgent| is expected to be the complete user agent value sent to remote. | |
46 // Example: Foo/3.0.0.0 | |
droger
2016/08/31 08:52:23
This is the same example as setPartialUserAgent ab
mef
2016/08/31 14:49:57
Great suggestion! Done.
| |
47 // | |
48 // This method only has any effect before |install| is called. | |
49 + (void)setUserAgent:(NSString*)userAgent; | |
50 | |
45 // Set the block used to determine whether or not CrNet should handle the | 51 // Set the block used to determine whether or not CrNet should handle the |
46 // request. If this is not set, CrNet will handle all requests. | 52 // request. If this is not set, CrNet will handle all requests. |
47 // Must not be called while requests are in progress. This method can be called | 53 // Must not be called while requests are in progress. This method can be called |
48 // either before or after |install|. | 54 // either before or after |install|. |
49 + (void)setRequestFilterBlock:(RequestFilterBlock)block; | 55 + (void)setRequestFilterBlock:(RequestFilterBlock)block; |
50 | 56 |
51 // Installs CrNet. Once installed, CrNet intercepts and handles all | 57 // Installs CrNet. Once installed, CrNet intercepts and handles all |
52 // NSURLConnection and NSURLRequests issued by the app, including UIWebView page | 58 // NSURLConnection and NSURLRequests issued by the app, including UIWebView page |
53 // loads. It is recommended to call this method on the application main thread. | 59 // loads. It is recommended to call this method on the application main thread. |
54 // If the method is called on any thread other than the main one, the method | 60 // If the method is called on any thread other than the main one, the method |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 | 118 |
113 // Returns the full user-agent that the stack uses. | 119 // Returns the full user-agent that the stack uses. |
114 // This is the exact string servers will see. | 120 // This is the exact string servers will see. |
115 + (NSString *)userAgent; | 121 + (NSString *)userAgent; |
116 | 122 |
117 // Clears CrNet's http cache. The supplied callback, if not nil, is run on an | 123 // Clears CrNet's http cache. The supplied callback, if not nil, is run on an |
118 // unspecified thread. | 124 // unspecified thread. |
119 + (void)clearCacheWithCompletionCallback:(ClearCacheCallback)completionBlock; | 125 + (void)clearCacheWithCompletionCallback:(ClearCacheCallback)completionBlock; |
120 | 126 |
121 @end | 127 @end |
OLD | NEW |