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

Unified Diff: components/cronet/ios/Cronet.mm

Issue 2644583002: Add configuration functions for HTTP cache type to Obj-C and C++ (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/cronet/ios/Cronet.mm
diff --git a/components/cronet/ios/Cronet.mm b/components/cronet/ios/Cronet.mm
index 09b3c53b60f21dd13b510ea559f75abd1f0ecb15..19ecd0d76ea88a55911cc779064fdc53df78df63 100644
--- a/components/cronet/ios/Cronet.mm
+++ b/components/cronet/ios/Cronet.mm
@@ -33,6 +33,7 @@ base::LazyInstance<std::unique_ptr<cronet::CronetEnvironment>>::Leaky
BOOL gHttp2Enabled = YES;
BOOL gQuicEnabled = NO;
+HttpCacheType gHttpCache = HttpCacheType::DISK;
ScopedVector<cronet::URLRequestContextConfig::QuicHint> gQuicHints;
NSString* gUserAgent = nil;
BOOL gUserAgentPartial = NO;
@@ -159,6 +160,11 @@ class CronetHttpProtocolHandlerDelegate
gSslKeyLogFileName = sslKeyLogFileName;
}
++ (void)setHttpCacheType:(HttpCacheType)httpCache {
+ [self checkNotStarted];
+ gHttpCache = httpCache;
mef 2017/01/18 22:39:51 I think this is a good place to map from ObjC to H
lilyhoughton 2017/01/19 16:17:15 Done; there may be a more robust way to map the Ob
+}
+
+ (void)setRequestFilterBlock:(RequestFilterBlock)block {
if (gHttpProtocolHandlerDelegate.get())
gHttpProtocolHandlerDelegate.get()->SetRequestFilterBlock(block);
@@ -176,6 +182,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) {

Powered by Google App Engine
This is Rietveld 408576698