}
namespace content {
+class RenderFrame;
class RenderView;
}
ScriptContext(const v8::Handle<v8::Context>& context,
blink::WebFrame* frame,
const Extension* extension,
- Feature::Context context_type);
+ Feature::Context context_type,
+ const Extension* effective_extension,
+ Feature::Context effective_context_type);
virtual ~ScriptContext();
// Clears the WebFrame for this contexts and invalidates the associated
const Extension* extension() const { return extension_.get(); }
+ const Extension* effective_extension() const {
+ return effective_extension_.get();
+ }
+
blink::WebFrame* web_frame() const { return web_frame_; }
Feature::Context context_type() const { return context_type_; }
+ Feature::Context effective_context_type() const {
+ return effective_context_type_;
+ }
+
void set_module_system(scoped_ptr<ModuleSystem> module_system) {
module_system_ = module_system.Pass();
}
// context is in the process of being destroyed.
content::RenderView* GetRenderView() const;
+ // Returns the RenderFrame associated with this context. Can return NULL if
+ // the context is in the process of being destroyed.
+ content::RenderFrame* GetRenderFrame() const;
+
// Runs |function| with appropriate scopes. Doesn't catch exceptions, callers
// must do that if they want.
//
// Returns a string description of the type of context this is.
std::string GetContextTypeDescription();
+ // Returns a string description of the effective type of context this is.
+ std::string GetEffectiveContextTypeDescription();
+
v8::Isolate* isolate() const { return isolate_; }
// Get the URL of this context's web frame.
// The type of context.
Feature::Context context_type_;
+ // The effective extension associated with this context, or NULL if there is
+ // none. This is different from the above extension if this context is in an
+ // about:blank iframe for example.
+ scoped_refptr<const Extension> effective_extension_;
+
+ // The type of context.
+ Feature::Context effective_context_type_;
+
// Owns and structures the JS that is injected to set up extension bindings.
scoped_ptr<ModuleSystem> module_system_;