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

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

Issue 2856693002: Cronet iOS: Delete CRNPauseableHTTPProtocolHandler (Closed)
Patch Set: Created 3 years, 7 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 | ios/crnet/crnet_environment.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 "components/cronet/ios/Cronet.h" 5 #import "components/cronet/ios/Cronet.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 253 }
254 254
255 + (void)registerHttpProtocolHandler { 255 + (void)registerHttpProtocolHandler {
256 if (gPreservedSharedURLCache == nil) { 256 if (gPreservedSharedURLCache == nil) {
257 gPreservedSharedURLCache = [NSURLCache sharedURLCache]; 257 gPreservedSharedURLCache = [NSURLCache sharedURLCache];
258 } 258 }
259 // Disable the default cache. 259 // Disable the default cache.
260 [NSURLCache setSharedURLCache:[EmptyNSURLCache emptyNSURLCache]]; 260 [NSURLCache setSharedURLCache:[EmptyNSURLCache emptyNSURLCache]];
261 // Register the chrome http protocol handler to replace the default one. 261 // Register the chrome http protocol handler to replace the default one.
262 BOOL success = 262 BOOL success =
263 [NSURLProtocol registerClass:[CRNPauseableHTTPProtocolHandler class]]; 263 [NSURLProtocol registerClass:[CRNHTTPProtocolHandler class]];
264 DCHECK(success); 264 DCHECK(success);
265 } 265 }
266 266
267 + (void)unregisterHttpProtocolHandler { 267 + (void)unregisterHttpProtocolHandler {
268 // Set up SharedURLCache preserved in registerHttpProtocolHandler. 268 // Set up SharedURLCache preserved in registerHttpProtocolHandler.
269 if (gPreservedSharedURLCache != nil) { 269 if (gPreservedSharedURLCache != nil) {
270 [NSURLCache setSharedURLCache:gPreservedSharedURLCache]; 270 [NSURLCache setSharedURLCache:gPreservedSharedURLCache];
271 gPreservedSharedURLCache = nil; 271 gPreservedSharedURLCache = nil;
272 } 272 }
273 [NSURLProtocol unregisterClass:[CRNPauseableHTTPProtocolHandler class]]; 273 [NSURLProtocol unregisterClass:[CRNHTTPProtocolHandler class]];
274 } 274 }
275 275
276 + (void)installIntoSessionConfiguration:(NSURLSessionConfiguration*)config { 276 + (void)installIntoSessionConfiguration:(NSURLSessionConfiguration*)config {
277 config.protocolClasses = @[ [CRNPauseableHTTPProtocolHandler class] ]; 277 config.protocolClasses = @[ [CRNHTTPProtocolHandler class] ];
278 } 278 }
279 279
280 + (NSString*)getNetLogPathForFile:(NSString*)fileName { 280 + (NSString*)getNetLogPathForFile:(NSString*)fileName {
281 return [[[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory 281 return [[[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory
282 inDomains:NSUserDomainMask] 282 inDomains:NSUserDomainMask]
283 lastObject] URLByAppendingPathComponent:fileName] path]; 283 lastObject] URLByAppendingPathComponent:fileName] path];
284 } 284 }
285 285
286 + (BOOL)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes { 286 + (BOOL)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes {
287 if (gChromeNet.Get().get() && [fileName length] && 287 if (gChromeNet.Get().get() && [fileName length] &&
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 base::SysNSStringToUTF8(hostResolverRulesForTesting)); 337 base::SysNSStringToUTF8(hostResolverRulesForTesting));
338 } 338 }
339 339
340 // This is a non-public dummy method that prevents the linker from stripping out 340 // This is a non-public dummy method that prevents the linker from stripping out
341 // the otherwise non-referenced methods from 'bidirectional_stream.cc'. 341 // the otherwise non-referenced methods from 'bidirectional_stream.cc'.
342 + (void)preventStrippingCronetBidirectionalStream { 342 + (void)preventStrippingCronetBidirectionalStream {
343 bidirectional_stream_create(NULL, 0, 0); 343 bidirectional_stream_create(NULL, 0, 0);
344 } 344 }
345 345
346 @end 346 @end
OLDNEW
« no previous file with comments | « no previous file | ios/crnet/crnet_environment.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698