| 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 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2159 command_line->AppendSwitch( | 2159 command_line->AppendSwitch( |
| 2160 switches::kEnableGpuMemoryBufferCompositorResources); | 2160 switches::kEnableGpuMemoryBufferCompositorResources); |
| 2161 } | 2161 } |
| 2162 | 2162 |
| 2163 if (IsMainFrameBeforeActivationEnabled()) | 2163 if (IsMainFrameBeforeActivationEnabled()) |
| 2164 command_line->AppendSwitch(cc::switches::kEnableMainFrameBeforeActivation); | 2164 command_line->AppendSwitch(cc::switches::kEnableMainFrameBeforeActivation); |
| 2165 | 2165 |
| 2166 if (IsCheckerImagingEnabled()) | 2166 if (IsCheckerImagingEnabled()) |
| 2167 command_line->AppendSwitch(cc::switches::kEnableCheckerImaging); | 2167 command_line->AppendSwitch(cc::switches::kEnableCheckerImaging); |
| 2168 | 2168 |
| 2169 cc::BufferToTextureTargetMap image_targets; | |
| 2170 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); | |
| 2171 ++usage_idx) { | |
| 2172 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); | |
| 2173 for (int format_idx = 0; | |
| 2174 format_idx <= static_cast<int>(gfx::BufferFormat::LAST); | |
| 2175 ++format_idx) { | |
| 2176 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); | |
| 2177 uint32_t target = gpu::GetImageTextureTarget(format, usage); | |
| 2178 image_targets[std::make_pair(usage, format)] = target; | |
| 2179 } | |
| 2180 } | |
| 2181 command_line->AppendSwitchASCII( | 2169 command_line->AppendSwitchASCII( |
| 2182 switches::kContentImageTextureTarget, | 2170 switches::kContentImageTextureTarget, |
| 2183 cc::BufferToTextureTargetMapToString(image_targets)); | 2171 cc::BufferToTextureTargetMapToString(CreateBufferToTextureTargetMap())); |
| 2184 | 2172 |
| 2185 // Appending disable-gpu-feature switches due to software rendering list. | 2173 // Appending disable-gpu-feature switches due to software rendering list. |
| 2186 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 2174 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
| 2187 DCHECK(gpu_data_manager); | 2175 DCHECK(gpu_data_manager); |
| 2188 gpu_data_manager->AppendRendererCommandLine(command_line); | 2176 gpu_data_manager->AppendRendererCommandLine(command_line); |
| 2189 | 2177 |
| 2190 // Slimming Paint v2 implies layer lists in the renderer. | 2178 // Slimming Paint v2 implies layer lists in the renderer. |
| 2191 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2179 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2192 switches::kEnableSlimmingPaintV2)) { | 2180 switches::kEnableSlimmingPaintV2)) { |
| 2193 command_line->AppendSwitch(cc::switches::kEnableLayerLists); | 2181 command_line->AppendSwitch(cc::switches::kEnableLayerLists); |
| (...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3805 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3793 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3806 | 3794 |
| 3807 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3795 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3808 // Capture the error message in a crash key value. | 3796 // Capture the error message in a crash key value. |
| 3809 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3797 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3810 bad_message::ReceivedBadMessage(render_process_id, | 3798 bad_message::ReceivedBadMessage(render_process_id, |
| 3811 bad_message::RPH_MOJO_PROCESS_ERROR); | 3799 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3812 } | 3800 } |
| 3813 | 3801 |
| 3814 } // namespace content | 3802 } // namespace content |
| OLD | NEW |