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

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

Issue 7825026: Revert "Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/printing/print_view_manager.cc ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 SocketReader(ProcessSingleton::LinuxWatcher* parent, 463 SocketReader(ProcessSingleton::LinuxWatcher* parent,
464 MessageLoop* ui_message_loop, 464 MessageLoop* ui_message_loop,
465 int fd) 465 int fd)
466 : parent_(parent), 466 : parent_(parent),
467 ui_message_loop_(ui_message_loop), 467 ui_message_loop_(ui_message_loop),
468 fd_(fd), 468 fd_(fd),
469 bytes_read_(0) { 469 bytes_read_(0) {
470 // Wait for reads. 470 // Wait for reads.
471 MessageLoopForIO::current()->WatchFileDescriptor( 471 MessageLoopForIO::current()->WatchFileDescriptor(
472 fd, true, MessageLoopForIO::WATCH_READ, &fd_reader_, this); 472 fd, true, MessageLoopForIO::WATCH_READ, &fd_reader_, this);
473 timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(kTimeoutInSeconds), 473 timer_.Start(base::TimeDelta::FromSeconds(kTimeoutInSeconds),
474 this, &SocketReader::OnTimerExpiry); 474 this, &SocketReader::OnTimerExpiry);
475 } 475 }
476 476
477 virtual ~SocketReader() { 477 virtual ~SocketReader() {
478 CloseSocket(fd_); 478 CloseSocket(fd_);
479 } 479 }
480 480
481 // MessageLoopForIO::Watcher impl. 481 // MessageLoopForIO::Watcher impl.
482 virtual void OnFileCanReadWithoutBlocking(int fd); 482 virtual void OnFileCanReadWithoutBlocking(int fd);
483 virtual void OnFileCanWriteWithoutBlocking(int fd) { 483 virtual void OnFileCanWriteWithoutBlocking(int fd) {
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 sock)); 981 sock));
982 982
983 return true; 983 return true;
984 } 984 }
985 985
986 void ProcessSingleton::Cleanup() { 986 void ProcessSingleton::Cleanup() {
987 UnlinkPath(socket_path_); 987 UnlinkPath(socket_path_);
988 UnlinkPath(cookie_path_); 988 UnlinkPath(cookie_path_);
989 UnlinkPath(lock_path_); 989 UnlinkPath(lock_path_);
990 } 990 }
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_view_manager.cc ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698