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 #include "chrome/browser/sessions/session_restore.h" | 5 #include "chrome/browser/sessions/session_restore.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // Since FinishedTabCreation() is not called here, |this| will leak if we | 238 // Since FinishedTabCreation() is not called here, |this| will leak if we |
239 // are not in sychronous mode. | 239 // are not in sychronous mode. |
240 DCHECK(synchronous_); | 240 DCHECK(synchronous_); |
241 | 241 |
242 on_session_restored_callbacks_->Notify(1); | 242 on_session_restored_callbacks_->Notify(1); |
243 | 243 |
244 return web_contents; | 244 return web_contents; |
245 } | 245 } |
246 | 246 |
247 ~SessionRestoreImpl() override { | 247 ~SessionRestoreImpl() override { |
248 STLDeleteElements(&windows_); | 248 base::STLDeleteElements(&windows_); |
249 | 249 |
250 active_session_restorers->erase(this); | 250 active_session_restorers->erase(this); |
251 if (active_session_restorers->empty()) { | 251 if (active_session_restorers->empty()) { |
252 delete active_session_restorers; | 252 delete active_session_restorers; |
253 active_session_restorers = nullptr; | 253 active_session_restorers = nullptr; |
254 } | 254 } |
255 } | 255 } |
256 | 256 |
257 void Observe(int type, | 257 void Observe(int type, |
258 const content::NotificationSource& source, | 258 const content::NotificationSource& source, |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 // static | 838 // static |
839 SessionRestore::CallbackSubscription | 839 SessionRestore::CallbackSubscription |
840 SessionRestore::RegisterOnSessionRestoredCallback( | 840 SessionRestore::RegisterOnSessionRestoredCallback( |
841 const base::Callback<void(int)>& callback) { | 841 const base::Callback<void(int)>& callback) { |
842 return on_session_restored_callbacks()->Add(callback); | 842 return on_session_restored_callbacks()->Add(callback); |
843 } | 843 } |
844 | 844 |
845 // static | 845 // static |
846 base::CallbackList<void(int)>* | 846 base::CallbackList<void(int)>* |
847 SessionRestore::on_session_restored_callbacks_ = nullptr; | 847 SessionRestore::on_session_restored_callbacks_ = nullptr; |
OLD | NEW |