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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 void Release(int old_route_id) { | 392 void Release(int old_route_id) { |
393 session_storage_namespaces_awaiting_close_.erase(old_route_id); | 393 session_storage_namespaces_awaiting_close_.erase(old_route_id); |
394 } | 394 } |
395 | 395 |
396 private: | 396 private: |
397 std::map<int, SessionStorageNamespaceMap > | 397 std::map<int, SessionStorageNamespaceMap > |
398 session_storage_namespaces_awaiting_close_; | 398 session_storage_namespaces_awaiting_close_; |
399 DISALLOW_COPY_AND_ASSIGN(SessionStorageHolder); | 399 DISALLOW_COPY_AND_ASSIGN(SessionStorageHolder); |
400 }; | 400 }; |
401 | 401 |
402 std::string UintVectorToString(const std::vector<uint>& vector) { | |
403 std::string rt; | |
reveman
2015/07/27 17:07:15
nit: maybe s/rt/str/ to be consistent with StringT
| |
404 for (std::vector<uint>::const_iterator it = vector.begin(); | |
405 it != vector.end(); ++it) { | |
reveman
2015/07/27 17:07:15
nit: for (auto it : vector) { ...
| |
406 if (!rt.empty()) | |
407 rt += ","; | |
408 rt += base::UintToString(*it); | |
409 } | |
410 return rt; | |
411 } | |
412 | |
402 } // namespace | 413 } // namespace |
403 | 414 |
404 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; | 415 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; |
405 | 416 |
406 base::MessageLoop* g_in_process_thread; | 417 base::MessageLoop* g_in_process_thread; |
407 | 418 |
408 base::MessageLoop* | 419 base::MessageLoop* |
409 RenderProcessHostImpl::GetInProcessRendererThreadForTesting() { | 420 RenderProcessHostImpl::GetInProcessRendererThreadForTesting() { |
410 return g_in_process_thread; | 421 return g_in_process_thread; |
411 } | 422 } |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1128 DCHECK_IMPLIES(IsZeroCopyUploadEnabled(), !IsOneCopyUploadEnabled()); | 1139 DCHECK_IMPLIES(IsZeroCopyUploadEnabled(), !IsOneCopyUploadEnabled()); |
1129 DCHECK_IMPLIES(IsOneCopyUploadEnabled(), !IsZeroCopyUploadEnabled()); | 1140 DCHECK_IMPLIES(IsOneCopyUploadEnabled(), !IsZeroCopyUploadEnabled()); |
1130 if (IsZeroCopyUploadEnabled()) | 1141 if (IsZeroCopyUploadEnabled()) |
1131 command_line->AppendSwitch(switches::kEnableZeroCopy); | 1142 command_line->AppendSwitch(switches::kEnableZeroCopy); |
1132 if (!IsOneCopyUploadEnabled()) | 1143 if (!IsOneCopyUploadEnabled()) |
1133 command_line->AppendSwitch(switches::kDisableOneCopy); | 1144 command_line->AppendSwitch(switches::kDisableOneCopy); |
1134 | 1145 |
1135 if (IsForceGpuRasterizationEnabled()) | 1146 if (IsForceGpuRasterizationEnabled()) |
1136 command_line->AppendSwitch(switches::kForceGpuRasterization); | 1147 command_line->AppendSwitch(switches::kForceGpuRasterization); |
1137 | 1148 |
1138 command_line->AppendSwitchASCII( | 1149 std::vector<uint> image_targets(gfx::GpuMemoryBuffer::FORMAT_LAST + 1, |
1139 switches::kContentImageTextureTarget, | 1150 GL_TEXTURE_2D); |
1140 base::UintToString( | 1151 for (size_t format = 0; format < gfx::GpuMemoryBuffer::FORMAT_LAST + 1; |
1141 // TODO(reveman): We currently assume that the compositor will use | 1152 format++) { |
1142 // BGRA_8888 if it's able to, and RGBA_8888 otherwise. Since we don't | 1153 image_targets[format] = |
1143 // know what it will use we hardcode BGRA_8888 here for now. We should | 1154 BrowserGpuMemoryBufferManager::GetImageTextureTarget( |
1144 // instead move decisions about GpuMemoryBuffer format to the browser | 1155 static_cast<gfx::GpuMemoryBuffer::Format>(format), |
1145 // embedder so we know it here, and pass that decision to the | 1156 // TODO(danakj): When one-copy supports partial update, change |
1146 // compositor for each usage. | 1157 // this usage to PERSISTENT_MAP for one-copy. |
1147 // crbug.com/490362 | 1158 gfx::GpuMemoryBuffer::MAP); |
1148 BrowserGpuMemoryBufferManager::GetImageTextureTarget( | 1159 } |
1149 gfx::GpuMemoryBuffer::BGRA_8888, | 1160 command_line->AppendSwitchASCII(switches::kContentImageTextureTarget, |
1150 // TODO(danakj): When one-copy supports partial update, change | 1161 UintVectorToString(image_targets)); |
1151 // this usage to PERSISTENT_MAP for one-copy. | |
1152 gfx::GpuMemoryBuffer::MAP))); | |
1153 | 1162 |
1154 command_line->AppendSwitchASCII( | 1163 command_line->AppendSwitchASCII( |
1155 switches::kVideoImageTextureTarget, | 1164 switches::kVideoImageTextureTarget, |
1156 base::UintToString(BrowserGpuMemoryBufferManager::GetImageTextureTarget( | 1165 base::UintToString(BrowserGpuMemoryBufferManager::GetImageTextureTarget( |
1157 gfx::GpuMemoryBuffer::R_8, gfx::GpuMemoryBuffer::MAP))); | 1166 gfx::GpuMemoryBuffer::R_8, gfx::GpuMemoryBuffer::MAP))); |
1158 | 1167 |
1159 // Appending disable-gpu-feature switches due to software rendering list. | 1168 // Appending disable-gpu-feature switches due to software rendering list. |
1160 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1169 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
1161 DCHECK(gpu_data_manager); | 1170 DCHECK(gpu_data_manager); |
1162 gpu_data_manager->AppendRendererCommandLine(command_line); | 1171 gpu_data_manager->AppendRendererCommandLine(command_line); |
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2510 void RenderProcessHostImpl::GetAudioOutputControllers( | 2519 void RenderProcessHostImpl::GetAudioOutputControllers( |
2511 const GetAudioOutputControllersCallback& callback) const { | 2520 const GetAudioOutputControllersCallback& callback) const { |
2512 audio_renderer_host()->GetOutputControllers(callback); | 2521 audio_renderer_host()->GetOutputControllers(callback); |
2513 } | 2522 } |
2514 | 2523 |
2515 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2524 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2516 return bluetooth_dispatcher_host_.get(); | 2525 return bluetooth_dispatcher_host_.get(); |
2517 } | 2526 } |
2518 | 2527 |
2519 } // namespace content | 2528 } // namespace content |
OLD | NEW |