| 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 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2003 command_line->AppendSwitch( | 2003 command_line->AppendSwitch( |
| 2004 switches::kEnableGpuMemoryBufferCompositorResources); | 2004 switches::kEnableGpuMemoryBufferCompositorResources); |
| 2005 } | 2005 } |
| 2006 | 2006 |
| 2007 if (IsMainFrameBeforeActivationEnabled()) | 2007 if (IsMainFrameBeforeActivationEnabled()) |
| 2008 command_line->AppendSwitch(cc::switches::kEnableMainFrameBeforeActivation); | 2008 command_line->AppendSwitch(cc::switches::kEnableMainFrameBeforeActivation); |
| 2009 | 2009 |
| 2010 if (IsCheckerImagingEnabled()) | 2010 if (IsCheckerImagingEnabled()) |
| 2011 command_line->AppendSwitch(cc::switches::kEnableCheckerImaging); | 2011 command_line->AppendSwitch(cc::switches::kEnableCheckerImaging); |
| 2012 | 2012 |
| 2013 cc::BufferToTextureTargetMap image_targets; | |
| 2014 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); | |
| 2015 ++usage_idx) { | |
| 2016 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); | |
| 2017 for (int format_idx = 0; | |
| 2018 format_idx <= static_cast<int>(gfx::BufferFormat::LAST); | |
| 2019 ++format_idx) { | |
| 2020 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); | |
| 2021 uint32_t target = gpu::GetImageTextureTarget(format, usage); | |
| 2022 image_targets[std::make_pair(usage, format)] = target; | |
| 2023 } | |
| 2024 } | |
| 2025 command_line->AppendSwitchASCII( | 2013 command_line->AppendSwitchASCII( |
| 2026 switches::kContentImageTextureTarget, | 2014 switches::kContentImageTextureTarget, |
| 2027 cc::BufferToTextureTargetMapToString(image_targets)); | 2015 cc::BufferToTextureTargetMapToString(GetBufferToTextureTargetMap())); |
| 2028 | 2016 |
| 2029 // Appending disable-gpu-feature switches due to software rendering list. | 2017 // Appending disable-gpu-feature switches due to software rendering list. |
| 2030 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 2018 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
| 2031 DCHECK(gpu_data_manager); | 2019 DCHECK(gpu_data_manager); |
| 2032 gpu_data_manager->AppendRendererCommandLine(command_line); | 2020 gpu_data_manager->AppendRendererCommandLine(command_line); |
| 2033 | 2021 |
| 2034 // Slimming Paint v2 implies layer lists in the renderer. | 2022 // Slimming Paint v2 implies layer lists in the renderer. |
| 2035 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2023 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2036 switches::kEnableSlimmingPaintV2)) { | 2024 switches::kEnableSlimmingPaintV2)) { |
| 2037 command_line->AppendSwitch(cc::switches::kEnableLayerLists); | 2025 command_line->AppendSwitch(cc::switches::kEnableLayerLists); |
| (...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3622 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3610 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3623 | 3611 |
| 3624 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3612 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3625 // Capture the error message in a crash key value. | 3613 // Capture the error message in a crash key value. |
| 3626 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3614 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3627 bad_message::ReceivedBadMessage(render_process_id, | 3615 bad_message::ReceivedBadMessage(render_process_id, |
| 3628 bad_message::RPH_MOJO_PROCESS_ERROR); | 3616 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3629 } | 3617 } |
| 3630 | 3618 |
| 3631 } // namespace content | 3619 } // namespace content |
| OLD | NEW |