Index: ios/web/net/clients/crw_js_injection_network_client.mm |
diff --git a/ios/web/net/clients/crw_js_injection_network_client.mm b/ios/web/net/clients/crw_js_injection_network_client.mm |
index 32c49abeb93aebfbe84e9a17a2ce861afe5bd14c..2ce43e6494f1314c8be727e8ea9807c5c56caa7a 100644 |
--- a/ios/web/net/clients/crw_js_injection_network_client.mm |
+++ b/ios/web/net/clients/crw_js_injection_network_client.mm |
@@ -8,12 +8,15 @@ |
#include <stdint.h> |
#include "base/logging.h" |
-#include "base/mac/objc_property_releaser.h" |
#include "base/mac/scoped_nsobject.h" |
#include "base/metrics/histogram.h" |
#import "ios/net/crn_http_url_response.h" |
#import "ios/third_party/blink/src/html_tokenizer.h" |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
Eugene But (OOO till 7-30)
2016/08/19 16:34:50
We don't need network clients code with WKWebView.
|
+#error "This file requires ARC support." |
+#endif |
+ |
// CRWJSInjectionNetworkClient injects an external script tag reference for |
// crweb.js into HTML and XHTML documents. To do this correctly, three data |
// points are needed: where to inject the script tag, what encoding the content |
@@ -146,7 +149,7 @@ CRNHTTPURLResponse* ResponseWithUpdatedContentSize( |
HTTPVersion:[response cr_HTTPVersion] |
headerFields:all_headers_mutable]; |
- return [update_response autorelease]; |
+ return update_response; |
} |
} // namespace |
@@ -298,7 +301,7 @@ CRNHTTPURLResponse* ResponseWithUpdatedContentSize( |
[super didReceiveResponse:response]; |
} else { |
// Client calls [super didReceiveResponse:] in sendPendingResponse. |
- _pendingResponse.reset([static_cast<CRNHTTPURLResponse*>(response) retain]); |
+ _pendingResponse.reset(static_cast<CRNHTTPURLResponse*>(response)); |
} |
} |
@@ -350,7 +353,7 @@ CRNHTTPURLResponse* ResponseWithUpdatedContentSize( |
NSString* jsContentString = [NSString |
stringWithFormat:kJSContentTemplate, [[NSUUID UUID] UUIDString]]; |
_jsInjectionContent.reset( |
- [[jsContentString dataUsingEncoding:_contentEncoding] retain]); |
+ [jsContentString dataUsingEncoding:_contentEncoding]); |
return _jsInjectionContent; |
} |
@@ -393,7 +396,7 @@ CRNHTTPURLResponse* ResponseWithUpdatedContentSize( |
NSUInteger additionalLength = [[self jsInjectionContent] length]; |
CRNHTTPURLResponse* responseToSend = |
ResponseWithUpdatedContentSize(_pendingResponse, additionalLength); |
- _pendingResponse.reset([responseToSend retain]); |
+ _pendingResponse.reset(responseToSend); |
} |
[super didReceiveResponse:_pendingResponse]; |