Index: extensions/renderer/script_injection.h |
diff --git a/extensions/renderer/script_injection.h b/extensions/renderer/script_injection.h |
index 6c265894e145f3eb1577a3f3d8de0f3b20b3090c..a55c6e645949beaac5355abfb7046e205dbef096 100644 |
--- a/extensions/renderer/script_injection.h |
+++ b/extensions/renderer/script_injection.h |
@@ -8,9 +8,9 @@ |
#include "base/basictypes.h" |
#include "base/macros.h" |
#include "extensions/common/user_script.h" |
+#include "extensions/renderer/injection_host.h" |
#include "extensions/renderer/script_injector.h" |
-class InjectionHost; |
struct HostID; |
namespace blink { |
@@ -33,7 +33,7 @@ class ScriptInjection { |
ScriptInjection( |
scoped_ptr<ScriptInjector> injector, |
blink::WebLocalFrame* web_frame, |
- const HostID& host_id, |
+ scoped_ptr<const InjectionHost> injection_host, |
const UserScript::ConsumerInstanceType& consumer_instance_type, |
UserScript::RunLocation run_location, |
int tab_id); |
@@ -53,9 +53,14 @@ class ScriptInjection { |
bool OnPermissionGranted(const InjectionHost* injection_host, |
ScriptsRunInfo* scripts_run_info); |
+ // Gets the associated injection host. If the host is an extension, we check |
+ // whether the extension exists first; and if the extension is gone, will |
+ // return a nullptr. |
+ const InjectionHost* GetInjectionHost(); |
+ |
// Accessors. |
blink::WebLocalFrame* web_frame() const { return web_frame_; } |
- const HostID& host_id() const { return host_id_; } |
+ const HostID& host_id() const { return injection_host_->id(); } |
int64 request_id() const { return request_id_; } |
private: |
@@ -84,8 +89,8 @@ class ScriptInjection { |
// The (main) WebFrame into which this should inject the script. |
blink::WebLocalFrame* web_frame_; |
- // The id of the associated injection_host. |
- HostID host_id_; |
+ // The associated injection host. |
+ scoped_ptr<const InjectionHost> injection_host_; |
// The type of the instance on which the host will inject the script. |
UserScript::ConsumerInstanceType consumer_instance_type_; |