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

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2881183002: Revert of Replace ObjCPropertyReleaser with ReleaseProperties() project-wide. (Closed)
Patch Set: Created 3 years, 7 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 | « ios/web/public/origin_util_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "ios/web/web_state/ui/crw_web_controller.h" 5 #import "ios/web/web_state/ui/crw_web_controller.h"
6 6
7 #import <WebKit/WebKit.h> 7 #import <WebKit/WebKit.h>
8 8
9 #import <objc/runtime.h> 9 #import <objc/runtime.h>
10 #include <stddef.h> 10 #include <stddef.h>
11 11
12 #include <cmath> 12 #include <cmath>
13 #include <memory> 13 #include <memory>
14 #include <utility> 14 #include <utility>
15 #include <vector> 15 #include <vector>
16 16
17 #include "base/callback.h" 17 #include "base/callback.h"
18 #include "base/containers/mru_cache.h" 18 #include "base/containers/mru_cache.h"
19 #import "base/ios/block_types.h" 19 #import "base/ios/block_types.h"
20 #include "base/ios/ios_util.h" 20 #include "base/ios/ios_util.h"
21 #import "base/ios/ns_error_util.h" 21 #import "base/ios/ns_error_util.h"
22 #import "base/ios/weak_nsobject.h" 22 #import "base/ios/weak_nsobject.h"
23 #include "base/json/string_escape.h" 23 #include "base/json/string_escape.h"
24 #include "base/logging.h" 24 #include "base/logging.h"
25 #import "base/mac/bind_objc_block.h" 25 #import "base/mac/bind_objc_block.h"
26 #include "base/mac/bundle_locations.h" 26 #include "base/mac/bundle_locations.h"
27 #include "base/mac/foundation_util.h" 27 #include "base/mac/foundation_util.h"
28 #include "base/mac/objc_release_properties.h" 28 #import "base/mac/objc_property_releaser.h"
29 #include "base/mac/scoped_cftyperef.h" 29 #include "base/mac/scoped_cftyperef.h"
30 #import "base/mac/scoped_nsobject.h" 30 #import "base/mac/scoped_nsobject.h"
31 #include "base/memory/ptr_util.h" 31 #include "base/memory/ptr_util.h"
32 #include "base/metrics/histogram_macros.h" 32 #include "base/metrics/histogram_macros.h"
33 #include "base/metrics/user_metrics.h" 33 #include "base/metrics/user_metrics.h"
34 #include "base/metrics/user_metrics_action.h" 34 #include "base/metrics/user_metrics_action.h"
35 #include "base/strings/string_util.h" 35 #include "base/strings/string_util.h"
36 #include "base/strings/sys_string_conversions.h" 36 #include "base/strings/sys_string_conversions.h"
37 #include "base/strings/utf_string_conversions.h" 37 #include "base/strings/utf_string_conversions.h"
38 #include "base/time/time.h" 38 #include "base/time/time.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return 209 return
210 [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo]; 210 [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo];
211 } 211 }
212 } // namespace 212 } // namespace
213 213
214 #pragma mark - 214 #pragma mark -
215 215
216 // A container object for any navigation information that is only available 216 // A container object for any navigation information that is only available
217 // during pre-commit delegate callbacks, and thus must be held until the 217 // during pre-commit delegate callbacks, and thus must be held until the
218 // navigation commits and the informatino can be used. 218 // navigation commits and the informatino can be used.
219 @interface CRWWebControllerPendingNavigationInfo : NSObject 219 @interface CRWWebControllerPendingNavigationInfo : NSObject {
220 base::mac::ObjCPropertyReleaser
221 _propertyReleaser_CRWWebControllerPendingNavigationInfo;
222 }
220 // The referrer for the page. 223 // The referrer for the page.
221 @property(nonatomic, copy) NSString* referrer; 224 @property(nonatomic, copy) NSString* referrer;
222 // The MIME type for the page. 225 // The MIME type for the page.
223 @property(nonatomic, copy) NSString* MIMEType; 226 @property(nonatomic, copy) NSString* MIMEType;
224 // The navigation type for the load. 227 // The navigation type for the load.
225 @property(nonatomic, assign) WKNavigationType navigationType; 228 @property(nonatomic, assign) WKNavigationType navigationType;
226 // HTTP request method for the load. 229 // HTTP request method for the load.
227 @property(nonatomic, copy) NSString* HTTPMethod; 230 @property(nonatomic, copy) NSString* HTTPMethod;
228 // Whether the pending navigation has been directly cancelled before the 231 // Whether the pending navigation has been directly cancelled before the
229 // navigation is committed. 232 // navigation is committed.
230 // Cancelled navigations should be simply discarded without handling any 233 // Cancelled navigations should be simply discarded without handling any
231 // specific error. 234 // specific error.
232 @property(nonatomic, assign) BOOL cancelled; 235 @property(nonatomic, assign) BOOL cancelled;
233 @end 236 @end
234 237
235 @implementation CRWWebControllerPendingNavigationInfo 238 @implementation CRWWebControllerPendingNavigationInfo
236 @synthesize referrer = _referrer; 239 @synthesize referrer = _referrer;
237 @synthesize MIMEType = _MIMEType; 240 @synthesize MIMEType = _MIMEType;
238 @synthesize navigationType = _navigationType; 241 @synthesize navigationType = _navigationType;
239 @synthesize HTTPMethod = _HTTPMethod; 242 @synthesize HTTPMethod = _HTTPMethod;
240 @synthesize cancelled = _cancelled; 243 @synthesize cancelled = _cancelled;
241 244
242 - (instancetype)init { 245 - (instancetype)init {
243 if ((self = [super init])) { 246 if ((self = [super init])) {
247 _propertyReleaser_CRWWebControllerPendingNavigationInfo.Init(
248 self, [CRWWebControllerPendingNavigationInfo class]);
244 _navigationType = WKNavigationTypeOther; 249 _navigationType = WKNavigationTypeOther;
245 } 250 }
246 return self; 251 return self;
247 } 252 }
248
249 - (void)dealloc {
250 base::mac::ReleaseProperties(self);
251 [super dealloc];
252 }
253
254 @end 253 @end
255 254
256 @interface CRWWebController ()<CRWContextMenuDelegate, 255 @interface CRWWebController ()<CRWContextMenuDelegate,
257 CRWNativeContentDelegate, 256 CRWNativeContentDelegate,
258 CRWSSLStatusUpdaterDataSource, 257 CRWSSLStatusUpdaterDataSource,
259 CRWSSLStatusUpdaterDelegate, 258 CRWSSLStatusUpdaterDelegate,
260 CRWWebControllerContainerViewDelegate, 259 CRWWebControllerContainerViewDelegate,
261 CRWWebViewScrollViewProxyObserver, 260 CRWWebViewScrollViewProxyObserver,
262 WKNavigationDelegate, 261 WKNavigationDelegate,
263 WKUIDelegate> { 262 WKUIDelegate> {
(...skipping 4898 matching lines...) Expand 10 before | Expand all | Expand 10 after
5162 - (NSUInteger)observerCount { 5161 - (NSUInteger)observerCount {
5163 DCHECK_EQ(_observerBridges.size(), [_observers count]); 5162 DCHECK_EQ(_observerBridges.size(), [_observers count]);
5164 return [_observers count]; 5163 return [_observers count];
5165 } 5164 }
5166 5165
5167 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { 5166 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action {
5168 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; 5167 return [action.request valueForHTTPHeaderField:kReferrerHeaderName];
5169 } 5168 }
5170 5169
5171 @end 5170 @end
OLDNEW
« no previous file with comments | « ios/web/public/origin_util_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698