| 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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 | 858 |
| 859 base::Thread::Options options; | 859 base::Thread::Options options; |
| 860 #if defined(OS_WIN) && !defined(OS_MACOSX) | 860 #if defined(OS_WIN) && !defined(OS_MACOSX) |
| 861 // In-process plugins require this to be a UI message loop. | 861 // In-process plugins require this to be a UI message loop. |
| 862 options.message_loop_type = base::MessageLoop::TYPE_UI; | 862 options.message_loop_type = base::MessageLoop::TYPE_UI; |
| 863 #else | 863 #else |
| 864 // We can't have multiple UI loops on Linux and Android, so we don't support | 864 // We can't have multiple UI loops on Linux and Android, so we don't support |
| 865 // in-process plugins. | 865 // in-process plugins. |
| 866 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; | 866 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; |
| 867 #endif | 867 #endif |
| 868 | |
| 869 // As for execution sequence, this callback should have no any dependency | 868 // As for execution sequence, this callback should have no any dependency |
| 870 // on starting in-process-render-thread. | 869 // on starting in-process-render-thread. |
| 871 // So put it here to trigger ChannelMojo initialization earlier to enable | 870 // So put it here to trigger ChannelMojo initialization earlier to enable |
| 872 // in-process-render-thread using ChannelMojo there. | 871 // in-process-render-thread using ChannelMojo there. |
| 873 OnProcessLaunched(); // Fake a callback that the process is ready. | 872 OnProcessLaunched(); // Fake a callback that the process is ready. |
| 874 | 873 |
| 875 in_process_renderer_->StartWithOptions(options); | 874 in_process_renderer_->StartWithOptions(options); |
| 876 | 875 |
| 877 g_in_process_thread = in_process_renderer_->message_loop(); | 876 g_in_process_thread = in_process_renderer_->message_loop(); |
| 878 | 877 |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 #if defined(OS_WIN) | 1588 #if defined(OS_WIN) |
| 1590 command_line->AppendSwitchASCII( | 1589 command_line->AppendSwitchASCII( |
| 1591 switches::kDeviceScaleFactor, | 1590 switches::kDeviceScaleFactor, |
| 1592 base::DoubleToString(display::win::GetDPIScale())); | 1591 base::DoubleToString(display::win::GetDPIScale())); |
| 1593 #endif | 1592 #endif |
| 1594 | 1593 |
| 1595 AppendCompositorCommandLineFlags(command_line); | 1594 AppendCompositorCommandLineFlags(command_line); |
| 1596 | 1595 |
| 1597 command_line->AppendSwitchASCII(switches::kServiceRequestChannelToken, | 1596 command_line->AppendSwitchASCII(switches::kServiceRequestChannelToken, |
| 1598 child_connection_->service_token()); | 1597 child_connection_->service_token()); |
| 1598 command_line->AppendSwitchASCII(switches::kRendererClientId, |
| 1599 std::to_string(GetID())); |
| 1599 } | 1600 } |
| 1600 | 1601 |
| 1601 void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( | 1602 void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( |
| 1602 const base::CommandLine& browser_cmd, | 1603 const base::CommandLine& browser_cmd, |
| 1603 base::CommandLine* renderer_cmd) { | 1604 base::CommandLine* renderer_cmd) { |
| 1604 // Propagate the following switches to the renderer command line (along | 1605 // Propagate the following switches to the renderer command line (along |
| 1605 // with any associated values) if present in the browser command line. | 1606 // with any associated values) if present in the browser command line. |
| 1606 static const char* const kSwitchNames[] = { | 1607 static const char* const kSwitchNames[] = { |
| 1607 switches::kAgcStartupMinVolume, | 1608 switches::kAgcStartupMinVolume, |
| 1608 switches::kAecRefinedAdaptiveFilter, | 1609 switches::kAecRefinedAdaptiveFilter, |
| (...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2983 bad_message::ReceivedBadMessage(render_process_id, | 2984 bad_message::ReceivedBadMessage(render_process_id, |
| 2984 bad_message::RPH_MOJO_PROCESS_ERROR); | 2985 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 2985 } | 2986 } |
| 2986 | 2987 |
| 2987 void RenderProcessHostImpl::CreateURLLoaderFactory( | 2988 void RenderProcessHostImpl::CreateURLLoaderFactory( |
| 2988 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { | 2989 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { |
| 2989 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); | 2990 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); |
| 2990 } | 2991 } |
| 2991 | 2992 |
| 2992 } // namespace content | 2993 } // namespace content |
| OLD | NEW |