| 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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 | 860 |
| 861 base::Thread::Options options; | 861 base::Thread::Options options; |
| 862 #if defined(OS_WIN) && !defined(OS_MACOSX) | 862 #if defined(OS_WIN) && !defined(OS_MACOSX) |
| 863 // In-process plugins require this to be a UI message loop. | 863 // In-process plugins require this to be a UI message loop. |
| 864 options.message_loop_type = base::MessageLoop::TYPE_UI; | 864 options.message_loop_type = base::MessageLoop::TYPE_UI; |
| 865 #else | 865 #else |
| 866 // We can't have multiple UI loops on Linux and Android, so we don't support | 866 // We can't have multiple UI loops on Linux and Android, so we don't support |
| 867 // in-process plugins. | 867 // in-process plugins. |
| 868 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; | 868 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; |
| 869 #endif | 869 #endif |
| 870 | |
| 871 // As for execution sequence, this callback should have no any dependency | 870 // As for execution sequence, this callback should have no any dependency |
| 872 // on starting in-process-render-thread. | 871 // on starting in-process-render-thread. |
| 873 // So put it here to trigger ChannelMojo initialization earlier to enable | 872 // So put it here to trigger ChannelMojo initialization earlier to enable |
| 874 // in-process-render-thread using ChannelMojo there. | 873 // in-process-render-thread using ChannelMojo there. |
| 875 OnProcessLaunched(); // Fake a callback that the process is ready. | 874 OnProcessLaunched(); // Fake a callback that the process is ready. |
| 876 | 875 |
| 877 in_process_renderer_->StartWithOptions(options); | 876 in_process_renderer_->StartWithOptions(options); |
| 878 | 877 |
| 879 g_in_process_thread = in_process_renderer_->message_loop(); | 878 g_in_process_thread = in_process_renderer_->message_loop(); |
| 880 | 879 |
| (...skipping 708 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 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2984 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2985 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 2985 | 2986 |
| 2986 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2987 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
| 2987 // enough information here so that we can determine what the bad message was. | 2988 // enough information here so that we can determine what the bad message was. |
| 2988 base::debug::Alias(&error); | 2989 base::debug::Alias(&error); |
| 2989 bad_message::ReceivedBadMessage(render_process_id, | 2990 bad_message::ReceivedBadMessage(render_process_id, |
| 2990 bad_message::RPH_MOJO_PROCESS_ERROR); | 2991 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 2991 } | 2992 } |
| 2992 | 2993 |
| 2993 } // namespace content | 2994 } // namespace content |
| OLD | NEW |