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

Side by Side Diff: base/linux_util.cc

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « base/i18n/file_util_icu.cc ('k') | base/nix/mime_util_xdg.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/linux_util.h" 5 #include "base/linux_util.h"
6 6
7 #include <dirent.h> 7 #include <dirent.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <stdlib.h> 10 #include <stdlib.h>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 distro_state_singleton->CheckFinished(); 169 distro_state_singleton->CheckFinished();
170 return g_linux_distro; 170 return g_linux_distro;
171 #else 171 #else
172 NOTIMPLEMENTED(); 172 NOTIMPLEMENTED();
173 return "Unknown"; 173 return "Unknown";
174 #endif 174 #endif
175 } 175 }
176 176
177 void SetLinuxDistro(const std::string& distro) { 177 void SetLinuxDistro(const std::string& distro) {
178 std::string trimmed_distro; 178 std::string trimmed_distro;
179 TrimWhitespaceASCII(distro, TRIM_ALL, &trimmed_distro); 179 base::TrimWhitespaceASCII(distro, base::TRIM_ALL, &trimmed_distro);
180 base::strlcpy(g_linux_distro, trimmed_distro.c_str(), kDistroSize); 180 base::strlcpy(g_linux_distro, trimmed_distro.c_str(), kDistroSize);
181 } 181 }
182 182
183 bool FileDescriptorGetInode(ino_t* inode_out, int fd) { 183 bool FileDescriptorGetInode(ino_t* inode_out, int fd) {
184 DCHECK(inode_out); 184 DCHECK(inode_out);
185 185
186 struct stat buf; 186 struct stat buf;
187 if (fstat(fd, &buf) < 0) 187 if (fstat(fd, &buf) < 0)
188 return false; 188 return false;
189 189
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), 295 if (0 == strncmp(expected_data.c_str(), syscall_data.get(),
296 expected_data.length())) { 296 expected_data.length())) {
297 return current_tid; 297 return current_tid;
298 } 298 }
299 } 299 }
300 return -1; 300 return -1;
301 } 301 }
302 302
303 } // namespace base 303 } // namespace base
OLDNEW
« no previous file with comments | « base/i18n/file_util_icu.cc ('k') | base/nix/mime_util_xdg.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698