OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/compositor/gpu_process_transport_factory.h" | 5 #include "content/browser/compositor/gpu_process_transport_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 if (context_provider && !context_provider->BindToCurrentThread()) | 258 if (context_provider && !context_provider->BindToCurrentThread()) |
259 context_provider = nullptr; | 259 context_provider = nullptr; |
260 if (!shared_worker_context_provider_) { | 260 if (!shared_worker_context_provider_) { |
261 shared_worker_context_provider_ = ContextProviderCommandBuffer::Create( | 261 shared_worker_context_provider_ = ContextProviderCommandBuffer::Create( |
262 GpuProcessTransportFactory::CreateContextCommon(gpu_channel_host, | 262 GpuProcessTransportFactory::CreateContextCommon(gpu_channel_host, |
263 0), | 263 0), |
264 BROWSER_WORKER_CONTEXT); | 264 BROWSER_WORKER_CONTEXT); |
265 if (shared_worker_context_provider_ && | 265 if (shared_worker_context_provider_ && |
266 !shared_worker_context_provider_->BindToCurrentThread()) | 266 !shared_worker_context_provider_->BindToCurrentThread()) |
267 shared_worker_context_provider_ = nullptr; | 267 shared_worker_context_provider_ = nullptr; |
268 | |
269 if (shared_worker_context_provider_) { | |
270 shared_worker_context_provider_->SetupLock(); | |
271 shared_worker_context_provider_->DetachFromThread(); | |
danakj
2015/08/26 18:48:50
Please comment and explain
reveman
2015/08/26 22:02:11
Done.
| |
272 } | |
268 } | 273 } |
269 } | 274 } |
270 | 275 |
271 bool created_gpu_browser_compositor = | 276 bool created_gpu_browser_compositor = |
272 !!context_provider && !!shared_worker_context_provider_; | 277 !!context_provider && !!shared_worker_context_provider_; |
273 | 278 |
274 UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor", | 279 UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor", |
275 created_gpu_browser_compositor); | 280 created_gpu_browser_compositor); |
276 | 281 |
277 if (!created_gpu_browser_compositor) { | 282 if (!created_gpu_browser_compositor) { |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
622 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 627 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
623 observer_list_, | 628 observer_list_, |
624 OnLostResources()); | 629 OnLostResources()); |
625 | 630 |
626 // Kill things that use the shared context before killing the shared context. | 631 // Kill things that use the shared context before killing the shared context. |
627 lost_gl_helper.reset(); | 632 lost_gl_helper.reset(); |
628 lost_shared_main_thread_contexts = NULL; | 633 lost_shared_main_thread_contexts = NULL; |
629 } | 634 } |
630 | 635 |
631 } // namespace content | 636 } // namespace content |
OLD | NEW |