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

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

Issue 3750001: base: Move SplitString functions into the base namespace and update the callers. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: brett review, reverted changes in o3d due to it's using an old base revision Created 10 years, 2 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 // Validate the message. The shortest message is kStartToken\0x\0x 703 // Validate the message. The shortest message is kStartToken\0x\0x
704 const size_t kMinMessageLength = arraysize(kStartToken) + 4; 704 const size_t kMinMessageLength = arraysize(kStartToken) + 4;
705 if (bytes_read_ < kMinMessageLength) { 705 if (bytes_read_ < kMinMessageLength) {
706 buf_[bytes_read_] = 0; 706 buf_[bytes_read_] = 0;
707 LOG(ERROR) << "Invalid socket message (wrong length):" << buf_; 707 LOG(ERROR) << "Invalid socket message (wrong length):" << buf_;
708 return; 708 return;
709 } 709 }
710 710
711 std::string str(buf_, bytes_read_); 711 std::string str(buf_, bytes_read_);
712 std::vector<std::string> tokens; 712 std::vector<std::string> tokens;
713 SplitString(str, kTokenDelimiter, &tokens); 713 base::SplitString(str, kTokenDelimiter, &tokens);
714 714
715 if (tokens.size() < 3 || tokens[0] != kStartToken) { 715 if (tokens.size() < 3 || tokens[0] != kStartToken) {
716 LOG(ERROR) << "Wrong message format: " << str; 716 LOG(ERROR) << "Wrong message format: " << str;
717 return; 717 return;
718 } 718 }
719 719
720 // Stop the expiration timer to prevent this SocketReader object from being 720 // Stop the expiration timer to prevent this SocketReader object from being
721 // terminated unexpectly. 721 // terminated unexpectly.
722 timer_.Stop(); 722 timer_.Stop();
723 723
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 sock)); 989 sock));
990 990
991 return true; 991 return true;
992 } 992 }
993 993
994 void ProcessSingleton::Cleanup() { 994 void ProcessSingleton::Cleanup() {
995 UnlinkPath(socket_path_.value()); 995 UnlinkPath(socket_path_.value());
996 UnlinkPath(cookie_path_.value()); 996 UnlinkPath(cookie_path_.value());
997 UnlinkPath(lock_path_.value()); 997 UnlinkPath(lock_path_.value());
998 } 998 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_form_manager.cc ('k') | chrome/browser/safe_browsing/chunk_range.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698