OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_RENDERER_EXTENSIONS_CONSOLE_H_ |
| 6 #define CHROME_RENDERER_EXTENSIONS_CONSOLE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "content/public/common/console_message_level.h" |
| 11 #include "v8/include/v8.h" |
| 12 |
| 13 namespace content { |
| 14 class RenderView; |
| 15 } |
| 16 |
| 17 namespace extensions { |
| 18 |
| 19 // Utility for logging messages to RenderViews. |
| 20 namespace console { |
| 21 |
| 22 // Adds |message| to the console of |render_view| at various log levels. |
| 23 void Debug(content::RenderView* render_view, const std::string& message); |
| 24 void Log(content::RenderView* render_view, const std::string& message); |
| 25 void Warn(content::RenderView* render_view, const std::string& message); |
| 26 void Error(content::RenderView* render_view, const std::string& message); |
| 27 |
| 28 void AddMessage(content::RenderView* render_view, |
| 29 content::ConsoleMessageLevel level, |
| 30 const std::string& message); |
| 31 |
| 32 // Adds |message| to the console that hosts |context|, if any. |
| 33 void Debug(v8::Handle<v8::Context> context, const std::string& message); |
| 34 void Log(v8::Handle<v8::Context> context, const std::string& message); |
| 35 void Warn(v8::Handle<v8::Context> context, const std::string& message); |
| 36 void Error(v8::Handle<v8::Context> context, const std::string& message); |
| 37 |
| 38 void AddMessage(v8::Handle<v8::Context> context, |
| 39 content::ConsoleMessageLevel level, |
| 40 const std::string& message); |
| 41 |
| 42 } // namespace console |
| 43 |
| 44 } // namespace extensions |
| 45 |
| 46 #endif // CHROME_RENDERER_EXTENSIONS_CONSOLE_H_ |
OLD | NEW |