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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 #include "gpu/command_buffer/client/gpu_switches.h" | 157 #include "gpu/command_buffer/client/gpu_switches.h" |
158 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 158 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
159 #include "gpu/command_buffer/service/gpu_switches.h" | 159 #include "gpu/command_buffer/service/gpu_switches.h" |
160 #include "ipc/attachment_broker.h" | 160 #include "ipc/attachment_broker.h" |
161 #include "ipc/attachment_broker_privileged.h" | 161 #include "ipc/attachment_broker_privileged.h" |
162 #include "ipc/ipc_channel.h" | 162 #include "ipc/ipc_channel.h" |
163 #include "ipc/ipc_logging.h" | 163 #include "ipc/ipc_logging.h" |
164 #include "ipc/ipc_switches.h" | 164 #include "ipc/ipc_switches.h" |
165 #include "ipc/mojo/ipc_channel_mojo.h" | 165 #include "ipc/mojo/ipc_channel_mojo.h" |
166 #include "media/base/media_switches.h" | 166 #include "media/base/media_switches.h" |
| 167 #include "mojo/edk/embedder/embedder.h" |
167 #include "net/url_request/url_request_context_getter.h" | 168 #include "net/url_request/url_request_context_getter.h" |
168 #include "ppapi/shared_impl/ppapi_switches.h" | 169 #include "ppapi/shared_impl/ppapi_switches.h" |
169 #include "storage/browser/fileapi/sandbox_file_system_backend.h" | 170 #include "storage/browser/fileapi/sandbox_file_system_backend.h" |
170 #include "third_party/icu/source/common/unicode/unistr.h" | 171 #include "third_party/icu/source/common/unicode/unistr.h" |
171 #include "third_party/icu/source/i18n/unicode/timezone.h" | 172 #include "third_party/icu/source/i18n/unicode/timezone.h" |
172 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | |
173 #include "third_party/skia/include/core/SkBitmap.h" | 173 #include "third_party/skia/include/core/SkBitmap.h" |
174 #include "ui/base/ui_base_switches.h" | 174 #include "ui/base/ui_base_switches.h" |
175 #include "ui/events/event_switches.h" | 175 #include "ui/events/event_switches.h" |
176 #include "ui/gfx/switches.h" | 176 #include "ui/gfx/switches.h" |
177 #include "ui/gl/gl_switches.h" | 177 #include "ui/gl/gl_switches.h" |
178 #include "ui/gl/gpu_switching_manager.h" | 178 #include "ui/gl/gpu_switching_manager.h" |
179 #include "ui/native_theme/native_theme_switches.h" | 179 #include "ui/native_theme/native_theme_switches.h" |
180 | 180 |
181 #if defined(OS_ANDROID) | 181 #if defined(OS_ANDROID) |
182 #include "content/browser/android/child_process_launcher_android.h" | 182 #include "content/browser/android/child_process_launcher_android.h" |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1521 switches::kDisableDirectWrite, | 1521 switches::kDisableDirectWrite, |
1522 switches::kDisableWin32kRendererLockDown, | 1522 switches::kDisableWin32kRendererLockDown, |
1523 switches::kTraceExportEventsToETW, | 1523 switches::kTraceExportEventsToETW, |
1524 #endif | 1524 #endif |
1525 #if defined(USE_OZONE) | 1525 #if defined(USE_OZONE) |
1526 switches::kOzonePlatform, | 1526 switches::kOzonePlatform, |
1527 #endif | 1527 #endif |
1528 #if defined(OS_CHROMEOS) | 1528 #if defined(OS_CHROMEOS) |
1529 switches::kDisableVaapiAcceleratedVideoEncode, | 1529 switches::kDisableVaapiAcceleratedVideoEncode, |
1530 #endif | 1530 #endif |
1531 "use-new-edk", // TODO(use_chrome_edk): temporary. | |
1532 }; | 1531 }; |
1533 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, | 1532 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, |
1534 arraysize(kSwitchNames)); | 1533 arraysize(kSwitchNames)); |
1535 | 1534 |
1536 CopyEnableDisableFeatureFlagsToRenderer(renderer_cmd); | 1535 CopyEnableDisableFeatureFlagsToRenderer(renderer_cmd); |
1537 | 1536 |
1538 if (browser_cmd.HasSwitch(switches::kTraceStartup) && | 1537 if (browser_cmd.HasSwitch(switches::kTraceStartup) && |
1539 BrowserMainLoop::GetInstance()->is_tracing_startup_for_duration()) { | 1538 BrowserMainLoop::GetInstance()->is_tracing_startup_for_duration()) { |
1540 // Pass kTraceStartup switch to renderer only if startup tracing has not | 1539 // Pass kTraceStartup switch to renderer only if startup tracing has not |
1541 // finished. | 1540 // finished. |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2502 // ExtensionService uses this notification to initialize the renderer process | 2501 // ExtensionService uses this notification to initialize the renderer process |
2503 // with state that must be there before any JavaScript executes. | 2502 // with state that must be there before any JavaScript executes. |
2504 // | 2503 // |
2505 // The queued messages contain such things as "navigate". If this notification | 2504 // The queued messages contain such things as "navigate". If this notification |
2506 // was after, we can end up executing JavaScript before the initialization | 2505 // was after, we can end up executing JavaScript before the initialization |
2507 // happens. | 2506 // happens. |
2508 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, | 2507 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, |
2509 Source<RenderProcessHost>(this), | 2508 Source<RenderProcessHost>(this), |
2510 NotificationService::NoDetails()); | 2509 NotificationService::NoDetails()); |
2511 | 2510 |
2512 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk") && | 2511 if (child_process_launcher_.get()) { |
2513 child_process_launcher_.get()) { | |
2514 base::ProcessHandle process_handle = | 2512 base::ProcessHandle process_handle = |
2515 child_process_launcher_->GetProcess().Handle(); | 2513 child_process_launcher_->GetProcess().Handle(); |
2516 mojo::embedder::ScopedPlatformHandle client_pipe; | 2514 mojo::edk::ScopedPlatformHandle client_pipe; |
2517 #if defined(MOJO_SHELL_CLIENT) | 2515 #if defined(MOJO_SHELL_CLIENT) |
2518 if (IsRunningInMojoShell()) { | 2516 if (IsRunningInMojoShell()) { |
2519 client_pipe = RegisterProcessWithBroker( | 2517 client_pipe = RegisterProcessWithBroker( |
2520 child_process_launcher_->GetProcess().Pid()); | 2518 child_process_launcher_->GetProcess().Pid()); |
2521 } else | 2519 } else |
2522 #endif | 2520 #endif |
2523 { | 2521 { |
2524 client_pipe = mojo::embedder::ChildProcessLaunched(process_handle); | 2522 client_pipe = mojo::edk::ChildProcessLaunched(process_handle); |
2525 } | 2523 } |
2526 Send(new ChildProcessMsg_SetMojoParentPipeHandle( | 2524 Send(new ChildProcessMsg_SetMojoParentPipeHandle( |
2527 IPC::GetFileHandleForProcess( | 2525 IPC::GetFileHandleForProcess(client_pipe.release().handle, |
2528 #if defined(OS_WIN) | |
2529 client_pipe.release().handle, | |
2530 #else | |
2531 client_pipe.release().fd, | |
2532 #endif | |
2533 process_handle, true))); | 2526 process_handle, true))); |
2534 } | 2527 } |
2535 | 2528 |
2536 #if defined(MOJO_SHELL_CLIENT) | 2529 #if defined(MOJO_SHELL_CLIENT) |
2537 // Send the mojo shell handle to the renderer. | 2530 // Send the mojo shell handle to the renderer. |
2538 SendExternalMojoShellHandleToChild(GetHandle(), this); | 2531 SendExternalMojoShellHandleToChild(GetHandle(), this); |
2539 #endif | 2532 #endif |
2540 | 2533 |
2541 // Allow Mojo to be setup before the renderer sees any Chrome IPC messages. | 2534 // Allow Mojo to be setup before the renderer sees any Chrome IPC messages. |
2542 // This way, Mojo can be safely used from the renderer in response to any | 2535 // This way, Mojo can be safely used from the renderer in response to any |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2747 void RenderProcessHostImpl::GetAudioOutputControllers( | 2740 void RenderProcessHostImpl::GetAudioOutputControllers( |
2748 const GetAudioOutputControllersCallback& callback) const { | 2741 const GetAudioOutputControllersCallback& callback) const { |
2749 audio_renderer_host()->GetOutputControllers(callback); | 2742 audio_renderer_host()->GetOutputControllers(callback); |
2750 } | 2743 } |
2751 | 2744 |
2752 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2745 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2753 return bluetooth_dispatcher_host_.get(); | 2746 return bluetooth_dispatcher_host_.get(); |
2754 } | 2747 } |
2755 | 2748 |
2756 } // namespace content | 2749 } // namespace content |
OLD | NEW |