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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "content/browser/gpu/gpu_data_manager_impl.h" | 53 #include "content/browser/gpu/gpu_data_manager_impl.h" |
54 #include "content/browser/gpu/gpu_process_host.h" | 54 #include "content/browser/gpu/gpu_process_host.h" |
55 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 55 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
56 #include "content/browser/histogram_synchronizer.h" | 56 #include "content/browser/histogram_synchronizer.h" |
57 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 57 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
58 #include "content/browser/loader_delegate_impl.h" | 58 #include "content/browser/loader_delegate_impl.h" |
59 #include "content/browser/media/media_internals.h" | 59 #include "content/browser/media/media_internals.h" |
60 #include "content/browser/memory/memory_coordinator.h" | 60 #include "content/browser/memory/memory_coordinator.h" |
61 #include "content/browser/net/browser_online_state_observer.h" | 61 #include "content/browser/net/browser_online_state_observer.h" |
62 #include "content/browser/renderer_host/media/media_stream_manager.h" | 62 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 63 #include "content/browser/renderer_host/offscreen_canvas_surface_manager.h" |
63 #include "content/browser/renderer_host/render_process_host_impl.h" | 64 #include "content/browser/renderer_host/render_process_host_impl.h" |
64 #include "content/browser/service_manager/service_manager_context.h" | 65 #include "content/browser/service_manager/service_manager_context.h" |
65 #include "content/browser/speech/speech_recognition_manager_impl.h" | 66 #include "content/browser/speech/speech_recognition_manager_impl.h" |
66 #include "content/browser/startup_task_runner.h" | 67 #include "content/browser/startup_task_runner.h" |
67 #include "content/browser/utility_process_host_impl.h" | 68 #include "content/browser/utility_process_host_impl.h" |
68 #include "content/browser/webui/content_web_ui_controller_factory.h" | 69 #include "content/browser/webui/content_web_ui_controller_factory.h" |
69 #include "content/browser/webui/url_data_manager.h" | 70 #include "content/browser/webui/url_data_manager.h" |
70 #include "content/common/content_switches_internal.h" | 71 #include "content/common/content_switches_internal.h" |
71 #include "content/common/host_discardable_shared_memory_manager.h" | 72 #include "content/common/host_discardable_shared_memory_manager.h" |
72 #include "content/common/host_shared_bitmap_manager.h" | 73 #include "content/common/host_shared_bitmap_manager.h" |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 // them before |system_monitor_| goes away. | 1054 // them before |system_monitor_| goes away. |
1054 // On Mac and windows, the monitor needs to be destroyed on the same thread | 1055 // On Mac and windows, the monitor needs to be destroyed on the same thread |
1055 // as they were created. On Linux, the monitor will be deleted when IO thread | 1056 // as they were created. On Linux, the monitor will be deleted when IO thread |
1056 // goes away. | 1057 // goes away. |
1057 #if defined(OS_WIN) | 1058 #if defined(OS_WIN) |
1058 system_message_window_.reset(); | 1059 system_message_window_.reset(); |
1059 #elif defined(OS_MACOSX) | 1060 #elif defined(OS_MACOSX) |
1060 device_monitor_mac_.reset(); | 1061 device_monitor_mac_.reset(); |
1061 #endif | 1062 #endif |
1062 | 1063 |
| 1064 // Shutdown OffscreenCanvasSurfaceManager if it exists. |
| 1065 // Because it contains weak pointers to IPC services, this is done before |
| 1066 // Service Manager and IPC are shut down. |
| 1067 OffscreenCanvasSurfaceManager::Terminate(); |
| 1068 |
1063 // Shutdown the Service Manager and IPC. | 1069 // Shutdown the Service Manager and IPC. |
1064 service_manager_context_.reset(); | 1070 service_manager_context_.reset(); |
1065 mojo_ipc_support_.reset(); | 1071 mojo_ipc_support_.reset(); |
1066 | 1072 |
1067 // Must be size_t so we can subtract from it. | 1073 // Must be size_t so we can subtract from it. |
1068 for (size_t thread_id = BrowserThread::ID_COUNT - 1; | 1074 for (size_t thread_id = BrowserThread::ID_COUNT - 1; |
1069 thread_id >= (BrowserThread::UI + 1); | 1075 thread_id >= (BrowserThread::UI + 1); |
1070 --thread_id) { | 1076 --thread_id) { |
1071 // Find the thread object we want to stop. Looping over all valid | 1077 // Find the thread object we want to stop. Looping over all valid |
1072 // BrowserThread IDs and DCHECKing on a missing case in the switch | 1078 // BrowserThread IDs and DCHECKing on a missing case in the switch |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1598 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
1593 audio_thread_->task_runner(); | 1599 audio_thread_->task_runner(); |
1594 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1600 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
1595 std::move(worker_task_runner), | 1601 std::move(worker_task_runner), |
1596 MediaInternals::GetInstance()); | 1602 MediaInternals::GetInstance()); |
1597 } | 1603 } |
1598 CHECK(audio_manager_); | 1604 CHECK(audio_manager_); |
1599 } | 1605 } |
1600 | 1606 |
1601 } // namespace content | 1607 } // namespace content |
OLD | NEW |