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

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

Issue 2610923005: Replace ObjCPropertyReleaser with ReleaseProperties() project-wide. (Closed)
Patch Set: Yank unrelated changes. 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 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 #import "base/mac/objc_property_releaser.h" 28 #include "base/mac/objc_release_properties.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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 return 195 return
196 [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo]; 196 [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo];
197 } 197 }
198 } // namespace 198 } // namespace
199 199
200 #pragma mark - 200 #pragma mark -
201 201
202 // A container object for any navigation information that is only available 202 // A container object for any navigation information that is only available
203 // during pre-commit delegate callbacks, and thus must be held until the 203 // during pre-commit delegate callbacks, and thus must be held until the
204 // navigation commits and the informatino can be used. 204 // navigation commits and the informatino can be used.
205 @interface CRWWebControllerPendingNavigationInfo : NSObject { 205 @interface CRWWebControllerPendingNavigationInfo : NSObject
206 base::mac::ObjCPropertyReleaser
207 _propertyReleaser_CRWWebControllerPendingNavigationInfo;
208 }
209 // The referrer for the page. 206 // The referrer for the page.
210 @property(nonatomic, copy) NSString* referrer; 207 @property(nonatomic, copy) NSString* referrer;
211 // The MIME type for the page. 208 // The MIME type for the page.
212 @property(nonatomic, copy) NSString* MIMEType; 209 @property(nonatomic, copy) NSString* MIMEType;
213 // The navigation type for the load. 210 // The navigation type for the load.
214 @property(nonatomic, assign) WKNavigationType navigationType; 211 @property(nonatomic, assign) WKNavigationType navigationType;
215 // HTTP request method for the load. 212 // HTTP request method for the load.
216 @property(nonatomic, copy) NSString* HTTPMethod; 213 @property(nonatomic, copy) NSString* HTTPMethod;
217 // Whether the pending navigation has been directly cancelled before the 214 // Whether the pending navigation has been directly cancelled before the
218 // navigation is committed. 215 // navigation is committed.
219 // Cancelled navigations should be simply discarded without handling any 216 // Cancelled navigations should be simply discarded without handling any
220 // specific error. 217 // specific error.
221 @property(nonatomic, assign) BOOL cancelled; 218 @property(nonatomic, assign) BOOL cancelled;
222 @end 219 @end
223 220
224 @implementation CRWWebControllerPendingNavigationInfo 221 @implementation CRWWebControllerPendingNavigationInfo
225 @synthesize referrer = _referrer; 222 @synthesize referrer = _referrer;
226 @synthesize MIMEType = _MIMEType; 223 @synthesize MIMEType = _MIMEType;
227 @synthesize navigationType = _navigationType; 224 @synthesize navigationType = _navigationType;
228 @synthesize HTTPMethod = _HTTPMethod; 225 @synthesize HTTPMethod = _HTTPMethod;
229 @synthesize cancelled = _cancelled; 226 @synthesize cancelled = _cancelled;
230 227
231 - (instancetype)init { 228 - (instancetype)init {
232 if ((self = [super init])) { 229 if ((self = [super init])) {
233 _propertyReleaser_CRWWebControllerPendingNavigationInfo.Init(
234 self, [CRWWebControllerPendingNavigationInfo class]);
235 _navigationType = WKNavigationTypeOther; 230 _navigationType = WKNavigationTypeOther;
236 } 231 }
237 return self; 232 return self;
238 } 233 }
234
235 - (void)dealloc {
236 base::mac::ReleaseProperties(self);
237 [super dealloc];
238 }
239
239 @end 240 @end
240 241
241 @interface CRWWebController ()<CRWContextMenuDelegate, 242 @interface CRWWebController ()<CRWContextMenuDelegate,
242 CRWNativeContentDelegate, 243 CRWNativeContentDelegate,
243 CRWSSLStatusUpdaterDataSource, 244 CRWSSLStatusUpdaterDataSource,
244 CRWSSLStatusUpdaterDelegate, 245 CRWSSLStatusUpdaterDelegate,
245 CRWWebControllerContainerViewDelegate, 246 CRWWebControllerContainerViewDelegate,
246 CRWWebViewScrollViewProxyObserver, 247 CRWWebViewScrollViewProxyObserver,
247 WKNavigationDelegate, 248 WKNavigationDelegate,
248 WKUIDelegate> { 249 WKUIDelegate> {
(...skipping 5065 matching lines...) Expand 10 before | Expand all | Expand 10 after
5314 - (void)simulateLoadRequestWithURL:(const GURL&)URL { 5315 - (void)simulateLoadRequestWithURL:(const GURL&)URL {
5315 _lastRegisteredRequestURL = URL; 5316 _lastRegisteredRequestURL = URL;
5316 _loadPhase = web::LOAD_REQUESTED; 5317 _loadPhase = web::LOAD_REQUESTED;
5317 } 5318 }
5318 5319
5319 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { 5320 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action {
5320 return [action.request valueForHTTPHeaderField:@"Referer"]; 5321 return [action.request valueForHTTPHeaderField:@"Referer"];
5321 } 5322 }
5322 5323
5323 @end 5324 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698