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

Side by Side Diff: content/browser/renderer_host/render_sandbox_host_linux.cc

Issue 143403003: Let the process have more than one thread under ThreadSanitizer in RenderSandboxHostLinux::Init Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« 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/browser/renderer_host/render_sandbox_host_linux.h" 5 #include "content/browser/renderer_host/render_sandbox_host_linux.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <fontconfig/fontconfig.h> 8 #include <fontconfig/fontconfig.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <sys/poll.h> 10 #include <sys/poll.h>
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 702
703 renderer_socket_ = fds[0]; 703 renderer_socket_ = fds[0];
704 const int browser_socket = fds[1]; 704 const int browser_socket = fds[1];
705 705
706 int pipefds[2]; 706 int pipefds[2];
707 CHECK(0 == pipe(pipefds)); 707 CHECK(0 == pipe(pipefds));
708 const int child_lifeline_fd = pipefds[0]; 708 const int child_lifeline_fd = pipefds[0];
709 childs_lifeline_fd_ = pipefds[1]; 709 childs_lifeline_fd_ = pipefds[1];
710 710
711 // We need to be monothreaded before we fork(). 711 // We need to be monothreaded before we fork().
712 #if !defined(TOOLKIT_GTK) 712 #if !defined(TOOLKIT_GTK) && !defined(THREAD_SANITIZER)
713 // Exclude gtk port as TestSuite in base/tests/test_suite.cc is calling 713 // Exclude gtk port as TestSuite in base/tests/test_suite.cc is calling
714 // gtk_init. 714 // gtk_init.
715 // TODO(oshima): Remove ifdef when above issues are resolved. 715 // TODO(oshima): Remove the TOOLKIT_GTK ifdef when above issues are resolved.
716 // ThreadSanitizer spawns its own background thread.
716 DCHECK_EQ(1, base::GetNumberOfThreads(base::GetCurrentProcessHandle())); 717 DCHECK_EQ(1, base::GetNumberOfThreads(base::GetCurrentProcessHandle()));
717 #endif 718 #endif
718 pid_ = fork(); 719 pid_ = fork();
719 if (pid_ == 0) { 720 if (pid_ == 0) {
720 if (IGNORE_EINTR(close(fds[0])) < 0) 721 if (IGNORE_EINTR(close(fds[0])) < 0)
721 DPLOG(ERROR) << "close"; 722 DPLOG(ERROR) << "close";
722 if (IGNORE_EINTR(close(pipefds[1])) < 0) 723 if (IGNORE_EINTR(close(pipefds[1])) < 0)
723 DPLOG(ERROR) << "close"; 724 DPLOG(ERROR) << "close";
724 725
725 SandboxIPCProcess handler(child_lifeline_fd, browser_socket, sandbox_path); 726 SandboxIPCProcess handler(child_lifeline_fd, browser_socket, sandbox_path);
726 handler.Run(); 727 handler.Run();
727 _exit(0); 728 _exit(0);
728 } 729 }
729 } 730 }
730 731
731 RenderSandboxHostLinux::~RenderSandboxHostLinux() { 732 RenderSandboxHostLinux::~RenderSandboxHostLinux() {
732 if (initialized_) { 733 if (initialized_) {
733 if (IGNORE_EINTR(close(renderer_socket_)) < 0) 734 if (IGNORE_EINTR(close(renderer_socket_)) < 0)
734 PLOG(ERROR) << "close"; 735 PLOG(ERROR) << "close";
735 if (IGNORE_EINTR(close(childs_lifeline_fd_)) < 0) 736 if (IGNORE_EINTR(close(childs_lifeline_fd_)) < 0)
736 PLOG(ERROR) << "close"; 737 PLOG(ERROR) << "close";
737 } 738 }
738 } 739 }
739 740
740 } // namespace content 741 } // 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