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

Unified Diff: extensions/renderer/module_system.cc

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, 6 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
« no previous file with comments | « extensions/renderer/extension_helper.cc ('k') | extensions/renderer/object_backed_native_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/module_system.cc
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
index 6615ea1e8c54d77cef1cd946d1270c3af56025ff..754ac1cf812af3f98e9e5f3493801b2a419968df 100644
--- a/extensions/renderer/module_system.cc
+++ b/extensions/renderer/module_system.cc
@@ -18,6 +18,7 @@
#include "extensions/renderer/console.h"
#include "extensions/renderer/safe_builtins.h"
#include "extensions/renderer/script_context.h"
+#include "extensions/renderer/script_context_set.h"
#include "extensions/renderer/v8_helpers.h"
#include "gin/modules/module_registry.h"
#include "third_party/WebKit/public/web/WebFrame.h"
@@ -57,15 +58,18 @@ void Fatal(ScriptContext* context, const std::string& message) {
ExtensionsClient* client = ExtensionsClient::Get();
if (client->ShouldSuppressFatalErrors()) {
- console::Error(context->isolate()->GetCallingContext(), full_message);
+ console::Error(context->GetRenderFrame(), full_message);
client->RecordDidSuppressFatalError();
} else {
- console::Fatal(context->isolate()->GetCallingContext(), full_message);
+ console::Fatal(context->GetRenderFrame(), full_message);
}
}
void Warn(v8::Isolate* isolate, const std::string& message) {
- console::Warn(isolate->GetCallingContext(), message);
+ ScriptContext* script_context =
+ ScriptContextSet::GetContextByV8Context(isolate->GetCallingContext());
+ console::Warn(script_context ? script_context->GetRenderFrame() : nullptr,
+ message);
}
// Default exception handler which logs the exception.
« no previous file with comments | « extensions/renderer/extension_helper.cc ('k') | extensions/renderer/object_backed_native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698