OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |