class DOMWindow;
class Frame;
class Node;
- class SVGElement;
class ScriptExecutionContext;
class V8EventListener;
class V8IsolatedContext;
const int kMaxRecursionDepth = 20;
- // Information about an extension that is registered for use with V8. If
- // scheme is non-empty, it contains the URL scheme the extension should be
- // used with. If group is non-zero, the extension will only be loaded into
- // script contexts that belong to that group. Otherwise, the extension is
- // used with all schemes and contexts.
- struct V8ExtensionInfo {
- String scheme;
- int group;
- v8::Extension* extension;
- };
- typedef WTF::Vector<V8ExtensionInfo> V8Extensions;
+ // The list of extensions that are registered for use with V8.
+ typedef WTF::Vector<v8::Extension*> V8Extensions;
class V8Proxy {
public:
// and clears all timeouts on the DOM window.
void disconnectFrame();
-#if ENABLE(SVG)
- static void setSVGContext(void*, SVGElement*);
- static SVGElement* svgContext(void*);
-
- // These helper functions are required in case we are given a PassRefPtr
- // to a (possibly) newly created object and must prevent its reference
- // count from dropping to zero as would happen in code like
- //
- // V8Proxy::setSVGContext(imp->getNewlyCreatedObject().get(), context);
- // foo(imp->getNewlyCreatedObject().get());
- //
- // In the above two lines each time getNewlyCreatedObject() is called it
- // creates a new object because we don't ref() it. (So our attemts to
- // associate a context with it fail.) Such code should be rewritten to
- //
- // foo(V8Proxy::withSVGContext(imp->getNewlyCreatedObject(), context).get());
- //
- // where PassRefPtr::~PassRefPtr() is invoked only after foo() is
- // called.
- template <typename T>
- static PassRefPtr<T> withSVGContext(PassRefPtr<T> object, SVGElement* context)
- {
- setSVGContext(object.get(), context);
- return object;
- }
-
- template <typename T>
- static T* withSVGContext(T* object, SVGElement* context)
- {
- setSVGContext(object, context);
- return object;
- }
-#endif
-
void finishedWithEvent(Event*) { }
// Evaluate JavaScript in a new isolated world. The script gets its own
static v8::Handle<v8::Value> checkNewLegal(const v8::Arguments&);
- static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine, v8::ScriptData* = 0);
+ static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition0& scriptStartPosition, v8::ScriptData* = 0);
#ifdef ANDROID_INSTRUMENT
- static v8::Handle<v8::Script> compileScriptInternal(v8::Handle<v8::String> code, const String& fileName, int baseLine);
+ static v8::Handle<v8::Script> compileScriptInternal(v8::Handle<v8::String> code, const String& fileName, int baseLine, v8::ScriptData* scriptData);
#endif
// If the exception code is different from zero, a DOM exception is
bool setContextDebugId(int id);
static int contextDebugId(v8::Handle<v8::Context>);
- // Registers a v8 extension to be available on webpages. The two forms
- // offer various restrictions on what types of contexts the extension is
- // loaded into. If a scheme is provided, only pages whose URL has the given
- // scheme will match. If extensionGroup is provided, the extension will
- // only be loaded into scripts run via evaluateInNewWorld with the
- // matching group. Will only affect v8 contexts initialized after this
- // call. Takes ownership of the v8::Extension object passed.
- static void registerExtension(v8::Extension*, const String& schemeRestriction);
- static void registerExtension(v8::Extension*, int extensionGroup);
+ // Registers a v8 extension to be available on webpages. Will only
+ // affect v8 contexts initialized after this call. Takes ownership of
+ // the v8::Extension object passed.
+ static void registerExtension(v8::Extension*);
static void registerExtensionWithV8(v8::Extension*);
static bool registeredExtensionWithV8(v8::Extension*);