| Index: chrome/renderer/extensions/chrome_v8_context.h
|
| diff --git a/chrome/renderer/extensions/chrome_v8_context.h b/chrome/renderer/extensions/chrome_v8_context.h
|
| index 19165ab608d55b44b8b874c99ed46f185c2137c6..11a4a87bec87d9c990898974345e32d13542e02c 100644
|
| --- a/chrome/renderer/extensions/chrome_v8_context.h
|
| +++ b/chrome/renderer/extensions/chrome_v8_context.h
|
| @@ -26,9 +26,19 @@ class RenderView;
|
| // we won't need this object and it's a bit less state to keep track of.
|
| class ChromeV8Context {
|
| public:
|
| + enum ContextType {
|
| + CONTENT_SCRIPT,
|
| +
|
| + // TODO(kalman): for now, have this as OTHER, since we only currently need
|
| + // know whether something is a content script or not. However, when
|
| + // necessary this should enumerate the other types, such as FRAME.
|
| + OTHER
|
| + };
|
| +
|
| ChromeV8Context(v8::Handle<v8::Context> context,
|
| WebKit::WebFrame* frame,
|
| - const std::string& extension_id);
|
| + const std::string& extension_id,
|
| + ContextType context_type);
|
| ~ChromeV8Context();
|
|
|
| v8::Handle<v8::Context> v8_context() const {
|
| @@ -46,6 +56,10 @@ class ChromeV8Context {
|
| web_frame_ = NULL;
|
| }
|
|
|
| + ContextType context_type() const {
|
| + return context_type_;
|
| + }
|
| +
|
| // Returns a special Chrome-specific hidden object that is associated with a
|
| // context, but not reachable from the JavaScript in that context. This is
|
| // used by our v8::Extension implementations as a way to share code and as a
|
| @@ -96,6 +110,9 @@ class ChromeV8Context {
|
| // The extension ID this context is associated with.
|
| std::string extension_id_;
|
|
|
| + // The type of context.
|
| + ContextType context_type_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ChromeV8Context);
|
| };
|
|
|
|
|