Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 1317533003: Revert of cc: Move worker context BindToCurrentThread/SetupLock calls out of cc::OutputSurface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Detach from thread to allow context to be destroyed on a
272 // different thread without being used.
273 shared_worker_context_provider_->DetachFromThread();
274 }
275 } 268 }
276 } 269 }
277 270
278 bool created_gpu_browser_compositor = 271 bool created_gpu_browser_compositor =
279 !!context_provider && !!shared_worker_context_provider_; 272 !!context_provider && !!shared_worker_context_provider_;
280 273
281 UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor", 274 UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor",
282 created_gpu_browser_compositor); 275 created_gpu_browser_compositor);
283 276
284 if (!created_gpu_browser_compositor) { 277 if (!created_gpu_browser_compositor) {
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 622 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
630 observer_list_, 623 observer_list_,
631 OnLostResources()); 624 OnLostResources());
632 625
633 // Kill things that use the shared context before killing the shared context. 626 // Kill things that use the shared context before killing the shared context.
634 lost_gl_helper.reset(); 627 lost_gl_helper.reset();
635 lost_shared_main_thread_contexts = NULL; 628 lost_shared_main_thread_contexts = NULL;
636 } 629 }
637 630
638 } // namespace content 631 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698