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

Unified Diff: ios/crnet/crnet_environment.mm

Issue 1142383006: CrNet: add pauseable NSURLProtocol and switch to using it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: main.m -> main.mm & format Created 5 years, 6 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
« no previous file with comments | « ios/crnet/crnet_consumer/main.mm ('k') | ios/net/crn_http_protocol_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/crnet/crnet_environment.mm
diff --git a/ios/crnet/crnet_environment.mm b/ios/crnet/crnet_environment.mm
index d6623107ced000ce1a0a8f512dafd72790d24e26..234f389edfa2d2dc0dbdd6ea2351879d98988857 100644
--- a/ios/crnet/crnet_environment.mm
+++ b/ios/crnet/crnet_environment.mm
@@ -286,7 +286,7 @@ void CrNetEnvironment::Install() {
void CrNetEnvironment::InstallIntoSessionConfiguration(
NSURLSessionConfiguration* config) {
- config.protocolClasses = @[ [CRNHTTPProtocolHandler class] ];
+ config.protocolClasses = @[ [CRNPauseableHTTPProtocolHandler class] ];
}
CrNetEnvironment::~CrNetEnvironment() {
@@ -303,14 +303,15 @@ void CrNetEnvironment::SetHTTPProtocolHandlerRegistered(bool registered) {
// Disable the default cache.
[NSURLCache setSharedURLCache:[EmptyNSURLCache emptyNSURLCache]];
// Register the chrome http protocol handler to replace the default one.
- BOOL success = [NSURLProtocol registerClass:[CRNHTTPProtocolHandler class]];
+ BOOL success =
+ [NSURLProtocol registerClass:[CRNPauseableHTTPProtocolHandler class]];
DCHECK(success);
} else {
// Set up an empty default cache, with default size.
// TODO(droger): If the NSURLCache is to be used, its size should most
// likely be changed. On an iPod2 with iOS4, the default size is 512k.
[NSURLCache setSharedURLCache:[[[NSURLCache alloc] init] autorelease]];
- [NSURLProtocol unregisterClass:[CRNHTTPProtocolHandler class]];
+ [NSURLProtocol unregisterClass:[CRNPauseableHTTPProtocolHandler class]];
}
}
« no previous file with comments | « ios/crnet/crnet_consumer/main.mm ('k') | ios/net/crn_http_protocol_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698