| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/fast_unload_controller.h" | 5 #include "chrome/browser/ui/fast_unload_controller.h" |
| 6 | 6 |
| 7 #include "base/location.h" |
| 7 #include "base/logging.h" | 8 #include "base/logging.h" |
| 8 #include "base/message_loop/message_loop.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/devtools/devtools_window.h" | 12 #include "chrome/browser/devtools/devtools_window.h" |
| 11 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_tabstrip.h" | 14 #include "chrome/browser/ui/browser_tabstrip.h" |
| 13 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 15 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 15 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" | 17 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" |
| 16 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
| 17 #include "content/public/browser/notification_source.h" | 19 #include "content/public/browser/notification_source.h" |
| 18 #include "content/public/browser/notification_types.h" | 20 #include "content/public/browser/notification_types.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 } | 468 } |
| 467 | 469 |
| 468 if (tabs_needing_before_unload_.erase(contents) > 0 || | 470 if (tabs_needing_before_unload_.erase(contents) > 0 || |
| 469 tabs_needing_unload_.erase(contents) > 0) { | 471 tabs_needing_unload_.erase(contents) > 0) { |
| 470 if (tab_needing_before_unload_ack_ == NULL) | 472 if (tab_needing_before_unload_ack_ == NULL) |
| 471 PostTaskForProcessPendingTabs(); | 473 PostTaskForProcessPendingTabs(); |
| 472 } | 474 } |
| 473 } | 475 } |
| 474 | 476 |
| 475 void FastUnloadController::PostTaskForProcessPendingTabs() { | 477 void FastUnloadController::PostTaskForProcessPendingTabs() { |
| 476 base::MessageLoop::current()->PostTask( | 478 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 477 FROM_HERE, | 479 FROM_HERE, base::Bind(&FastUnloadController::ProcessPendingTabs, |
| 478 base::Bind(&FastUnloadController::ProcessPendingTabs, | 480 weak_factory_.GetWeakPtr())); |
| 479 weak_factory_.GetWeakPtr())); | |
| 480 } | 481 } |
| 481 | 482 |
| 482 } // namespace chrome | 483 } // namespace chrome |
| OLD | NEW |