Index: chrome/renderer/extensions/console.h |
diff --git a/chrome/renderer/extensions/console.h b/chrome/renderer/extensions/console.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c4018cfe39adf5b7f53ff5c16834b6fb6189795a |
--- /dev/null |
+++ b/chrome/renderer/extensions/console.h |
@@ -0,0 +1,46 @@ |
+// Copyright 2013 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. |
+ |
+#ifndef CHROME_RENDERER_EXTENSIONS_CONSOLE_H_ |
+#define CHROME_RENDERER_EXTENSIONS_CONSOLE_H_ |
+ |
+#include <string> |
+ |
+#include "content/public/common/console_message_level.h" |
+#include "v8/include/v8.h" |
+ |
+namespace content { |
+class RenderView; |
+} |
+ |
+namespace extensions { |
+ |
+// Utility for logging messages to RenderViews. |
+namespace console { |
+ |
+// Adds |message| to the console of |render_view| at various log levels. |
+void Debug(content::RenderView* render_view, const std::string& message); |
+void Log(content::RenderView* render_view, const std::string& message); |
+void Warn(content::RenderView* render_view, const std::string& message); |
+void Error(content::RenderView* render_view, const std::string& message); |
+ |
+void AddMessage(content::RenderView* render_view, |
+ content::ConsoleMessageLevel level, |
+ const std::string& message); |
+ |
+// Adds |message| to the console that hosts |context|, if any. |
+void Debug(v8::Handle<v8::Context> context, const std::string& message); |
+void Log(v8::Handle<v8::Context> context, const std::string& message); |
+void Warn(v8::Handle<v8::Context> context, const std::string& message); |
+void Error(v8::Handle<v8::Context> context, const std::string& message); |
+ |
+void AddMessage(v8::Handle<v8::Context> context, |
+ content::ConsoleMessageLevel level, |
+ const std::string& message); |
+ |
+} // namespace console |
+ |
+} // namespace extensions |
+ |
+#endif // CHROME_RENDERER_EXTENSIONS_CONSOLE_H_ |