| 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 #include "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2334 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host( | 2334 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host( |
| 2335 EstablishGpuChannelSync()); | 2335 EstablishGpuChannelSync()); |
| 2336 if (!gpu_channel_host) { | 2336 if (!gpu_channel_host) { |
| 2337 shared_worker_context_provider_ = nullptr; | 2337 shared_worker_context_provider_ = nullptr; |
| 2338 return shared_worker_context_provider_; | 2338 return shared_worker_context_provider_; |
| 2339 } | 2339 } |
| 2340 | 2340 |
| 2341 int32_t stream_id = gpu::GPU_STREAM_DEFAULT; | 2341 int32_t stream_id = gpu::GPU_STREAM_DEFAULT; |
| 2342 gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL; | 2342 gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL; |
| 2343 if (is_async_worker_context_enabled_) { | 2343 if (is_async_worker_context_enabled_) { |
| 2344 stream_id = gpu_channel_host->GenerateStreamID(); | 2344 stream_id = gpu::GPU_STREAM_WORKER; |
| 2345 stream_priority = gpu::GpuStreamPriority::LOW; | 2345 stream_priority = gpu::GpuStreamPriority::LOW; |
| 2346 } | 2346 } |
| 2347 | 2347 |
| 2348 bool support_locking = true; | 2348 bool support_locking = true; |
| 2349 shared_worker_context_provider_ = CreateOffscreenContext( | 2349 shared_worker_context_provider_ = CreateOffscreenContext( |
| 2350 std::move(gpu_channel_host), gpu::SharedMemoryLimits(), support_locking, | 2350 std::move(gpu_channel_host), gpu::SharedMemoryLimits(), support_locking, |
| 2351 ui::command_buffer_metrics::RENDER_WORKER_CONTEXT, stream_id, | 2351 ui::command_buffer_metrics::RENDER_WORKER_CONTEXT, stream_id, |
| 2352 stream_priority); | 2352 stream_priority); |
| 2353 if (!shared_worker_context_provider_->BindToCurrentThread()) | 2353 if (!shared_worker_context_provider_->BindToCurrentThread()) |
| 2354 shared_worker_context_provider_ = nullptr; | 2354 shared_worker_context_provider_ = nullptr; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2474 } | 2474 } |
| 2475 } | 2475 } |
| 2476 | 2476 |
| 2477 void RenderThreadImpl::OnRendererInterfaceRequest( | 2477 void RenderThreadImpl::OnRendererInterfaceRequest( |
| 2478 mojom::RendererAssociatedRequest request) { | 2478 mojom::RendererAssociatedRequest request) { |
| 2479 DCHECK(!renderer_binding_.is_bound()); | 2479 DCHECK(!renderer_binding_.is_bound()); |
| 2480 renderer_binding_.Bind(std::move(request)); | 2480 renderer_binding_.Bind(std::move(request)); |
| 2481 } | 2481 } |
| 2482 | 2482 |
| 2483 } // namespace content | 2483 } // namespace content |
| OLD | NEW |