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

Side by Side Diff: ios/chrome/browser/ui/preload_controller.mm

Issue 2629073003: Ensure PreloadController is deallocated. (Closed)
Patch Set: Created 3 years, 11 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/chrome/browser/ui/preload_controller.h ('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 <UIKit/UIKit.h> 5 #import <UIKit/UIKit.h>
6 6
7 #include "ios/chrome/browser/ui/preload_controller.h" 7 #include "ios/chrome/browser/ui/preload_controller.h"
8 8
9 #include "base/ios/device_util.h" 9 #include "base/ios/device_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 [[NSNotificationCenter defaultCenter] 132 [[NSNotificationCenter defaultCenter]
133 addObserver:self 133 addObserver:self
134 selector:@selector(didReceiveMemoryWarning) 134 selector:@selector(didReceiveMemoryWarning)
135 name:UIApplicationDidReceiveMemoryWarningNotification 135 name:UIApplicationDidReceiveMemoryWarningNotification
136 object:nil]; 136 object:nil];
137 } 137 }
138 return self; 138 return self;
139 } 139 }
140 140
141 - (void)browserStateDestroyed {
142 [self cancelPrerender];
143 connectionTypeObserverBridge_.reset();
144 }
145
141 - (void)dealloc { 146 - (void)dealloc {
142 UMA_HISTOGRAM_COUNTS(kPrerendersPerSessionCountHistogramName, 147 UMA_HISTOGRAM_COUNTS(kPrerendersPerSessionCountHistogramName,
143 successfulPrerendersPerSessionCount_); 148 successfulPrerendersPerSessionCount_);
144 [[NSNotificationCenter defaultCenter] removeObserver:self]; 149 [[NSNotificationCenter defaultCenter] removeObserver:self];
145 [self cancelPrerender]; 150 [self cancelPrerender];
146 [super dealloc]; 151 [super dealloc];
147 } 152 }
148 153
149 - (void)prerenderURL:(const GURL&)url 154 - (void)prerenderURL:(const GURL&)url
150 referrer:(const web::Referrer&)referrer 155 referrer:(const web::Referrer&)referrer
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 scheduledURL_ = GURL(); 403 scheduledURL_ = GURL();
399 } 404 }
400 405
401 #pragma mark - TabDelegate 406 #pragma mark - TabDelegate
402 407
403 - (void)discardPrerender { 408 - (void)discardPrerender {
404 [self schedulePrerenderCancel]; 409 [self schedulePrerenderCancel];
405 } 410 }
406 411
407 @end 412 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/preload_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698