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

Side by Side Diff: chrome/install_static/install_util.cc

Issue 2123073002: Switch chrome_elf exception handling from breakpad to crashpad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to tip and git cl format Created 4 years, 5 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
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | chrome_elf/BUILD.gn » ('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 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 #include "chrome/install_static/install_util.h" 5 #include "chrome/install_static/install_util.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <assert.h> 8 #include <assert.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <iostream> 10 #include <iostream>
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 // Here it means that both versions are equal. 811 // Here it means that both versions are equal.
812 *result = 0; 812 *result = 0;
813 return true; 813 return true;
814 } 814 }
815 815
816 std::string GetSwitchValueFromCommandLine(const std::string& command_line, 816 std::string GetSwitchValueFromCommandLine(const std::string& command_line,
817 const std::string& switch_name) { 817 const std::string& switch_name) {
818 assert(!command_line.empty()); 818 assert(!command_line.empty());
819 assert(!switch_name.empty()); 819 assert(!switch_name.empty());
820 820
821 // We don't handle command lines with quoted strings. For e.g. something like
822 // --ignored=" --type=renderer ", which we used for Google Desktop.
823 if (command_line.find('"') != std::string::npos) {
824 assert(false);
825 return std::string();
826 }
827
828 std::string command_line_copy = command_line; 821 std::string command_line_copy = command_line;
829 // Remove leading and trailing spaces. 822 // Remove leading and trailing spaces.
830 TrimT<std::string>(&command_line_copy); 823 TrimT<std::string>(&command_line_copy);
831 824
832 // Find the switch in the command line. If we don't find the switch, return 825 // Find the switch in the command line. If we don't find the switch, return
833 // an empty string. 826 // an empty string.
834 std::string switch_token = "--"; 827 std::string switch_token = "--";
835 switch_token += switch_name; 828 switch_token += switch_name;
836 switch_token += "="; 829 switch_token += "=";
837 size_t switch_offset = command_line_copy.find(switch_token); 830 size_t switch_offset = command_line_copy.find(switch_token);
(...skipping 18 matching lines...) Expand all
856 switch_value_end_offset = command_line_copy.length(); 849 switch_value_end_offset = command_line_copy.length();
857 850
858 std::string switch_value = command_line_copy.substr( 851 std::string switch_value = command_line_copy.substr(
859 switch_value_start_offset, 852 switch_value_start_offset,
860 switch_value_end_offset - (switch_offset + switch_token.length())); 853 switch_value_end_offset - (switch_offset + switch_token.length()));
861 TrimT<std::string>(&switch_value); 854 TrimT<std::string>(&switch_value);
862 return switch_value; 855 return switch_value;
863 } 856 }
864 857
865 } // namespace install_static 858 } // namespace install_static
OLDNEW
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | chrome_elf/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698