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

Unified Diff: content/common/content_debug_logging.cc

Issue 10908078: Code to collect issue 97285 debugging info for crash reports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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: content/common/content_debug_logging.cc
diff --git a/content/common/content_debug_logging.cc b/content/common/content_debug_logging.cc
new file mode 100644
index 0000000000000000000000000000000000000000..61be531fd69f0c35efb2f96087e4ae5dc4335ce1
--- /dev/null
+++ b/content/common/content_debug_logging.cc
@@ -0,0 +1,41 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/common/content_debug_logging.h"
+
+#include "base/logging.h"
+
+namespace content {
+namespace debug {
+
+namespace {
+
+// These should be initialized by the process in main(), so should be
+// thread-safe.crbug.com
Bernhard Bauer 2012/09/05 15:04:55 Oops! Google Chrome could not find thread-safe.crb
Scott Hess - ex-Googler 2012/09/05 17:17:05 I have no idea where this came from!
+RecordMsgFn* g_record_handler = NULL;
+GetMessagesFn* g_get_handler = NULL;
+
+} // namespace
+
+void RegisterMessageHandlers(RecordMsgFn* record_handler,
+ GetMessagesFn* get_handler) {
+ g_record_handler = record_handler;
+ g_get_handler = get_handler;
+}
+
+void RecordMsg(int bug_id, const std::string& msg) {
+ DCHECK(g_record_handler);
Bernhard Bauer 2012/09/05 15:04:55 Are these the ones you want to replace with DLOG_I
Scott Hess - ex-Googler 2012/09/05 17:17:05 Yeah, pretty much. Except now I realize that havi
+ if (g_record_handler)
+ (*g_record_handler)(bug_id, msg);
+}
+
+bool GetMessages(int bug_id, std::vector<std::string>* msgs) {
+ DCHECK(g_get_handler);
+ if (g_get_handler)
+ return (*g_get_handler)(bug_id, msgs);
+ return false;
+}
+
+} // namespace debug
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698