| OLD | NEW |
| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 RequestFilterBlock block = filter_.get(); | 84 RequestFilterBlock block = filter_.get(); |
| 85 return block(request); | 85 return block(request); |
| 86 } | 86 } |
| 87 return true; | 87 return true; |
| 88 } | 88 } |
| 89 | 89 |
| 90 bool IsRequestSupported(NSURLRequest* request) override { | 90 bool IsRequestSupported(NSURLRequest* request) override { |
| 91 NSString* scheme = [[request URL] scheme]; | 91 NSString* scheme = [[request URL] scheme]; |
| 92 if (!scheme) | 92 if (!scheme) |
| 93 return false; | 93 return false; |
| 94 return [scheme caseInsensitiveCompare:@"data"] == NSOrderedSame || | 94 return [scheme caseInsensitiveCompare:@"http"] == NSOrderedSame || |
| 95 [scheme caseInsensitiveCompare:@"http"] == NSOrderedSame || | |
| 96 [scheme caseInsensitiveCompare:@"https"] == NSOrderedSame; | 95 [scheme caseInsensitiveCompare:@"https"] == NSOrderedSame; |
| 97 } | 96 } |
| 98 | 97 |
| 99 net::URLRequestContextGetter* GetDefaultURLRequestContext() override { | 98 net::URLRequestContextGetter* GetDefaultURLRequestContext() override { |
| 100 return getter_.get(); | 99 return getter_.get(); |
| 101 } | 100 } |
| 102 | 101 |
| 103 scoped_refptr<net::URLRequestContextGetter> getter_; | 102 scoped_refptr<net::URLRequestContextGetter> getter_; |
| 104 base::mac::ScopedBlock<RequestFilterBlock> filter_; | 103 base::mac::ScopedBlock<RequestFilterBlock> filter_; |
| 105 base::Lock lock_; | 104 base::Lock lock_; |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 base::SysNSStringToUTF8(hostResolverRulesForTesting)); | 327 base::SysNSStringToUTF8(hostResolverRulesForTesting)); |
| 329 } | 328 } |
| 330 | 329 |
| 331 // This is a non-public dummy method that prevents the linker from stripping out | 330 // This is a non-public dummy method that prevents the linker from stripping out |
| 332 // the otherwise non-referenced methods from 'bidirectional_stream.cc'. | 331 // the otherwise non-referenced methods from 'bidirectional_stream.cc'. |
| 333 + (void)preventStrippingCronetBidirectionalStream { | 332 + (void)preventStrippingCronetBidirectionalStream { |
| 334 bidirectional_stream_create(NULL, 0, 0); | 333 bidirectional_stream_create(NULL, 0, 0); |
| 335 } | 334 } |
| 336 | 335 |
| 337 @end | 336 @end |
| OLD | NEW |