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

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

Issue 2733253002: [Cronet] Don't claim support of UrlRequests with data URL scheme. (Closed)
Patch Set: Created 3 years, 9 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 | components/cronet/ios/test/cronet_http_test.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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | components/cronet/ios/test/cronet_http_test.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698