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

Side by Side Diff: chrome/browser/process_singleton_posix.cc

Issue 2283373002: Remove unneeded scoped_refptr<>::get() on method binding (Closed)
Patch Set: Created 4 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 // 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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 } 1001 }
1002 1002
1003 if (listen(sock, 5) < 0) 1003 if (listen(sock, 5) < 0)
1004 NOTREACHED() << "listen failed: " << base::safe_strerror(errno); 1004 NOTREACHED() << "listen failed: " << base::safe_strerror(errno);
1005 1005
1006 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::IO)); 1006 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::IO));
1007 BrowserThread::PostTask( 1007 BrowserThread::PostTask(
1008 BrowserThread::IO, 1008 BrowserThread::IO,
1009 FROM_HERE, 1009 FROM_HERE,
1010 base::Bind(&ProcessSingleton::LinuxWatcher::StartListening, 1010 base::Bind(&ProcessSingleton::LinuxWatcher::StartListening,
1011 watcher_.get(), 1011 watcher_,
1012 sock)); 1012 sock));
1013 1013
1014 return true; 1014 return true;
1015 } 1015 }
1016 1016
1017 void ProcessSingleton::Cleanup() { 1017 void ProcessSingleton::Cleanup() {
1018 UnlinkPath(socket_path_); 1018 UnlinkPath(socket_path_);
1019 UnlinkPath(cookie_path_); 1019 UnlinkPath(cookie_path_);
1020 UnlinkPath(lock_path_); 1020 UnlinkPath(lock_path_);
1021 } 1021 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 } 1055 }
1056 1056
1057 void ProcessSingleton::KillProcess(int pid) { 1057 void ProcessSingleton::KillProcess(int pid) {
1058 // TODO(james.su@gmail.com): Is SIGKILL ok? 1058 // TODO(james.su@gmail.com): Is SIGKILL ok?
1059 int rv = kill(static_cast<base::ProcessHandle>(pid), SIGKILL); 1059 int rv = kill(static_cast<base::ProcessHandle>(pid), SIGKILL);
1060 // ESRCH = No Such Process (can happen if the other process is already in 1060 // ESRCH = No Such Process (can happen if the other process is already in
1061 // progress of shutting down and finishes before we try to kill it). 1061 // progress of shutting down and finishes before we try to kill it).
1062 DCHECK(rv == 0 || errno == ESRCH) << "Error killing process: " 1062 DCHECK(rv == 0 || errno == ESRCH) << "Error killing process: "
1063 << base::safe_strerror(errno); 1063 << base::safe_strerror(errno);
1064 } 1064 }
OLDNEW
« no previous file with comments | « chrome/browser/process_singleton_browsertest.cc ('k') | chrome/browser/safe_browsing/safe_browsing_blocking_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698