Chromium Code Reviews| 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 |