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

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

Issue 2668353003: [Cronet] make HttpCacheType enum more comfortative to Obj-C style. (Closed)
Patch Set: Created 3 years, 10 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
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 [self checkNotStarted]; 154 [self checkNotStarted];
155 gUserAgent = userAgent; 155 gUserAgent = userAgent;
156 gUserAgentPartial = partial; 156 gUserAgentPartial = partial;
157 } 157 }
158 158
159 + (void)setSslKeyLogFileName:(NSString*)sslKeyLogFileName { 159 + (void)setSslKeyLogFileName:(NSString*)sslKeyLogFileName {
160 [self checkNotStarted]; 160 [self checkNotStarted];
161 gSslKeyLogFileName = sslKeyLogFileName; 161 gSslKeyLogFileName = sslKeyLogFileName;
162 } 162 }
163 163
164 + (void)setHttpCacheType:(HttpCacheType)httpCacheType { 164 + (void)setHttpCacheType:(CRNHttpCacheType)httpCacheType {
165 [self checkNotStarted]; 165 [self checkNotStarted];
166 switch (httpCacheType) { 166 switch (httpCacheType) {
167 case DISABLED: 167 case CRNHttpCacheTypeDisabled:
168 gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::DISABLED; 168 gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::DISABLED;
169 break; 169 break;
170 case DISK: 170 case CRNHttpCacheTypeDisk:
171 gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::DISK; 171 gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::DISK;
172 break; 172 break;
173 case MEMORY: 173 case CRNHttpCacheTypeMemory:
174 gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::MEMORY; 174 gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::MEMORY;
175 break; 175 break;
176 default: 176 default:
177 DCHECK(NO) << "Invalid HTTP cache type: " << httpCacheType; 177 DCHECK(NO) << "Invalid HTTP cache type: " << httpCacheType;
178 } 178 }
179 } 179 }
180 180
181 + (void)setRequestFilterBlock:(RequestFilterBlock)block { 181 + (void)setRequestFilterBlock:(RequestFilterBlock)block {
182 if (gHttpProtocolHandlerDelegate.get()) 182 if (gHttpProtocolHandlerDelegate.get())
183 gHttpProtocolHandlerDelegate.get()->SetRequestFilterBlock(block); 183 gHttpProtocolHandlerDelegate.get()->SetRequestFilterBlock(block);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 base::SysNSStringToUTF8(hostResolverRulesForTesting)); 310 base::SysNSStringToUTF8(hostResolverRulesForTesting));
311 } 311 }
312 312
313 // This is a non-public dummy method that prevents the linker from stripping out 313 // This is a non-public dummy method that prevents the linker from stripping out
314 // the otherwise non-referenced methods from 'bidirectional_stream.cc'. 314 // the otherwise non-referenced methods from 'bidirectional_stream.cc'.
315 + (void)preventStrippingCronetBidirectionalStream { 315 + (void)preventStrippingCronetBidirectionalStream {
316 bidirectional_stream_create(NULL, 0, 0); 316 bidirectional_stream_create(NULL, 0, 0);
317 } 317 }
318 318
319 @end 319 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698