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

Unified Diff: extensions/renderer/console.cc

Issue 1880933002: Begin to enable extension APIs in Extension Service Worker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync @tott Created 4 years, 7 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/extensions.gypi ('k') | extensions/renderer/dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 =
« no previous file with comments | « extensions/extensions.gypi ('k') | extensions/renderer/dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698