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

Unified Diff: extensions/renderer/programmatic_script_injector.h

Issue 1216453002: [Extensions] Handle some funny cases in script injection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ben's 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
Index: extensions/renderer/programmatic_script_injector.h
diff --git a/extensions/renderer/programmatic_script_injector.h b/extensions/renderer/programmatic_script_injector.h
index 7c3775a3378f3508baa4797f01cc42f8444ce235..1f5584c65e41d8ae92e73a38b8d2eaeeb1d055e1 100644
--- a/extensions/renderer/programmatic_script_injector.h
+++ b/extensions/renderer/programmatic_script_injector.h
@@ -27,6 +27,8 @@ class ProgrammaticScriptInjector : public ScriptInjector {
~ProgrammaticScriptInjector() override;
private:
+ class FrameWatcher;
+
// ScriptInjector implementation.
UserScript::InjectionType script_type() const override;
bool ShouldExecuteInMainWorld() const override;
@@ -66,8 +68,8 @@ class ProgrammaticScriptInjector : public ScriptInjector {
// security decisions, to avoid race conditions (e.g. due to navigation).
GURL effective_url_;
- // The RenderFrame to which we send the response upon completion.
- content::RenderFrame* render_frame_;
+ // A helper class to hold the render frame and watch for its deletion.
+ scoped_ptr<FrameWatcher> frame_watcher_;
// The results of the script execution.
base::ListValue results_;

Powered by Google App Engine
This is Rietveld 408576698