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

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

Issue 2034393004: Allow multiple logging::LogMessage{Handler,Listener}s Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert slow, try adding back handlers Created 3 years, 12 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 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..6c8d844cdfc34fae103dbab541cbb4b66d38645b 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -213,20 +213,12 @@ std::unique_ptr<SBChunkData> AddChunkHashedIpValue(int chunk_number,
// Prevent DCHECK from killing tests.
// TODO(shess): Pawel disputes the use of this, so the test which uses
// it is DISABLED. http://crbug.com/56448
-class ScopedLogMessageIgnorer {
- public:
- ScopedLogMessageIgnorer() {
- logging::SetLogMessageHandler(&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);
- }
-
- private:
- static bool LogMessageIgnorer(int severity, const char* file, int line,
- size_t message_start, const std::string& str) {
+class ScopedLogMessageIgnorer : logging::LogMessageHandler {
grt (UTC plus 2) 2017/01/04 09:12:20 public inheritance and " public:" in the body
+ bool OnMessage(int severity,
+ const char* file,
+ int line,
+ size_t message_start,
+ const std::string& str) override {
// Intercept FATAL, strip the stack backtrace, and log it without
// the crash part.
if (severity == logging::LOG_FATAL) {

Powered by Google App Engine
This is Rietveld 408576698