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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_database_unittest.cc

Issue 2497833002: support multiple log message handlers in base/logging.h (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
index 31168452cfb31436e51ab2a77745223911145e36..1da4b97cb46ec57832fa0f7c2f508c7c11984093 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -216,17 +216,15 @@ std::unique_ptr<SBChunkData> AddChunkHashedIpValue(int chunk_number,
class ScopedLogMessageIgnorer {
public:
ScopedLogMessageIgnorer() {
- logging::SetLogMessageHandler(&LogMessageIgnorer);
+ logging::AddLogMessageHandler(&LogMessageIgnorer);
}
~ScopedLogMessageIgnorer() {
- // TODO(shess): Would be better to verify whether anyone else
- // changed it, and then restore it to the previous value.
- logging::SetLogMessageHandler(NULL);
+ logging::RemoveLogMessageHandler(&LogMessageIgnorer);
}
private:
- static bool LogMessageIgnorer(int severity, const char* file, int line,
- size_t message_start, const std::string& str) {
+ static bool LogMessageIgnorer(int severity, const std::string& file, int line,
+ const std::string& str) {
// Intercept FATAL, strip the stack backtrace, and log it without
// the crash part.
if (severity == logging::LOG_FATAL) {
« no previous file with comments | « chrome/browser/media/webrtc/webrtc_browsertest_base.cc ('k') | chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698