| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/prerender/prerender_manager.h" | 5 #include "chrome/browser/prerender/prerender_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 default: | 276 default: |
| 277 break; | 277 break; |
| 278 } | 278 } |
| 279 | 279 |
| 280 notification_registrar_.Add( | 280 notification_registrar_.Add( |
| 281 this, chrome::NOTIFICATION_COOKIE_CHANGED, | 281 this, chrome::NOTIFICATION_COOKIE_CHANGED, |
| 282 content::NotificationService::AllBrowserContextsAndSources()); | 282 content::NotificationService::AllBrowserContextsAndSources()); |
| 283 } | 283 } |
| 284 | 284 |
| 285 PrerenderManager::~PrerenderManager() { | 285 PrerenderManager::~PrerenderManager() { |
| 286 // The earlier call to ProfileKeyedService::Shutdown() should have emptied | 286 // The earlier call to BrowserContextKeyedService::Shutdown() should have |
| 287 // these vectors already. | 287 // emptied these vectors already. |
| 288 DCHECK(active_prerenders_.empty()); | 288 DCHECK(active_prerenders_.empty()); |
| 289 DCHECK(to_delete_prerenders_.empty()); | 289 DCHECK(to_delete_prerenders_.empty()); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void PrerenderManager::Shutdown() { | 292 void PrerenderManager::Shutdown() { |
| 293 DestroyAllContents(FINAL_STATUS_MANAGER_SHUTDOWN); | 293 DestroyAllContents(FINAL_STATUS_MANAGER_SHUTDOWN); |
| 294 STLDeleteElements(&prerender_conditions_); | 294 STLDeleteElements(&prerender_conditions_); |
| 295 on_close_web_contents_deleters_.clear(); | 295 on_close_web_contents_deleters_.clear(); |
| 296 // Must happen before |profile_| is set to NULL as | 296 // Must happen before |profile_| is set to NULL as |
| 297 // |local_predictor_| accesses it. | 297 // |local_predictor_| accesses it. |
| (...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 logged_in_state_->erase(domain_key); | 1537 logged_in_state_->erase(domain_key); |
| 1538 } | 1538 } |
| 1539 | 1539 |
| 1540 void PrerenderManager::LoggedInPredictorDataReceived( | 1540 void PrerenderManager::LoggedInPredictorDataReceived( |
| 1541 scoped_ptr<LoggedInStateMap> new_map) { | 1541 scoped_ptr<LoggedInStateMap> new_map) { |
| 1542 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1542 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1543 logged_in_state_.swap(new_map); | 1543 logged_in_state_.swap(new_map); |
| 1544 } | 1544 } |
| 1545 | 1545 |
| 1546 } // namespace prerender | 1546 } // namespace prerender |
| OLD | NEW |