Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2112543002: Convert UtilityProcessHost to bootstrap Mojo Channel using the Shell connection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@p9x
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 48 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
49 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 49 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
50 #include "content/browser/gpu/compositor_util.h" 50 #include "content/browser/gpu/compositor_util.h"
51 #include "content/browser/gpu/gpu_data_manager_impl.h" 51 #include "content/browser/gpu/gpu_data_manager_impl.h"
52 #include "content/browser/gpu/gpu_process_host.h" 52 #include "content/browser/gpu/gpu_process_host.h"
53 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 53 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
54 #include "content/browser/histogram_synchronizer.h" 54 #include "content/browser/histogram_synchronizer.h"
55 #include "content/browser/loader/resource_dispatcher_host_impl.h" 55 #include "content/browser/loader/resource_dispatcher_host_impl.h"
56 #include "content/browser/loader_delegate_impl.h" 56 #include "content/browser/loader_delegate_impl.h"
57 #include "content/browser/media/media_internals.h" 57 #include "content/browser/media/media_internals.h"
58 #include "content/browser/mojo/mojo_shell_context.h"
59 #include "content/browser/net/browser_online_state_observer.h" 58 #include "content/browser/net/browser_online_state_observer.h"
60 #include "content/browser/renderer_host/media/media_stream_manager.h" 59 #include "content/browser/renderer_host/media/media_stream_manager.h"
61 #include "content/browser/renderer_host/render_process_host_impl.h" 60 #include "content/browser/renderer_host/render_process_host_impl.h"
62 #include "content/browser/speech/speech_recognition_manager_impl.h" 61 #include "content/browser/speech/speech_recognition_manager_impl.h"
63 #include "content/browser/startup_task_runner.h" 62 #include "content/browser/startup_task_runner.h"
64 #include "content/browser/time_zone_monitor.h" 63 #include "content/browser/time_zone_monitor.h"
65 #include "content/browser/utility_process_host_impl.h" 64 #include "content/browser/utility_process_host_impl.h"
66 #include "content/browser/webui/content_web_ui_controller_factory.h" 65 #include "content/browser/webui/content_web_ui_controller_factory.h"
67 #include "content/browser/webui/url_data_manager.h" 66 #include "content/browser/webui/url_data_manager.h"
68 #include "content/common/content_switches_internal.h" 67 #include "content/common/content_switches_internal.h"
69 #include "content/common/host_discardable_shared_memory_manager.h" 68 #include "content/common/host_discardable_shared_memory_manager.h"
70 #include "content/common/host_shared_bitmap_manager.h" 69 #include "content/common/host_shared_bitmap_manager.h"
71 #include "content/common/mojo/mojo_shell_connection_impl.h" 70 #include "content/common/mojo/mojo_shell_connection_impl.h"
72 #include "content/public/browser/browser_main_parts.h" 71 #include "content/public/browser/browser_main_parts.h"
73 #include "content/public/browser/content_browser_client.h" 72 #include "content/public/browser/content_browser_client.h"
74 #include "content/public/browser/render_process_host.h" 73 #include "content/public/browser/render_process_host.h"
74 #include "content/public/browser/shell_context.h"
75 #include "content/public/browser/tracing_controller.h" 75 #include "content/public/browser/tracing_controller.h"
76 #include "content/public/common/content_client.h" 76 #include "content/public/common/content_client.h"
77 #include "content/public/common/content_switches.h" 77 #include "content/public/common/content_switches.h"
78 #include "content/public/common/main_function_params.h" 78 #include "content/public/common/main_function_params.h"
79 #include "content/public/common/result_codes.h" 79 #include "content/public/common/result_codes.h"
80 #include "device/battery/battery_status_service.h" 80 #include "device/battery/battery_status_service.h"
81 #include "media/base/media.h" 81 #include "media/base/media.h"
82 #include "media/base/user_input_monitor.h" 82 #include "media/base/user_input_monitor.h"
83 #include "media/midi/midi_manager.h" 83 #include "media/midi/midi_manager.h"
84 #include "mojo/edk/embedder/embedder.h" 84 #include "mojo/edk/embedder/embedder.h"
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 // On Mac and windows, the monitor needs to be destroyed on the same thread 1020 // On Mac and windows, the monitor needs to be destroyed on the same thread
1021 // as they were created. On Linux, the monitor will be deleted when IO thread 1021 // as they were created. On Linux, the monitor will be deleted when IO thread
1022 // goes away. 1022 // goes away.
1023 #if defined(OS_WIN) 1023 #if defined(OS_WIN)
1024 system_message_window_.reset(); 1024 system_message_window_.reset();
1025 #elif defined(OS_MACOSX) 1025 #elif defined(OS_MACOSX)
1026 device_monitor_mac_.reset(); 1026 device_monitor_mac_.reset();
1027 #endif 1027 #endif
1028 1028
1029 // Shutdown Mojo shell and IPC. 1029 // Shutdown Mojo shell and IPC.
1030 mojo_shell_context_.reset(); 1030 shell_context_.reset();
1031 mojo_ipc_support_.reset(); 1031 mojo_ipc_support_.reset();
1032 1032
1033 // Must be size_t so we can subtract from it. 1033 // Must be size_t so we can subtract from it.
1034 for (size_t thread_id = BrowserThread::ID_COUNT - 1; 1034 for (size_t thread_id = BrowserThread::ID_COUNT - 1;
1035 thread_id >= (BrowserThread::UI + 1); 1035 thread_id >= (BrowserThread::UI + 1);
1036 --thread_id) { 1036 --thread_id) {
1037 // Find the thread object we want to stop. Looping over all valid 1037 // Find the thread object we want to stop. Looping over all valid
1038 // BrowserThread IDs and DCHECKing on a missing case in the switch 1038 // BrowserThread IDs and DCHECKing on a missing case in the switch
1039 // statement helps avoid a mismatch between this code and the 1039 // statement helps avoid a mismatch between this code and the
1040 // BrowserThread::ID enumeration. 1040 // BrowserThread::ID enumeration.
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 // Disallow mojo sync call in the browser process. 1165 // Disallow mojo sync call in the browser process.
1166 bool sync_call_allowed = false; 1166 bool sync_call_allowed = false;
1167 MojoResult result = mojo::edk::SetProperty( 1167 MojoResult result = mojo::edk::SetProperty(
1168 MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED, &sync_call_allowed); 1168 MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED, &sync_call_allowed);
1169 DCHECK_EQ(MOJO_RESULT_OK, result); 1169 DCHECK_EQ(MOJO_RESULT_OK, result);
1170 1170
1171 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( 1171 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport(
1172 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) 1172 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO)
1173 ->task_runner())); 1173 ->task_runner()));
1174 1174
1175 mojo_shell_context_.reset(new MojoShellContext); 1175 shell_context_ = ShellContext::Create();
1176 if (shell::ShellIsRemote()) { 1176 if (shell::ShellIsRemote()) {
1177 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) 1177 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA)
1178 // TODO(rockot): Remove the blocking wait for init. 1178 // TODO(rockot): Remove the blocking wait for init.
1179 // http://crbug.com/594852. 1179 // http://crbug.com/594852.
1180 auto connection = MojoShellConnection::GetForProcess(); 1180 auto connection = MojoShellConnection::GetForProcess();
1181 if (connection) { 1181 if (connection) {
1182 WaitForMojoShellInitialize(); 1182 WaitForMojoShellInitialize();
1183 mus::GpuService::Initialize(connection->GetConnector()); 1183 mus::GpuService::Initialize(connection->GetConnector());
1184 } 1184 }
1185 #endif 1185 #endif
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 std::move(worker_task_runner), 1517 std::move(worker_task_runner),
1518 MediaInternals::GetInstance()); 1518 MediaInternals::GetInstance());
1519 } 1519 }
1520 CHECK(audio_manager_); 1520 CHECK(audio_manager_);
1521 1521
1522 if (use_hang_monitor) 1522 if (use_hang_monitor)
1523 media::AudioManager::StartHangMonitor(io_thread_->task_runner()); 1523 media::AudioManager::StartHangMonitor(io_thread_->task_runner());
1524 } 1524 }
1525 1525
1526 } // namespace content 1526 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698