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

Unified Diff: base/syslog_logging.cc

Issue 2946983002: Move eventlog_provider from //base/win to //chrome/common/win (Closed)
Patch Set: Add dep to chrome:common Created 3 years, 6 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: base/syslog_logging.cc
diff --git a/base/syslog_logging.cc b/base/syslog_logging.cc
index 087b4fd4543195d14bc38b040e58ec5314436f39..360a48a07eec633fcb7855132224e371c20244d0 100644
--- a/base/syslog_logging.cc
+++ b/base/syslog_logging.cc
@@ -6,11 +6,9 @@
#include "base/syslog_logging.h"
grt (UTC plus 2) 2017/06/21 20:26:15 nit: this should be the first include with a blank
proberge 2017/06/21 21:33:39 Done.
#if defined(OS_WIN)
+#include <stddef.h>
grt (UTC plus 2) 2017/06/21 20:26:15 why is this needed?
proberge 2017/06/21 21:33:38 I think I was trying to get WORD/DWORD defined. Re
#include "base/bind.h"
#include "base/callback_helpers.h"
-#include "base/win/eventlog_messages.h"
-
-#include <windows.h>
#elif defined(OS_LINUX)
#include <syslog.h>
#endif
@@ -25,11 +23,15 @@ namespace logging {
namespace {
std::string* g_event_source_name = nullptr;
grt (UTC plus 2) 2017/06/21 20:26:15 now that there's more than one thing in here, plea
proberge 2017/06/21 21:33:38 Done.
+WORD g_category;
grt (UTC plus 2) 2017/06/21 20:26:15 please zero-initialize these
proberge 2017/06/21 21:33:38 Done.
+DWORD g_event_id;
}
grt (UTC plus 2) 2017/06/21 20:26:15 nit: } // namespace
proberge 2017/06/21 21:33:38 Done.
-void SetEventSourceName(const std::string& name) {
+void SetEventSource(const std::string& name, WORD category, DWORD event_id) {
DCHECK_EQ(nullptr, g_event_source_name);
g_event_source_name = new std::string(name);
+ g_category = category;
+ g_event_id = event_id;
}
#endif // defined(OS_WIN)
grt (UTC plus 2) 2017/06/21 20:26:15 nit: blank line before this
proberge 2017/06/21 21:33:38 Done.
@@ -75,8 +77,8 @@ EventLogMessage::~EventLogMessage() {
break;
}
LPCSTR strings[1] = {message.data()};
- if (!ReportEventA(event_log_handle, log_type, BROWSER_CATEGORY,
- MSG_LOG_MESSAGE, NULL, 1, 0, strings, NULL)) {
+ if (!ReportEventA(event_log_handle, log_type, g_category, g_event_id, NULL, 1,
grt (UTC plus 2) 2017/06/21 20:26:15 NULL -> nullptr throughout
proberge 2017/06/21 21:33:38 Done.
+ 0, strings, NULL)) {
stream() << " !!NOT ADDED TO EVENTLOG!!";
}
#elif defined(OS_LINUX)

Powered by Google App Engine
This is Rietveld 408576698