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

Side by Side Diff: content/child/child_thread_impl.cc

Issue 1960513002: [Merge to M50] IPC: Fix attachment brokering race condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 7 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 (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/child/child_thread_impl.h" 5 #include "content/child/child_thread_impl.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 444
445 #if defined(USE_OZONE) 445 #if defined(USE_OZONE)
446 channel_->AddFilter(new ClientNativePixmapFactoryFilter()); 446 channel_->AddFilter(new ClientNativePixmapFactoryFilter());
447 #endif 447 #endif
448 448
449 // Add filters passed here via options. 449 // Add filters passed here via options.
450 for (auto startup_filter : options.startup_filters) { 450 for (auto startup_filter : options.startup_filters) {
451 channel_->AddFilter(startup_filter); 451 channel_->AddFilter(startup_filter);
452 } 452 }
453 453
454 ConnectChannel(options.use_mojo_channel);
455 IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal(); 454 IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal();
456 if (broker && !broker->IsPrivilegedBroker()) 455 if (broker && !broker->IsPrivilegedBroker())
457 broker->RegisterBrokerCommunicationChannel(channel_.get()); 456 broker->RegisterBrokerCommunicationChannel(channel_.get());
457 ConnectChannel(options.use_mojo_channel);
458 458
459 int connection_timeout = kConnectionTimeoutS; 459 int connection_timeout = kConnectionTimeoutS;
460 std::string connection_override = 460 std::string connection_override =
461 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 461 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
462 switches::kIPCConnectionTimeout); 462 switches::kIPCConnectionTimeout);
463 if (!connection_override.empty()) { 463 if (!connection_override.empty()) {
464 int temp; 464 int temp;
465 if (base::StringToInt(connection_override, &temp)) 465 if (base::StringToInt(connection_override, &temp))
466 connection_timeout = temp; 466 connection_timeout = temp;
467 } 467 }
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 void ChildThreadImpl::EnsureConnected() { 728 void ChildThreadImpl::EnsureConnected() {
729 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; 729 VLOG(0) << "ChildThreadImpl::EnsureConnected()";
730 base::Process::Current().Terminate(0, false); 730 base::Process::Current().Terminate(0, false);
731 } 731 }
732 732
733 bool ChildThreadImpl::IsInBrowserProcess() const { 733 bool ChildThreadImpl::IsInBrowserProcess() const {
734 return browser_process_io_runner_; 734 return browser_process_io_runner_;
735 } 735 }
736 736
737 } // namespace content 737 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/common/child_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698