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

Unified Diff: extensions/renderer/console.cc

Issue 678393002: Send extension console messages to the right WebFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Find the correct RenderView for extension logging. Created 6 years, 2 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 | « no previous file | no next file » | 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 ccfef7590e619f35de1676a3fa2ace1402f0473a..2388d34c3b4d3a7b9fa02c3127369e48fd074a2e 100644
--- a/extensions/renderer/console.cc
+++ b/extensions/renderer/console.cc
@@ -39,9 +39,14 @@ class ByContextFinder : public content::RenderViewVisitor {
bool Visit(content::RenderView* render_view) override {
ExtensionHelper* helper = ExtensionHelper::Get(render_view);
- if (helper &&
- helper->dispatcher()->script_context_set().GetByV8Context(context_)) {
- found_ = render_view;
+ if (helper) {
+ ScriptContext* script_context =
+ helper->dispatcher()->script_context_set().GetByV8Context(context_);
+ if (script_context &&
+ content::RenderView::FromWebView(
+ script_context->web_frame()->view()) == render_view) {
not at google - send to devlin 2014/11/07 16:24:03 You should just be able to do "script_context->Get
+ found_ = render_view;
+ }
}
return !found_;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698