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 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 base::CommandLine* cmd_line = new base::CommandLine(renderer_path); | 902 base::CommandLine* cmd_line = new base::CommandLine(renderer_path); |
903 if (!renderer_prefix.empty()) | 903 if (!renderer_prefix.empty()) |
904 cmd_line->PrependWrapper(renderer_prefix); | 904 cmd_line->PrependWrapper(renderer_prefix); |
905 AppendRendererCommandLine(cmd_line); | 905 AppendRendererCommandLine(cmd_line); |
906 | 906 |
907 // Spawn the child process asynchronously to avoid blocking the UI thread. | 907 // Spawn the child process asynchronously to avoid blocking the UI thread. |
908 // As long as there's no renderer prefix, we can use the zygote process | 908 // As long as there's no renderer prefix, we can use the zygote process |
909 // at this stage. | 909 // at this stage. |
910 child_process_launcher_.reset(new ChildProcessLauncher( | 910 child_process_launcher_.reset(new ChildProcessLauncher( |
911 new RendererSandboxedProcessLauncherDelegate(channel_.get()), cmd_line, | 911 new RendererSandboxedProcessLauncherDelegate(channel_.get()), cmd_line, |
912 GetID(), this, field_trial_state_.get(), child_token_, | 912 GetID(), this, child_token_, |
913 base::Bind(&RenderProcessHostImpl::OnMojoError, id_))); | 913 base::Bind(&RenderProcessHostImpl::OnMojoError, id_))); |
914 channel_->Pause(); | 914 channel_->Pause(); |
915 | 915 |
916 fast_shutdown_started_ = false; | 916 fast_shutdown_started_ = false; |
917 } | 917 } |
918 | 918 |
919 if (!gpu_observer_registered_) { | 919 if (!gpu_observer_registered_) { |
920 gpu_observer_registered_ = true; | 920 gpu_observer_registered_ = true; |
921 ui::GpuSwitchingManager::GetInstance()->AddObserver(this); | 921 ui::GpuSwitchingManager::GetInstance()->AddObserver(this); |
922 } | 922 } |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 #endif | 1815 #endif |
1816 #if defined(ENABLE_IPC_FUZZER) | 1816 #if defined(ENABLE_IPC_FUZZER) |
1817 switches::kIpcDumpDirectory, | 1817 switches::kIpcDumpDirectory, |
1818 switches::kIpcFuzzerTestcase, | 1818 switches::kIpcFuzzerTestcase, |
1819 #endif | 1819 #endif |
1820 switches::kUseMusInRenderer, | 1820 switches::kUseMusInRenderer, |
1821 }; | 1821 }; |
1822 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, | 1822 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, |
1823 arraysize(kSwitchNames)); | 1823 arraysize(kSwitchNames)); |
1824 | 1824 |
1825 field_trial_state_ = | 1825 BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(renderer_cmd); |
1826 BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(renderer_cmd); | |
1827 | 1826 |
1828 if (browser_cmd.HasSwitch(switches::kTraceStartup) && | 1827 if (browser_cmd.HasSwitch(switches::kTraceStartup) && |
1829 BrowserMainLoop::GetInstance()->is_tracing_startup_for_duration()) { | 1828 BrowserMainLoop::GetInstance()->is_tracing_startup_for_duration()) { |
1830 // Pass kTraceStartup switch to renderer only if startup tracing has not | 1829 // Pass kTraceStartup switch to renderer only if startup tracing has not |
1831 // finished. | 1830 // finished. |
1832 renderer_cmd->AppendSwitchASCII( | 1831 renderer_cmd->AppendSwitchASCII( |
1833 switches::kTraceStartup, | 1832 switches::kTraceStartup, |
1834 browser_cmd.GetSwitchValueASCII(switches::kTraceStartup)); | 1833 browser_cmd.GetSwitchValueASCII(switches::kTraceStartup)); |
1835 } | 1834 } |
1836 | 1835 |
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3005 bad_message::ReceivedBadMessage(render_process_id, | 3004 bad_message::ReceivedBadMessage(render_process_id, |
3006 bad_message::RPH_MOJO_PROCESS_ERROR); | 3005 bad_message::RPH_MOJO_PROCESS_ERROR); |
3007 } | 3006 } |
3008 | 3007 |
3009 void RenderProcessHostImpl::CreateURLLoaderFactory( | 3008 void RenderProcessHostImpl::CreateURLLoaderFactory( |
3010 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { | 3009 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { |
3011 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); | 3010 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); |
3012 } | 3011 } |
3013 | 3012 |
3014 } // namespace content | 3013 } // namespace content |
OLD | NEW |