Index: extensions/renderer/console.cc |
diff --git a/extensions/renderer/console.cc b/extensions/renderer/console.cc |
index 64160743f778521cf22eeaaf11e98e78da7b633e..f1b0ab598c610a40392508dd3970a57a6ce1bdcf 100644 |
--- a/extensions/renderer/console.cc |
+++ b/extensions/renderer/console.cc |
@@ -11,6 +11,7 @@ |
#include "base/strings/string_util.h" |
#include "base/strings/stringprintf.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "content/public/child/worker_thread.h" |
#include "content/public/renderer/render_frame.h" |
#include "extensions/renderer/extension_frame_helper.h" |
#include "extensions/renderer/script_context.h" |
@@ -50,6 +51,12 @@ void BoundLogMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
return; |
} |
+ // A worker's ScriptContext neither lives in ScriptContextSet nor it has a |
+ // RenderFrame associated with it, so early exit in this case. |
+ // TODO(lazyboy): Fix. |
+ if (content::WorkerThread::GetCurrentId() > 0) |
+ return; |
+ |
ScriptContext* script_context = |
ScriptContextSet::GetContextByV8Context(context); |
LogMethod log_method = |