| Index: components/cronet/ios/Cronet.mm
|
| diff --git a/components/cronet/ios/Cronet.mm b/components/cronet/ios/Cronet.mm
|
| index 09b3c53b60f21dd13b510ea559f75abd1f0ecb15..65d5e87ca5bf58408c01958f0187c7fd939e7eb9 100644
|
| --- a/components/cronet/ios/Cronet.mm
|
| +++ b/components/cronet/ios/Cronet.mm
|
| @@ -33,6 +33,8 @@ base::LazyInstance<std::unique_ptr<cronet::CronetEnvironment>>::Leaky
|
|
|
| BOOL gHttp2Enabled = YES;
|
| BOOL gQuicEnabled = NO;
|
| +cronet::URLRequestContextConfig::HttpCacheType gHttpCache =
|
| + cronet::URLRequestContextConfig::HttpCacheType::DISK;
|
| ScopedVector<cronet::URLRequestContextConfig::QuicHint> gQuicHints;
|
| NSString* gUserAgent = nil;
|
| BOOL gUserAgentPartial = NO;
|
| @@ -159,6 +161,23 @@ class CronetHttpProtocolHandlerDelegate
|
| gSslKeyLogFileName = sslKeyLogFileName;
|
| }
|
|
|
| ++ (void)setHttpCacheType:(CRNHttpCacheType)httpCacheType {
|
| + [self checkNotStarted];
|
| + switch (httpCacheType) {
|
| + case CRNHttpCacheTypeDisabled:
|
| + gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::DISABLED;
|
| + break;
|
| + case CRNHttpCacheTypeDisk:
|
| + gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::DISK;
|
| + break;
|
| + case CRNHttpCacheTypeMemory:
|
| + gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::MEMORY;
|
| + break;
|
| + default:
|
| + DCHECK(NO) << "Invalid HTTP cache type: " << httpCacheType;
|
| + }
|
| +}
|
| +
|
| + (void)setRequestFilterBlock:(RequestFilterBlock)block {
|
| if (gHttpProtocolHandlerDelegate.get())
|
| gHttpProtocolHandlerDelegate.get()->SetRequestFilterBlock(block);
|
| @@ -176,6 +195,7 @@ class CronetHttpProtocolHandlerDelegate
|
|
|
| gChromeNet.Get()->set_http2_enabled(gHttp2Enabled);
|
| gChromeNet.Get()->set_quic_enabled(gQuicEnabled);
|
| + gChromeNet.Get()->set_http_cache(gHttpCache);
|
| gChromeNet.Get()->set_ssl_key_log_file_name(
|
| base::SysNSStringToUTF8(gSslKeyLogFileName));
|
| for (const auto* quicHint : gQuicHints) {
|
|
|