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

Side by Side Diff: extensions/renderer/console.h

Issue 1200503002: [Extensions] Kill off ExtensionMsg_AddMessageToConsole (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « extensions/common/extension_messages.h ('k') | extensions/renderer/console.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_RENDERER_CONSOLE_H_ 5 #ifndef EXTENSIONS_RENDERER_CONSOLE_H_
6 #define EXTENSIONS_RENDERER_CONSOLE_H_ 6 #define EXTENSIONS_RENDERER_CONSOLE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/public/common/console_message_level.h" 10 #include "content/public/common/console_message_level.h"
11 #include "v8/include/v8.h" 11 #include "v8/include/v8.h"
12 12
13 namespace content { 13 namespace content {
14 class RenderView; 14 class RenderFrame;
15 } 15 }
16 16
17 namespace extensions { 17 namespace extensions {
18 18
19 // Utility for logging messages to RenderViews. 19 // Utility for logging messages to RenderFrames.
20 namespace console { 20 namespace console {
21 21
22 // Adds |message| to the console of |render_view| at various log levels. 22 // Adds |message| to the console of |render_frame|. If |render_frame| is null,
23 void Debug(content::RenderView* render_view, const std::string& message); 23 // LOG()s the message instead.
24 void Log(content::RenderView* render_view, const std::string& message); 24 void Debug(content::RenderFrame* render_frame, const std::string& message);
25 void Warn(content::RenderView* render_view, const std::string& message); 25 void Log(content::RenderFrame* render_frame, const std::string& message);
26 void Error(content::RenderView* render_view, const std::string& message); 26 void Warn(content::RenderFrame* render_frame, const std::string& message);
27 void Error(content::RenderFrame* render_frame, const std::string& message);
27 28
28 // Logs an Error then crashes the current process. 29 // Logs an Error then crashes the current process.
29 void Fatal(content::RenderView* render_view, const std::string& message); 30 void Fatal(content::RenderFrame* render_frame, const std::string& message);
30 31
31 void AddMessage(content::RenderView* render_view, 32 void AddMessage(content::RenderFrame* render_frame,
32 content::ConsoleMessageLevel level, 33 content::ConsoleMessageLevel level,
33 const std::string& message); 34 const std::string& message);
34 35
35 // Adds |message| to the console that hosts |context|, if any.
36 void Debug(v8::Local<v8::Context> context, const std::string& message);
37 void Log(v8::Local<v8::Context> context, const std::string& message);
38 void Warn(v8::Local<v8::Context> context, const std::string& message);
39 void Error(v8::Local<v8::Context> context, const std::string& message);
40
41 // Logs an Error then crashes the current process.
42 void Fatal(v8::Local<v8::Context> context, const std::string& message);
43
44 void AddMessage(v8::Local<v8::Context> context,
45 content::ConsoleMessageLevel level,
46 const std::string& message);
47
48 // Returns a new v8::Object with each standard log method (Debug/Log/Warn/Error) 36 // Returns a new v8::Object with each standard log method (Debug/Log/Warn/Error)
49 // bound to respective debug/log/warn/error methods. This is a direct drop-in 37 // bound to respective debug/log/warn/error methods. This is a direct drop-in
50 // replacement for the standard devtools console.* methods usually accessible 38 // replacement for the standard devtools console.* methods usually accessible
51 // from JS. 39 // from JS.
52 v8::Local<v8::Object> AsV8Object(v8::Isolate* isolate); 40 v8::Local<v8::Object> AsV8Object(v8::Isolate* isolate);
53 41
54 } // namespace console 42 } // namespace console
55 43
56 } // namespace extensions 44 } // namespace extensions
57 45
58 #endif // EXTENSIONS_RENDERER_CONSOLE_H_ 46 #endif // EXTENSIONS_RENDERER_CONSOLE_H_
OLDNEW
« no previous file with comments | « extensions/common/extension_messages.h ('k') | extensions/renderer/console.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698