summaryrefslogtreecommitdiffstats
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
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}
-rw-r--r--base/ios/crb_protocol_observers_unittest.mm9
-rw-r--r--ios/chrome/browser/infobars/infobar_controller.h3
-rw-r--r--ios/chrome/browser/infobars/infobar_controller.mm5
-rw-r--r--ios/chrome/browser/translate/before_translate_infobar_controller.mm2
-rw-r--r--ios/chrome/browser/ui/commands/generic_chrome_command.h6
-rw-r--r--ios/chrome/browser/ui/commands/generic_chrome_command.mm5
-rw-r--r--ios/chrome/browser/updatable_config/updatable_config_base.mm10
-rw-r--r--ios/chrome/browser/xcallback_parameters.h2
-rw-r--r--ios/chrome/browser/xcallback_parameters.mm6
-rw-r--r--ios/crnet/crnet_environment.mm3
-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
-rw-r--r--ios/public/test/test_updatable_resource_provider.mm6
-rw-r--r--ios/web/browsing_data_managers/crw_cookie_browsing_data_manager.h2
-rw-r--r--ios/web/browsing_data_managers/crw_cookie_browsing_data_manager.mm5
-rw-r--r--ios/web/crw_browsing_data_store.mm6
-rw-r--r--ios/web/crw_browsing_data_store_unittest.mm6
-rw-r--r--ios/web/net/clients/crw_redirect_network_client.mm10
-rw-r--r--ios/web/net/clients/crw_redirect_network_client_factory.mm10
-rw-r--r--ios/web/shell/view_controller.mm3
-rw-r--r--ios/web/test/crw_fake_web_controller_observer.mm10
-rw-r--r--ios/web/weak_nsobject_counter.mm10
-rw-r--r--ios/web/web_state/js/crw_js_early_script_manager_unittest.mm7
-rw-r--r--ios/web/web_state/ui/crw_ui_simple_web_view_controller.mm2
-rw-r--r--ios/web/web_state/ui/crw_web_controller_container_view.mm10
-rw-r--r--ios/web/web_state/ui/crw_web_controller_unittest.mm3
-rw-r--r--ios/web/web_state/ui/crw_wk_web_view_crash_detector.mm10
-rw-r--r--ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm4
-rw-r--r--testing/iossim/iossim.mm1
-rw-r--r--third_party/class-dump/class-dump.gyp17
32 files changed, 164 insertions, 49 deletions
diff --git a/base/ios/crb_protocol_observers_unittest.mm b/base/ios/crb_protocol_observers_unittest.mm
index 5f11051..b8cf423 100644
--- a/base/ios/crb_protocol_observers_unittest.mm
+++ b/base/ios/crb_protocol_observers_unittest.mm
@@ -4,6 +4,7 @@
#import "base/ios/crb_protocol_observers.h"
#include "base/ios/weak_nsobject.h"
+#include "base/logging.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/mac/scoped_nsobject.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -36,10 +37,9 @@
@end
@interface TestMutateObserver : TestCompleteObserver
-
- (instancetype)initWithObserver:(CRBProtocolObservers*)observer
NS_DESIGNATED_INITIALIZER;
-
+- (instancetype)init NS_UNAVAILABLE;
@end
namespace {
@@ -266,6 +266,11 @@ TEST_F(CRBProtocolObserversTest, NestedMutateObservers) {
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (void)mutateByAddingObserver:(id<TestObserver>)observer {
[_observers addObserver:observer];
}
diff --git a/ios/chrome/browser/infobars/infobar_controller.h b/ios/chrome/browser/infobars/infobar_controller.h
index d29299c..c77e229 100644
--- a/ios/chrome/browser/infobars/infobar_controller.h
+++ b/ios/chrome/browser/infobars/infobar_controller.h
@@ -18,11 +18,12 @@ class InfoBarDelegate;
@interface InfoBarController : NSObject
@property(nonatomic, readonly) InfoBarViewDelegate* delegate;
-
// Designated initializer.
- (instancetype)initWithDelegate:(InfoBarViewDelegate*)delegate
NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
+
// Creates a view and lays out all the infobar elements in it. Will not add
// it as a subview yet. This method must be overriden in subclasses.
- (base::scoped_nsobject<UIView<InfoBarViewProtocol>>)
diff --git a/ios/chrome/browser/infobars/infobar_controller.mm b/ios/chrome/browser/infobars/infobar_controller.mm
index 594f0f3..c2c4875 100644
--- a/ios/chrome/browser/infobars/infobar_controller.mm
+++ b/ios/chrome/browser/infobars/infobar_controller.mm
@@ -25,6 +25,11 @@
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (void)dealloc {
[_infoBarView removeFromSuperview];
[super dealloc];
diff --git a/ios/chrome/browser/translate/before_translate_infobar_controller.mm b/ios/chrome/browser/translate/before_translate_infobar_controller.mm
index e39f6d7..7a872d9 100644
--- a/ios/chrome/browser/translate/before_translate_infobar_controller.mm
+++ b/ios/chrome/browser/translate/before_translate_infobar_controller.mm
@@ -301,7 +301,7 @@ NSTimeInterval kPickerAnimationDurationInSeconds = 0.2;
target:self
action:@selector(dismissLanguageSelectionView)]);
base::scoped_nsobject<UINavigationItem> item(
- [[UINavigationItem alloc] initWithTitle:nil]);
+ [[UINavigationItem alloc] initWithTitle:@""]);
[item setRightBarButtonItem:doneButton];
[item setLeftBarButtonItem:cancelButton];
[item setHidesBackButton:YES];
diff --git a/ios/chrome/browser/ui/commands/generic_chrome_command.h b/ios/chrome/browser/ui/commands/generic_chrome_command.h
index 75d7033..054de4f 100644
--- a/ios/chrome/browser/ui/commands/generic_chrome_command.h
+++ b/ios/chrome/browser/ui/commands/generic_chrome_command.h
@@ -10,12 +10,12 @@
// Generic command that can be passed to |chromeExecuteCommand|.
@interface GenericChromeCommand : NSObject
-// Mark inherited initializer as unavailable to prevent calling it by mistake.
-- (instancetype)init NS_UNAVAILABLE;
-
// Initializes the GenericChromeCommand with given |tag|.
- (instancetype)initWithTag:(NSInteger)tag NS_DESIGNATED_INITIALIZER;
+// Mark inherited initializer as unavailable to prevent calling it by mistake.
+- (instancetype)init NS_UNAVAILABLE;
+
// Convenience method to execute this command on the main window.
- (void)executeOnMainWindow;
diff --git a/ios/chrome/browser/ui/commands/generic_chrome_command.mm b/ios/chrome/browser/ui/commands/generic_chrome_command.mm
index d2512b9..bf00f6b 100644
--- a/ios/chrome/browser/ui/commands/generic_chrome_command.mm
+++ b/ios/chrome/browser/ui/commands/generic_chrome_command.mm
@@ -21,6 +21,11 @@
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (void)executeOnMainWindow {
UIWindow* mainWindow = [[UIApplication sharedApplication] keyWindow];
DCHECK(mainWindow);
diff --git a/ios/chrome/browser/updatable_config/updatable_config_base.mm b/ios/chrome/browser/updatable_config/updatable_config_base.mm
index 80c3ddb..58d1058 100644
--- a/ios/chrome/browser/updatable_config/updatable_config_base.mm
+++ b/ios/chrome/browser/updatable_config/updatable_config_base.mm
@@ -113,11 +113,6 @@ class ConfigFetcher : public net::URLFetcherDelegate {
}
// Overrides default designated initializer.
-- (instancetype)init {
- NOTREACHED();
- return nil;
-}
-
- (instancetype)initWithAppId:(NSString*)appId
version:(NSString*)appVersion
plist:(NSString*)plistName {
@@ -157,6 +152,11 @@ class ConfigFetcher : public net::URLFetcherDelegate {
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
#if !defined(NDEBUG)
diff --git a/ios/chrome/browser/xcallback_parameters.h b/ios/chrome/browser/xcallback_parameters.h
index 82b8996..ca245b3 100644
--- a/ios/chrome/browser/xcallback_parameters.h
+++ b/ios/chrome/browser/xcallback_parameters.h
@@ -33,6 +33,8 @@
createNewTab:(BOOL)createNewTab
NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
+
@end
#endif // IOS_CHROME_BROWSER_XCALLBACK_PARAMETERS_H_
diff --git a/ios/chrome/browser/xcallback_parameters.mm b/ios/chrome/browser/xcallback_parameters.mm
index 0d55d38..8554aa7 100644
--- a/ios/chrome/browser/xcallback_parameters.mm
+++ b/ios/chrome/browser/xcallback_parameters.mm
@@ -4,6 +4,7 @@
#import "ios/chrome/browser/xcallback_parameters.h"
+#include "base/logging.h"
#include "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
@@ -41,6 +42,11 @@ NSString* const kCreateNewTabKey = @"createNewTab";
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (NSString*)description {
return [NSString stringWithFormat:@"SourceApp: %@ (%@)\nSuccessURL: %s\n",
_sourceAppName.get(), _sourceAppId.get(),
diff --git a/ios/crnet/crnet_environment.mm b/ios/crnet/crnet_environment.mm
index d139b7f..d662310 100644
--- a/ios/crnet/crnet_environment.mm
+++ b/ios/crnet/crnet_environment.mm
@@ -22,6 +22,7 @@
#include "crypto/nss_util.h"
#include "ios/net/cookies/cookie_store_ios.h"
#include "ios/net/crn_http_protocol_handler.h"
+#include "ios/net/empty_nsurlcache.h"
#include "ios/net/request_tracker.h"
#include "ios/web/public/user_agent.h"
#include "net/base/net_errors.h"
@@ -300,7 +301,7 @@ net::URLRequestContextGetter* CrNetEnvironment::GetMainContextGetter() {
void CrNetEnvironment::SetHTTPProtocolHandlerRegistered(bool registered) {
if (registered) {
// Disable the default cache.
- [NSURLCache setSharedURLCache:nil];
+ [NSURLCache setSharedURLCache:[EmptyNSURLCache emptyNSURLCache]];
// Register the chrome http protocol handler to replace the default one.
BOOL success = [NSURLProtocol registerClass:[CRNHTTPProtocolHandler class]];
DCHECK(success);
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:)));
diff --git a/ios/public/test/test_updatable_resource_provider.mm b/ios/public/test/test_updatable_resource_provider.mm
index de8459f..177f17b 100644
--- a/ios/public/test/test_updatable_resource_provider.mm
+++ b/ios/public/test/test_updatable_resource_provider.mm
@@ -43,6 +43,7 @@
- (instancetype)initWithDelegate:(id<UpdatableResourceDelegate>)delegate
plist:(NSString*)resource_identifier
NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
@end
@implementation TestUpdatableResource {
@@ -62,6 +63,11 @@
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (id<UpdatableResourceDescriptorBridge>)descriptor {
return _descriptor.get();
}
diff --git a/ios/web/browsing_data_managers/crw_cookie_browsing_data_manager.h b/ios/web/browsing_data_managers/crw_cookie_browsing_data_manager.h
index 997eaa8..bb87190 100644
--- a/ios/web/browsing_data_managers/crw_cookie_browsing_data_manager.h
+++ b/ios/web/browsing_data_managers/crw_cookie_browsing_data_manager.h
@@ -19,6 +19,8 @@ class BrowserState;
- (instancetype)initWithBrowserState:(web::BrowserState*)browserState
NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
+
@end
#endif // IOS_WEB_BROWSING_DATA_MANAGERS_CRW_COOKIE_BROWSING_DATA_MANAGER_H_
diff --git a/ios/web/browsing_data_managers/crw_cookie_browsing_data_manager.mm b/ios/web/browsing_data_managers/crw_cookie_browsing_data_manager.mm
index e9006ba..f2c42e2 100644
--- a/ios/web/browsing_data_managers/crw_cookie_browsing_data_manager.mm
+++ b/ios/web/browsing_data_managers/crw_cookie_browsing_data_manager.mm
@@ -20,6 +20,11 @@
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
#pragma mark CRWBrowsingDataManager implementation
// TODO(shreyasv): During implementation of the following methods evaluate if
// the entire BrowserState is required. Looks like only |state_path| may be
diff --git a/ios/web/crw_browsing_data_store.mm b/ios/web/crw_browsing_data_store.mm
index 1d9fbe0..d78db6a 100644
--- a/ios/web/crw_browsing_data_store.mm
+++ b/ios/web/crw_browsing_data_store.mm
@@ -45,6 +45,7 @@ NSString* const kStashOperationName = @"CRWBrowsingDataStore.STASH";
// run. All remove operations need to be run on the same queue hence it is
// shared with all CRWBrowsingDataStores.
+ (NSOperationQueue*)operationQueueForRemoveOperations;
+- (instancetype)init NS_UNAVAILABLE;
// The array of all browsing data managers. Must be accessed from the main
// thread.
@@ -176,6 +177,11 @@ NSString* const kStashOperationName = @"CRWBrowsingDataStore.STASH";
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (NSString*)description {
NSString* format = @"<%@: %p; hasPendingOperations = { %@ }>";
NSString* hasPendingOperationsString =
diff --git a/ios/web/crw_browsing_data_store_unittest.mm b/ios/web/crw_browsing_data_store_unittest.mm
index a35c7f9..4364073 100644
--- a/ios/web/crw_browsing_data_store_unittest.mm
+++ b/ios/web/crw_browsing_data_store_unittest.mm
@@ -22,6 +22,7 @@
// Designated init. |browsingDataStore| cannot be null.
- (instancetype)initWithBrowsingDataStore:
(CRWBrowsingDataStore*)browsingDataStore NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
// The number of times that the mode of the underlying CRWBrowsingDataStore
// changed.
@property(nonatomic, assign) NSUInteger modeChangeCount;
@@ -48,6 +49,11 @@
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (void)observeValueForKeyPath:(NSString*)keyPath
ofObject:(id)object
change:(NSDictionary*)change
diff --git a/ios/web/net/clients/crw_redirect_network_client.mm b/ios/web/net/clients/crw_redirect_network_client.mm
index 2442834..ae19229 100644
--- a/ios/web/net/clients/crw_redirect_network_client.mm
+++ b/ios/web/net/clients/crw_redirect_network_client.mm
@@ -17,11 +17,6 @@
@implementation CRWRedirectNetworkClient
-- (instancetype)init {
- NOTREACHED();
- return nil;
-}
-
- (instancetype)initWithDelegate:
(base::WeakNSProtocol<id<CRWRedirectClientDelegate>>)delegate {
self = [super init];
@@ -35,6 +30,11 @@
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (void)wasRedirectedToRequest:(NSURLRequest*)request
nativeRequest:(net::URLRequest*)nativeRequest
redirectResponse:(NSURLResponse*)redirectResponse {
diff --git a/ios/web/net/clients/crw_redirect_network_client_factory.mm b/ios/web/net/clients/crw_redirect_network_client_factory.mm
index d3ac5da..3ad439b 100644
--- a/ios/web/net/clients/crw_redirect_network_client_factory.mm
+++ b/ios/web/net/clients/crw_redirect_network_client_factory.mm
@@ -21,11 +21,6 @@
@implementation CRWRedirectNetworkClientFactory
-- (instancetype)init {
- NOTREACHED();
- return nil;
-}
-
- (instancetype)initWithDelegate:(id<CRWRedirectClientDelegate>)delegate {
self = [super init];
if (self) {
@@ -36,6 +31,11 @@
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
#pragma mark - CRNForwardingNetworkClientFactory
- (Class)clientClass {
diff --git a/ios/web/shell/view_controller.mm b/ios/web/shell/view_controller.mm
index 16e78fe..fc7d52b 100644
--- a/ios/web/shell/view_controller.mm
+++ b/ios/web/shell/view_controller.mm
@@ -10,6 +10,7 @@
#include "base/strings/sys_string_conversions.h"
#include "ios/net/cookies/cookie_store_ios.h"
#import "ios/net/crn_http_protocol_handler.h"
+#import "ios/net/empty_nsurlcache.h"
#import "ios/web/navigation/crw_session_controller.h"
#include "ios/web/navigation/web_load_params.h"
#import "ios/web/net/crw_url_verifying_protocol_handler.h"
@@ -130,7 +131,7 @@ bool UseWKWebView() {
- (void)setUpNetworkStack {
// Disable the default cache.
- [NSURLCache setSharedURLCache:nil];
+ [NSURLCache setSharedURLCache:[EmptyNSURLCache emptyNSURLCache]];
_httpProtocolDelegate.reset(new web::WebHTTPProtocolHandlerDelegate(
_browserState->GetRequestContext()));
diff --git a/ios/web/test/crw_fake_web_controller_observer.mm b/ios/web/test/crw_fake_web_controller_observer.mm
index 1808168..c15553f 100644
--- a/ios/web/test/crw_fake_web_controller_observer.mm
+++ b/ios/web/test/crw_fake_web_controller_observer.mm
@@ -15,11 +15,6 @@
@synthesize pageLoaded = _pageLoaded;
-- (instancetype)init {
- NOTREACHED();
- return nil;
-}
-
- (instancetype)initWithCommandPrefix:(NSString*)commandPrefix {
DCHECK(commandPrefix);
self = [super init];
@@ -29,6 +24,11 @@
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (void)pageLoaded:(CRWWebController*)webController {
_pageLoaded = YES;
}
diff --git a/ios/web/weak_nsobject_counter.mm b/ios/web/weak_nsobject_counter.mm
index bd14b7b..edcf01a 100644
--- a/ios/web/weak_nsobject_counter.mm
+++ b/ios/web/weak_nsobject_counter.mm
@@ -29,11 +29,6 @@ const char kObserverAssociatedObjectKey = 'h';
linked_ptr<NSUInteger> _counter;
}
-- (instancetype)init {
- NOTREACHED();
- return nil;
-}
-
- (instancetype)initWithSharedCounter:(const linked_ptr<NSUInteger>&)counter
objectToBeObserved:(id)object {
self = [super init];
@@ -48,6 +43,11 @@ const char kObserverAssociatedObjectKey = 'h';
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (void)dealloc {
DCHECK(_counter.get());
(*_counter)--;
diff --git a/ios/web/web_state/js/crw_js_early_script_manager_unittest.mm b/ios/web/web_state/js/crw_js_early_script_manager_unittest.mm
index f0f2bfb..ff163b2 100644
--- a/ios/web/web_state/js/crw_js_early_script_manager_unittest.mm
+++ b/ios/web/web_state/js/crw_js_early_script_manager_unittest.mm
@@ -43,7 +43,12 @@ TEST_F(CRWJSEarlyScriptManagerTest, Content) {
// |earlyScript| is a substring of |injectionContent|. The latter wraps the
// former with "if (typeof __gCrWeb !== 'object')" check to avoid multiple
// injections.
- EXPECT_NE(NSNotFound, [injectionContent rangeOfString:earlyScript].location);
+ // TODO(justincohen): Cast indexOfObject to work around Xcode beta bugs.
+ // Revisit in future betas where hopefully these types match again.
+ // crbug.com/498825
+ EXPECT_NE(NSNotFound,
+ static_cast<NSInteger>(
+ [injectionContent rangeOfString:earlyScript].location));
}
} // namespace
diff --git a/ios/web/web_state/ui/crw_ui_simple_web_view_controller.mm b/ios/web/web_state/ui/crw_ui_simple_web_view_controller.mm
index dd15a3d..7d12883 100644
--- a/ios/web/web_state/ui/crw_ui_simple_web_view_controller.mm
+++ b/ios/web/web_state/ui/crw_ui_simple_web_view_controller.mm
@@ -72,7 +72,7 @@
[_webView loadData:data
MIMEType:@"application/pdf"
textEncodingName:@"utf-8"
- baseURL:nil];
+ baseURL:[NSURL URLWithString:@""]];
}
- (void)evaluateJavaScript:(NSString*)script
diff --git a/ios/web/web_state/ui/crw_web_controller_container_view.mm b/ios/web/web_state/ui/crw_web_controller_container_view.mm
index ffa5571..e54e303 100644
--- a/ios/web/web_state/ui/crw_web_controller_container_view.mm
+++ b/ios/web/web_state/ui/crw_web_controller_container_view.mm
@@ -97,11 +97,6 @@
@implementation CRWWebControllerContainerView
-- (instancetype)init {
- NOTREACHED();
- return nil;
-}
-
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
@@ -112,6 +107,11 @@
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
#pragma mark Accessors
- (void)setToolbarContainerView:(CRWToolbarContainerView*)toolbarContainerView {
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm
index 830504a..552f4cd 100644
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -839,7 +839,8 @@ TEST_F(CRWWKWebViewWebControllerTest, SSLError) {
[NSError errorWithDomain:NSURLErrorDomain
code:NSURLErrorServerCertificateHasUnknownRoot
userInfo:nil];
- [static_cast<id<WKNavigationDelegate>>(webController_.get()) webView:nil
+ WKWebView* webView = static_cast<WKWebView*>([webController_ webView]);
+ [static_cast<id<WKNavigationDelegate>>(webController_.get()) webView:webView
didFailProvisionalNavigation:nil
withError:error];
diff --git a/ios/web/web_state/ui/crw_wk_web_view_crash_detector.mm b/ios/web/web_state/ui/crw_wk_web_view_crash_detector.mm
index c6f015e..2dd10ab 100644
--- a/ios/web/web_state/ui/crw_wk_web_view_crash_detector.mm
+++ b/ios/web/web_state/ui/crw_wk_web_view_crash_detector.mm
@@ -45,11 +45,6 @@ BOOL IsWebViewTerminationError(NSError* error) {
base::mac::ScopedBlock<ProceduralBlock> _crashHandler;
}
-- (instancetype)init {
- NOTREACHED();
- return nil;
-}
-
- (instancetype)initWithWebView:(WKWebView*)webView
crashHandler:(ProceduralBlock)handler {
DCHECK(webView);
@@ -71,6 +66,11 @@ BOOL IsWebViewTerminationError(NSError* error) {
return self;
}
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
- (void)dealloc {
[_webView removeObserver:self forKeyPath:kCrashIndicatorKeyPath];
[super dealloc];
diff --git a/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm b/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm
index db1cd90..322c88e 100644
--- a/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm
+++ b/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm
@@ -68,6 +68,9 @@ TEST_F(WKWebViewConfigurationProviderTest, ConfigurationOwnerhip) {
other_provider.GetWebViewConfiguration().processPool);
}
+#if 0
+// TODO(shreyasv) Disabled for usage of nil on latest Xcode beta.
+// crbug.com/498841
// Tests that internal configuration object can not be changed by clients.
TEST_F(WKWebViewConfigurationProviderTest, ConfigurationProtection) {
CR_TEST_REQUIRES_WK_WEB_VIEW();
@@ -93,6 +96,7 @@ TEST_F(WKWebViewConfigurationProviderTest, ConfigurationProtection) {
EXPECT_EQ(userContentController.get(),
provider.GetWebViewConfiguration().userContentController);
}
+#endif
// Tests that |HasWebViewConfiguration| returns false by default.
TEST_F(WKWebViewConfigurationProviderTest, NoConfigurationByDefault) {
diff --git a/testing/iossim/iossim.mm b/testing/iossim/iossim.mm
index 3910ba5..933a183 100644
--- a/testing/iossim/iossim.mm
+++ b/testing/iossim/iossim.mm
@@ -32,6 +32,7 @@
// (crbug.com/385030).
#if defined(IOSSIM_USE_XCODE_6)
@protocol SimBridge;
+@class DVTSimulatorApplication;
@class SimDeviceSet;
@class SimDeviceType;
@class SimRuntime;
diff --git a/third_party/class-dump/class-dump.gyp b/third_party/class-dump/class-dump.gyp
index 68dec19..be3a15c 100644
--- a/third_party/class-dump/class-dump.gyp
+++ b/third_party/class-dump/class-dump.gyp
@@ -171,9 +171,24 @@
'src/Source/NSString-CDExtensions.m',
'src/Source/cd_objc2.h',
],
+ 'variables': {
+ 'developer_dir': '<!(xcode-select -print-path)',
+ 'xcode_version': '<!(xcodebuild -version | awk \'/Xcode/ {print $2}\')',
+ },
+ 'conditions': [
+ ['xcode_version>="7.0"', {
+ 'variables': {
+ 'dynamic_library_extension': 'tbd',
+ },
+ }, { # else: xcode_version<"7.0"
+ 'variables': {
+ 'dynamic_library_extension': 'dylib',
+ },
+ }]
+ ],
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
- '$(SDKROOT)/usr/lib/libcrypto.dylib',
+ '$(SDKROOT)/usr/lib/libcrypto.<(dynamic_library_extension)',
],
'include_dirs': [
'src/Source',