summaryrefslogtreecommitdiffstats
path: root/ios/net
diff options
context:
space:
mode:
authorjustincohen <justincohen@chromium.org>2015-06-10 10:38:16 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-10 17:38:49 +0000
commit5a862993ea3a0c7593ac58971015f8122bda7a56 (patch)
treeeb637250741ee5515e1ed3aeb6a0ead6494fb14a /ios/net
parent39825ed5795d26cc69167c1fe774f23117cc8f77 (diff)
downloadchromium_src-5a862993ea3a0c7593ac58971015f8122bda7a56.zip
chromium_src-5a862993ea3a0c7593ac58971015f8122bda7a56.tar.gz
chromium_src-5a862993ea3a0c7593ac58971015f8122bda7a56.tar.bz2
Correct iOS build for latest Xcode beta.
- NSObject's NS_DESIGNATED_INITIALIZER -init method requires an -init NS_UNAVAILABLE implementation. - Correct nonnull API usage. - Cast to NSInteger for comparisons with NSNotFound. - Account for dylib -> tbd change in latest Xcode. BUG=498581, 498825, 498841 Review URL: https://codereview.chromium.org/1171203004 Cr-Commit-Position: refs/heads/master@{#333756}
Diffstat (limited to 'ios/net')
-rw-r--r--ios/net/empty_nsurlcache.h15
-rw-r--r--ios/net/empty_nsurlcache.mm17
-rw-r--r--ios/net/ios_net.gyp2
-rw-r--r--ios/net/request_tracker.mm6
4 files changed, 39 insertions, 1 deletions
diff --git a/ios/net/empty_nsurlcache.h b/ios/net/empty_nsurlcache.h
new file mode 100644
index 0000000..0054e0b
--- /dev/null
+++ b/ios/net/empty_nsurlcache.h
@@ -0,0 +1,15 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_NET_EMPTY_NSURLCACHE_H_
+#define IOS_NET_EMPTY_NSURLCACHE_H_
+
+#import <Foundation/Foundation.h>
+
+// Dummy NSURLCache implementation that does not cache anything.
+@interface EmptyNSURLCache : NSURLCache
++ (instancetype)emptyNSURLCache;
+@end
+
+#endif // IOS_NET_EMPTY_NSURLCACHE_H_
diff --git a/ios/net/empty_nsurlcache.mm b/ios/net/empty_nsurlcache.mm
new file mode 100644
index 0000000..c08826bb
--- /dev/null
+++ b/ios/net/empty_nsurlcache.mm
@@ -0,0 +1,17 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/net/empty_nsurlcache.h"
+
+@implementation EmptyNSURLCache
+
++ (instancetype)emptyNSURLCache {
+ return [[[EmptyNSURLCache alloc] init] autorelease];
+}
+
+- (NSCachedURLResponse*)cachedResponseForRequest:(NSURLRequest*)request {
+ return nil;
+}
+
+@end
diff --git a/ios/net/ios_net.gyp b/ios/net/ios_net.gyp
index bd2e153..b9ad092 100644
--- a/ios/net/ios_net.gyp
+++ b/ios/net/ios_net.gyp
@@ -42,6 +42,8 @@
'crn_http_protocol_handler_proxy_with_client_thread.mm',
'crn_http_url_response.h',
'crn_http_url_response.mm',
+ 'empty_nsurlcache.h',
+ 'empty_nsurlcache.mm',
'http_protocol_logging.h',
'http_protocol_logging.mm',
'http_response_headers_util.h',
diff --git a/ios/net/request_tracker.mm b/ios/net/request_tracker.mm
index 6eb21c3..a4cfa54 100644
--- a/ios/net/request_tracker.mm
+++ b/ios/net/request_tracker.mm
@@ -34,7 +34,11 @@ class GlobalNetworkClientFactories {
// Adds a factory.
void AddFactory(CRNForwardingNetworkClientFactory* factory) {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK_EQ(NSNotFound, [factories_ indexOfObject:factory]);
+ // TODO(justincohen): Cast indexOfObject to work around Xcode beta bugs.
+ // Revisit in future betas where hopefully these types match again.
+ // crbug.com/498825
+ DCHECK_EQ(NSNotFound,
+ static_cast<NSInteger>([factories_ indexOfObject:factory]));
DCHECK(!IsSelectorOverriden(factory, @selector(clientHandlingRequest:)));
DCHECK(!IsSelectorOverriden(factory,
@selector(clientHandlingResponse:request:)));