Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/chrome/app/main_controller.h" | 5 #import "ios/chrome/app/main_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #import <CoreSpotlight/CoreSpotlight.h> | 10 #import <CoreSpotlight/CoreSpotlight.h> |
| (...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1159 block:^{ | 1159 block:^{ |
| 1160 _memoryDebuggerManager.reset( | 1160 _memoryDebuggerManager.reset( |
| 1161 [[MemoryDebuggerManager alloc] | 1161 [[MemoryDebuggerManager alloc] |
| 1162 initWithView:self.window | 1162 initWithView:self.window |
| 1163 prefs:GetApplicationContext() | 1163 prefs:GetApplicationContext() |
| 1164 ->GetLocalState()]); | 1164 ->GetLocalState()]); |
| 1165 }]; | 1165 }]; |
| 1166 } | 1166 } |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 - (void)scheduleFreeMemoryMonitoring { | 1169 - (void)scheduleFreeMemoryMonitoring { |
|
marq (ping after 24h)
2017/03/16 13:40:58
Maybe this shouldn't be a schedule.. task and inst
gambard
2017/03/17 08:57:46
Done.
| |
| 1170 // TODO(crbug.com/649338): See if this method cannot call PostBlockingPoolTask | 1170 web::WebThread::PostBlockingPoolTask( |
| 1171 // directly instead of enqueueing a block. | 1171 FROM_HERE, base::Bind(&ios_internal::AsynchronousFreeMemoryMonitor)); |
| 1172 [[DeferredInitializationRunner sharedInstance] | |
| 1173 enqueueBlockNamed:kMemoryMonitoring | |
| 1174 block:^{ | |
| 1175 web::WebThread::PostBlockingPoolTask( | |
| 1176 FROM_HERE, | |
| 1177 base::Bind( | |
| 1178 &ios_internal::AsynchronousFreeMemoryMonitor)); | |
| 1179 }]; | |
| 1180 } | 1172 } |
| 1181 | 1173 |
| 1182 - (void)scheduleLowPriorityStartupTasks { | 1174 - (void)scheduleLowPriorityStartupTasks { |
| 1183 [_startupTasks initializeOmaha]; | 1175 [_startupTasks initializeOmaha]; |
| 1184 [_startupTasks registerForApplicationWillResignActiveNotification]; | 1176 [_startupTasks registerForApplicationWillResignActiveNotification]; |
| 1185 [self registerForOrientationChangeNotifications]; | 1177 [self registerForOrientationChangeNotifications]; |
| 1186 | 1178 |
| 1187 // Deferred tasks. | 1179 // Deferred tasks. |
| 1188 [self schedulePrefObserverInitialization]; | 1180 [self schedulePrefObserverInitialization]; |
| 1189 [self scheduleMemoryDebuggingTools]; | 1181 [self scheduleMemoryDebuggingTools]; |
| (...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2611 }; | 2603 }; |
| 2612 | 2604 |
| 2613 callbackCounter->IncrementCount(); | 2605 callbackCounter->IncrementCount(); |
| 2614 [self removeBrowsingDataFromBrowserState:_mainBrowserState | 2606 [self removeBrowsingDataFromBrowserState:_mainBrowserState |
| 2615 mask:removeAllMask | 2607 mask:removeAllMask |
| 2616 timePeriod:browsing_data::TimePeriod::ALL_TIME | 2608 timePeriod:browsing_data::TimePeriod::ALL_TIME |
| 2617 completionHandler:decrementCallbackCounterCount]; | 2609 completionHandler:decrementCallbackCounterCount]; |
| 2618 } | 2610 } |
| 2619 | 2611 |
| 2620 @end | 2612 @end |
| OLD | NEW |