| 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 // On Linux, when the user tries to launch a second copy of chrome, we check | 5 // On Linux, when the user tries to launch a second copy of chrome, we check |
| 6 // for a socket in the user's profile directory. If the socket file is open we | 6 // for a socket in the user's profile directory. If the socket file is open we |
| 7 // send a message to the first chrome browser process with the current | 7 // send a message to the first chrome browser process with the current |
| 8 // directory and second process command line flags. The second process then | 8 // directory and second process command line flags. The second process then |
| 9 // exits. | 9 // exits. |
| 10 // | 10 // |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 watcher_(new LinuxWatcher(this)) { | 747 watcher_(new LinuxWatcher(this)) { |
| 748 socket_path_ = user_data_dir.Append(chrome::kSingletonSocketFilename); | 748 socket_path_ = user_data_dir.Append(chrome::kSingletonSocketFilename); |
| 749 lock_path_ = user_data_dir.Append(chrome::kSingletonLockFilename); | 749 lock_path_ = user_data_dir.Append(chrome::kSingletonLockFilename); |
| 750 cookie_path_ = user_data_dir.Append(chrome::kSingletonCookieFilename); | 750 cookie_path_ = user_data_dir.Append(chrome::kSingletonCookieFilename); |
| 751 | 751 |
| 752 kill_callback_ = base::Bind(&ProcessSingleton::KillProcess, | 752 kill_callback_ = base::Bind(&ProcessSingleton::KillProcess, |
| 753 base::Unretained(this)); | 753 base::Unretained(this)); |
| 754 } | 754 } |
| 755 | 755 |
| 756 ProcessSingleton::~ProcessSingleton() { | 756 ProcessSingleton::~ProcessSingleton() { |
| 757 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 757 } | 758 } |
| 758 | 759 |
| 759 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() { | 760 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() { |
| 760 return NotifyOtherProcessWithTimeout( | 761 return NotifyOtherProcessWithTimeout( |
| 761 *base::CommandLine::ForCurrentProcess(), kRetryAttempts, | 762 *base::CommandLine::ForCurrentProcess(), kRetryAttempts, |
| 762 base::TimeDelta::FromSeconds(kTimeoutInSeconds), true); | 763 base::TimeDelta::FromSeconds(kTimeoutInSeconds), true); |
| 763 } | 764 } |
| 764 | 765 |
| 765 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout( | 766 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout( |
| 766 const base::CommandLine& cmd_line, | 767 const base::CommandLine& cmd_line, |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 case EPERM: | 1132 case EPERM: |
| 1132 action = TERMINATE_NOT_ENOUGH_PERMISSIONS; | 1133 action = TERMINATE_NOT_ENOUGH_PERMISSIONS; |
| 1133 break; | 1134 break; |
| 1134 default: | 1135 default: |
| 1135 action = TERMINATE_FAILED; | 1136 action = TERMINATE_FAILED; |
| 1136 break; | 1137 break; |
| 1137 } | 1138 } |
| 1138 } | 1139 } |
| 1139 SendRemoteProcessInteractionResultHistogram(action); | 1140 SendRemoteProcessInteractionResultHistogram(action); |
| 1140 } | 1141 } |
| OLD | NEW |