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

Unified Diff: extensions/renderer/script_context.h

Issue 2819683002: [Extenisons Bindings] Don't throw unchecked errors; add console errors (Closed)
Patch Set: . Created 3 years, 8 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: extensions/renderer/script_context.h
diff --git a/extensions/renderer/script_context.h b/extensions/renderer/script_context.h
index 43b511478070024808a6e7bdb83dbf349d140b6a..bb9945d2fcd139d77fb4d8823fabff0a915d0bbb 100644
--- a/extensions/renderer/script_context.h
+++ b/extensions/renderer/script_context.h
@@ -14,6 +14,7 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/threading/thread_checker.h"
+#include "content/public/common/console_message_level.h"
#include "extensions/common/features/feature.h"
#include "extensions/common/permissions/api_permission_set.h"
#include "extensions/renderer/module_system.h"
@@ -212,6 +213,11 @@ class ScriptContext : public RequestSender::Source {
// no exception thrown), false if it does not (i.e. an exception was thrown).
bool HasAccessOrThrowError(const std::string& name);
+ // Adds a message to the associated RenderFrame's console. If there is no
+ // RenderFrame, LOG()s the message instead.
+ void AddMessageToConsole(content::ConsoleMessageLevel level,
+ const std::string& message);
+
// Returns a string representation of this ScriptContext, for debugging.
std::string GetDebugString() const;

Powered by Google App Engine
This is Rietveld 408576698