| 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 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2014 command_line->AppendSwitch( | 2014 command_line->AppendSwitch( |
| 2015 switches::kEnableGpuMemoryBufferCompositorResources); | 2015 switches::kEnableGpuMemoryBufferCompositorResources); |
| 2016 } | 2016 } |
| 2017 | 2017 |
| 2018 if (IsMainFrameBeforeActivationEnabled()) | 2018 if (IsMainFrameBeforeActivationEnabled()) |
| 2019 command_line->AppendSwitch(cc::switches::kEnableMainFrameBeforeActivation); | 2019 command_line->AppendSwitch(cc::switches::kEnableMainFrameBeforeActivation); |
| 2020 | 2020 |
| 2021 if (IsCheckerImagingEnabled()) | 2021 if (IsCheckerImagingEnabled()) |
| 2022 command_line->AppendSwitch(cc::switches::kEnableCheckerImaging); | 2022 command_line->AppendSwitch(cc::switches::kEnableCheckerImaging); |
| 2023 | 2023 |
| 2024 cc::BufferToTextureTargetMap image_targets; | |
| 2025 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); | |
| 2026 ++usage_idx) { | |
| 2027 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); | |
| 2028 for (int format_idx = 0; | |
| 2029 format_idx <= static_cast<int>(gfx::BufferFormat::LAST); | |
| 2030 ++format_idx) { | |
| 2031 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); | |
| 2032 uint32_t target = gpu::GetImageTextureTarget(format, usage); | |
| 2033 image_targets[std::make_pair(usage, format)] = target; | |
| 2034 } | |
| 2035 } | |
| 2036 command_line->AppendSwitchASCII( | 2024 command_line->AppendSwitchASCII( |
| 2037 switches::kContentImageTextureTarget, | 2025 switches::kContentImageTextureTarget, |
| 2038 cc::BufferToTextureTargetMapToString(image_targets)); | 2026 cc::BufferToTextureTargetMapToString(GetBufferToTextureTargetMap())); |
| 2039 | 2027 |
| 2040 // Appending disable-gpu-feature switches due to software rendering list. | 2028 // Appending disable-gpu-feature switches due to software rendering list. |
| 2041 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 2029 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
| 2042 DCHECK(gpu_data_manager); | 2030 DCHECK(gpu_data_manager); |
| 2043 gpu_data_manager->AppendRendererCommandLine(command_line); | 2031 gpu_data_manager->AppendRendererCommandLine(command_line); |
| 2044 | 2032 |
| 2045 // Slimming Paint v2 implies layer lists in the renderer. | 2033 // Slimming Paint v2 implies layer lists in the renderer. |
| 2046 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2034 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2047 switches::kEnableSlimmingPaintV2)) { | 2035 switches::kEnableSlimmingPaintV2)) { |
| 2048 command_line->AppendSwitch(cc::switches::kEnableLayerLists); | 2036 command_line->AppendSwitch(cc::switches::kEnableLayerLists); |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3635 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3623 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3636 | 3624 |
| 3637 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3625 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3638 // Capture the error message in a crash key value. | 3626 // Capture the error message in a crash key value. |
| 3639 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3627 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3640 bad_message::ReceivedBadMessage(render_process_id, | 3628 bad_message::ReceivedBadMessage(render_process_id, |
| 3641 bad_message::RPH_MOJO_PROCESS_ERROR); | 3629 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3642 } | 3630 } |
| 3643 | 3631 |
| 3644 } // namespace content | 3632 } // namespace content |
| OLD | NEW |