Commit dfe2976d authored by erikwright's avatar erikwright Committed by Commit bot

Remove some dead code, fix some includes and whitespace.

BUG=

Review URL: https://codereview.chromium.org/1012683003

Cr-Commit-Position: refs/heads/master@{#320732}
parent 090e2fbd
...@@ -26,10 +26,11 @@ ...@@ -26,10 +26,11 @@
#include <windows.h> #include <windows.h>
#endif #endif
#include <fstream>
#include "chrome/common/logging_chrome.h" #include "chrome/common/logging_chrome.h"
#include <fstream> // NOLINT
#include <string> // NOLINT
#include "base/command_line.h" #include "base/command_line.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/debug/debugger.h" #include "base/debug/debugger.h"
...@@ -37,14 +38,12 @@ ...@@ -37,14 +38,12 @@
#include "base/environment.h" #include "base/environment.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/logging.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
...@@ -392,35 +391,6 @@ base::FilePath GetLogFileName() { ...@@ -392,35 +391,6 @@ base::FilePath GetLogFileName() {
bool DialogsAreSuppressed() { bool DialogsAreSuppressed() {
return dialogs_are_suppressed_; return dialogs_are_suppressed_;
} }
size_t GetFatalAssertions(AssertionList* assertions) {
// In this function, we don't assume that assertions is non-null, so
// that if you just want an assertion count, you can pass in NULL.
if (assertions)
assertions->clear();
size_t assertion_count = 0;
std::ifstream log_file;
log_file.open(GetLogFileName().value().c_str());
if (!log_file.is_open())
return 0;
std::string utf8_line;
std::wstring wide_line;
while (!log_file.eof()) {
getline(log_file, utf8_line);
if (utf8_line.find(":FATAL:") != std::string::npos) {
wide_line = base::UTF8ToWide(utf8_line);
if (assertions)
assertions->push_back(wide_line);
++assertion_count;
}
}
log_file.close();
return assertion_count;
}
base::FilePath GenerateTimestampedName(const base::FilePath& base_path, base::FilePath GenerateTimestampedName(const base::FilePath& base_path,
base::Time timestamp) { base::Time timestamp) {
base::Time::Exploded time_deets; base::Time::Exploded time_deets;
......
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
#ifndef CHROME_COMMON_LOGGING_CHROME_H__ #ifndef CHROME_COMMON_LOGGING_CHROME_H__
#define CHROME_COMMON_LOGGING_CHROME_H__ #define CHROME_COMMON_LOGGING_CHROME_H__
#include <string>
#include <vector>
#include "base/logging.h" #include "base/logging.h"
#include "base/time/time.h" #include "base/time/time.h"
...@@ -51,22 +48,10 @@ void CleanupChromeLogging(); ...@@ -51,22 +48,10 @@ void CleanupChromeLogging();
// Returns the fully-qualified name of the log file. // Returns the fully-qualified name of the log file.
base::FilePath GetLogFileName(); base::FilePath GetLogFileName();
// Returns true when error/assertion dialogs are to be shown, // Returns true when error/assertion dialogs are not to be shown, false
// false otherwise. // otherwise.
bool DialogsAreSuppressed(); bool DialogsAreSuppressed();
typedef std::vector<std::wstring> AssertionList;
// Gets the list of fatal assertions in the current log file, and
// returns the number of fatal assertions. (If you don't care
// about the actual list of assertions, you can pass in NULL.)
// NOTE: Since this reads the log file to determine the assertions,
// this operation is O(n) over the length of the log.
// NOTE: This can fail if the file is locked for writing. However,
// this is unlikely as this function is most useful after
// the program writing the log has terminated.
size_t GetFatalAssertions(AssertionList* assertions);
// Inserts timestamp before file extension in the format // Inserts timestamp before file extension in the format
// "_yymmdd-hhmmss". // "_yymmdd-hhmmss".
base::FilePath GenerateTimestampedName(const base::FilePath& base_path, base::FilePath GenerateTimestampedName(const base::FilePath& base_path,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment