OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #include "content/browser/shared_worker/worker_storage_partition.h" | 98 #include "content/browser/shared_worker/worker_storage_partition.h" |
99 #include "content/browser/speech/speech_recognition_dispatcher_host.h" | 99 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
100 #include "content/browser/storage_partition_impl.h" | 100 #include "content/browser/storage_partition_impl.h" |
101 #include "content/browser/streams/stream_context.h" | 101 #include "content/browser/streams/stream_context.h" |
102 #include "content/browser/tracing/trace_message_filter.h" | 102 #include "content/browser/tracing/trace_message_filter.h" |
103 #include "content/browser/vibration/vibration_message_filter.h" | 103 #include "content/browser/vibration/vibration_message_filter.h" |
104 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 104 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
105 #include "content/common/child_process_host_impl.h" | 105 #include "content/common/child_process_host_impl.h" |
106 #include "content/common/child_process_messages.h" | 106 #include "content/common/child_process_messages.h" |
107 #include "content/common/content_switches_internal.h" | 107 #include "content/common/content_switches_internal.h" |
| 108 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
108 #include "content/common/gpu/gpu_messages.h" | 109 #include "content/common/gpu/gpu_messages.h" |
109 #include "content/common/mojo/mojo_messages.h" | 110 #include "content/common/mojo/mojo_messages.h" |
110 #include "content/common/resource_messages.h" | 111 #include "content/common/resource_messages.h" |
111 #include "content/common/view_messages.h" | 112 #include "content/common/view_messages.h" |
112 #include "content/public/browser/browser_context.h" | 113 #include "content/public/browser/browser_context.h" |
113 #include "content/public/browser/content_browser_client.h" | 114 #include "content/public/browser/content_browser_client.h" |
114 #include "content/public/browser/notification_service.h" | 115 #include "content/public/browser/notification_service.h" |
115 #include "content/public/browser/notification_types.h" | 116 #include "content/public/browser/notification_types.h" |
116 #include "content/public/browser/render_process_host_factory.h" | 117 #include "content/public/browser/render_process_host_factory.h" |
117 #include "content/public/browser/render_process_host_observer.h" | 118 #include "content/public/browser/render_process_host_observer.h" |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 switches::kNumRasterThreads, | 1015 switches::kNumRasterThreads, |
1015 base::IntToString(NumberOfRendererRasterThreads())); | 1016 base::IntToString(NumberOfRendererRasterThreads())); |
1016 } | 1017 } |
1017 | 1018 |
1018 if (IsGpuRasterizationEnabled()) | 1019 if (IsGpuRasterizationEnabled()) |
1019 command_line->AppendSwitch(switches::kEnableGpuRasterization); | 1020 command_line->AppendSwitch(switches::kEnableGpuRasterization); |
1020 | 1021 |
1021 if (IsForceGpuRasterizationEnabled()) | 1022 if (IsForceGpuRasterizationEnabled()) |
1022 command_line->AppendSwitch(switches::kForceGpuRasterization); | 1023 command_line->AppendSwitch(switches::kForceGpuRasterization); |
1023 | 1024 |
| 1025 // Surface texture backed GPU memory buffers require TEXTURE_EXTERNAL_OES. |
| 1026 if (GpuMemoryBufferImpl::GetPreferredType() == gfx::SURFACE_TEXTURE_BUFFER) |
| 1027 command_line->AppendSwitch(switches::kUseImageExternal); |
| 1028 |
1024 // Appending disable-gpu-feature switches due to software rendering list. | 1029 // Appending disable-gpu-feature switches due to software rendering list. |
1025 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1030 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
1026 DCHECK(gpu_data_manager); | 1031 DCHECK(gpu_data_manager); |
1027 gpu_data_manager->AppendRendererCommandLine(command_line); | 1032 gpu_data_manager->AppendRendererCommandLine(command_line); |
1028 } | 1033 } |
1029 | 1034 |
1030 void RenderProcessHostImpl::AppendRendererCommandLine( | 1035 void RenderProcessHostImpl::AppendRendererCommandLine( |
1031 base::CommandLine* command_line) const { | 1036 base::CommandLine* command_line) const { |
1032 // Pass the process type first, so it shows first in process listings. | 1037 // Pass the process type first, so it shows first in process listings. |
1033 command_line->AppendSwitchASCII(switches::kProcessType, | 1038 command_line->AppendSwitchASCII(switches::kProcessType, |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2244 | 2249 |
2245 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2250 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2246 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2251 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2247 DCHECK_GT(worker_ref_count_, 0); | 2252 DCHECK_GT(worker_ref_count_, 0); |
2248 --worker_ref_count_; | 2253 --worker_ref_count_; |
2249 if (worker_ref_count_ == 0) | 2254 if (worker_ref_count_ == 0) |
2250 Cleanup(); | 2255 Cleanup(); |
2251 } | 2256 } |
2252 | 2257 |
2253 } // namespace content | 2258 } // namespace content |
OLD | NEW |