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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 // stopping the GPU thread. The GPU thread will close IPC channels to renderer | 477 // stopping the GPU thread. The GPU thread will close IPC channels to renderer |
478 // processes so this has to happen before stopping the IO thread. | 478 // processes so this has to happen before stopping the IO thread. |
479 GpuProcessHostUIShim::DestroyAll(); | 479 GpuProcessHostUIShim::DestroyAll(); |
480 | 480 |
481 // Cancel pending requests and prevent new requests. | 481 // Cancel pending requests and prevent new requests. |
482 if (resource_dispatcher_host_.get()) | 482 if (resource_dispatcher_host_.get()) |
483 resource_dispatcher_host_.get()->Shutdown(); | 483 resource_dispatcher_host_.get()->Shutdown(); |
484 | 484 |
485 speech_recognition_manager_.reset(); | 485 speech_recognition_manager_.reset(); |
486 | 486 |
487 // MediaStreamManager needs to be deleted on IO thread in order to unregister | |
488 // itself as the listener to VideoCaptureManager and AudioInputDeviceManager. | |
489 BrowserThread::DeleteOnIOThread::Destruct(media_stream_manager_.release()); | |
490 | |
491 #if defined(USE_AURA) | 487 #if defined(USE_AURA) |
492 ImageTransportFactory::Terminate(); | 488 ImageTransportFactory::Terminate(); |
493 #endif | 489 #endif |
494 BrowserGpuChannelHostFactory::Terminate(); | 490 BrowserGpuChannelHostFactory::Terminate(); |
495 | 491 |
496 GamepadService::GetInstance()->Terminate(); | 492 GamepadService::GetInstance()->Terminate(); |
497 | 493 |
498 // Must be size_t so we can subtract from it. | 494 // Must be size_t so we can subtract from it. |
499 for (size_t thread_id = BrowserThread::ID_COUNT - 1; | 495 for (size_t thread_id = BrowserThread::ID_COUNT - 1; |
500 thread_id >= (BrowserThread::UI + 1); | 496 thread_id >= (BrowserThread::UI + 1); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 656 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
661 if (parameters_.ui_task) | 657 if (parameters_.ui_task) |
662 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 658 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
663 | 659 |
664 base::RunLoop run_loop; | 660 base::RunLoop run_loop; |
665 run_loop.Run(); | 661 run_loop.Run(); |
666 #endif | 662 #endif |
667 } | 663 } |
668 | 664 |
669 } // namespace content | 665 } // namespace content |
OLD | NEW |