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

Side by Side Diff: content/gpu/gpu_child_thread.cc

Issue 2112493003: Fix racing which may pause gpu process's interface registry forever (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/gpu/gpu_child_thread.h" 5 #include "content/gpu/gpu_child_thread.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 connection->GetInterfaceRegistry()->AddInterface(base::Bind( 296 connection->GetInterfaceRegistry()->AddInterface(base::Bind(
297 &GpuChildThread::BindProcessControlRequest, base::Unretained(this))); 297 &GpuChildThread::BindProcessControlRequest, base::Unretained(this)));
298 298
299 if (GetContentClient()->gpu()) { // NULL in tests. 299 if (GetContentClient()->gpu()) { // NULL in tests.
300 GetContentClient()->gpu()->ExposeInterfacesToBrowser( 300 GetContentClient()->gpu()->ExposeInterfacesToBrowser(
301 connection->GetInterfaceRegistry()); 301 connection->GetInterfaceRegistry());
302 } 302 }
303 303
304 // We don't want to process any incoming interface requests until 304 // We don't want to process any incoming interface requests until
305 // OnInitialize(). 305 // OnInitialize().
306 connection->GetInterfaceRegistry()->PauseBinding(); 306 if (!gpu_channel_manager_) {
307 resume_interface_bindings_callback_ = base::Bind( 307 connection->GetInterfaceRegistry()->PauseBinding();
308 &shell::InterfaceRegistry::ResumeBinding, 308 resume_interface_bindings_callback_ = base::Bind(
309 connection->GetInterfaceRegistry()->GetWeakPtr()); 309 &shell::InterfaceRegistry::ResumeBinding,
310 connection->GetInterfaceRegistry()->GetWeakPtr());
311 }
310 312
311 return true; 313 return true;
312 } 314 }
313 315
314 shell::InterfaceRegistry* GpuChildThread::GetInterfaceRegistryForConnection() { 316 shell::InterfaceRegistry* GpuChildThread::GetInterfaceRegistryForConnection() {
315 return nullptr; 317 return nullptr;
316 } 318 }
317 319
318 shell::InterfaceProvider* GpuChildThread::GetInterfaceProviderForConnection() { 320 shell::InterfaceProvider* GpuChildThread::GetInterfaceProviderForConnection() {
319 return nullptr; 321 return nullptr;
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 585
584 void GpuChildThread::BindProcessControlRequest( 586 void GpuChildThread::BindProcessControlRequest(
585 mojo::InterfaceRequest<mojom::ProcessControl> request) { 587 mojo::InterfaceRequest<mojom::ProcessControl> request) {
586 DVLOG(1) << "GPU: Binding ProcessControl request"; 588 DVLOG(1) << "GPU: Binding ProcessControl request";
587 DCHECK(process_control_); 589 DCHECK(process_control_);
588 process_control_bindings_.AddBinding(process_control_.get(), 590 process_control_bindings_.AddBinding(process_control_.get(),
589 std::move(request)); 591 std::move(request));
590 } 592 }
591 593
592 } // namespace content 594 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698