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

Unified Diff: extensions/renderer/scripts_run_info.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/scripts_run_info.h
diff --git a/extensions/renderer/scripts_run_info.h b/extensions/renderer/scripts_run_info.h
index 392976d8d1d91faa2af6375b9c53a940fcb343f4..0c087155acd5f2e67c6a531fd94396e1e749dd79 100644
--- a/extensions/renderer/scripts_run_info.h
+++ b/extensions/renderer/scripts_run_info.h
@@ -14,8 +14,8 @@
#include "base/timer/elapsed_timer.h"
#include "extensions/common/user_script.h"
-namespace blink {
-class WebLocalFrame;
+namespace content {
+class RenderFrame;
}
namespace extensions {
@@ -25,7 +25,8 @@ struct ScriptsRunInfo {
// Map of extensions IDs to the executing script paths.
typedef std::map<std::string, std::set<std::string> > ExecutingScriptsMap;
- ScriptsRunInfo();
+ ScriptsRunInfo(content::RenderFrame* render_frame,
+ UserScript::RunLocation location);
~ScriptsRunInfo();
// The number of CSS scripts injected.
@@ -40,9 +41,20 @@ struct ScriptsRunInfo {
base::ElapsedTimer timer;
// Log information about a given script run.
- void LogRun(blink::WebLocalFrame* frame, UserScript::RunLocation location);
+ void LogRun();
private:
+ // The routinig id to use to notify the browser of any injections. Since the
+ // frame may be deleted in injection, we don't hold on to a reference to it
+ // directly.
+ int routing_id_;
+
+ // The run location at which injection is happening.
+ UserScript::RunLocation run_location_;
+
+ // The url of the frame, preserved for the same reason as the routing id.
+ GURL frame_url_;
+
DISALLOW_COPY_AND_ASSIGN(ScriptsRunInfo);
};

Powered by Google App Engine
This is Rietveld 408576698