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

Side by Side Diff: third_party/leveldatabase/env_chromium_win.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 | « rlz/lib/rlz_lib.cc ('k') | tools/gn/input_conversion.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) 2013 The LevelDB Authors. All rights reserved. 1 // Copyright (c) 2013 The LevelDB 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. See the AUTHORS file for names of contributors. 3 // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 4
5 #include "base/debug/trace_event.h" 5 #include "base/debug/trace_event.h"
6 #include "base/files/file.h" 6 #include "base/files/file.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/win/win_util.h" 9 #include "base/win/win_util.h"
10 #include "chromium_logger.h" 10 #include "chromium_logger.h"
(...skipping 12 matching lines...) Expand all
23 FORMAT_MESSAGE_IGNORE_INSERTS, 23 FORMAT_MESSAGE_IGNORE_INSERTS,
24 NULL, 24 NULL,
25 err, 25 err,
26 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 26 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
27 (LPTSTR) & errorText, 27 (LPTSTR) & errorText,
28 0, 28 0,
29 NULL); 29 NULL);
30 if (errorText != NULL) { 30 if (errorText != NULL) {
31 std::string message(base::UTF16ToUTF8(errorText)); 31 std::string message(base::UTF16ToUTF8(errorText));
32 // FormatMessage adds CR/LF to messages so we remove it. 32 // FormatMessage adds CR/LF to messages so we remove it.
33 TrimWhitespace(message, TRIM_TRAILING, &message); 33 base::TrimWhitespace(message, base::TRIM_TRAILING, &message);
34 LocalFree(errorText); 34 LocalFree(errorText);
35 return message; 35 return message;
36 } else { 36 } else {
37 return std::string(); 37 return std::string();
38 } 38 }
39 } 39 }
40 40
41 class ChromiumSequentialFileWin : public SequentialFile { 41 class ChromiumSequentialFileWin : public SequentialFile {
42 private: 42 private:
43 std::string filename_; 43 std::string filename_;
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 return Status::OK(); 346 return Status::OK();
347 } 347 }
348 } 348 }
349 349
350 void ChromiumEnvWin::RecordOSError(MethodID method, DWORD error) const { 350 void ChromiumEnvWin::RecordOSError(MethodID method, DWORD error) const {
351 RecordErrorAt(method); 351 RecordErrorAt(method);
352 GetOSErrorHistogram(method, ERANGE + 1)->Add(error); 352 GetOSErrorHistogram(method, ERANGE + 1)->Add(error);
353 } 353 }
354 354
355 } // namespace leveldb_env 355 } // namespace leveldb_env
OLDNEW
« no previous file with comments | « rlz/lib/rlz_lib.cc ('k') | tools/gn/input_conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698