#ifndef JSDOMWindowBase_h
#define JSDOMWindowBase_h
#include "JSDOMBinding.h"
#include "JSDOMGlobalObject.h"
#include <wtf/Forward.h>
namespace WebCore {
class DOMWindow;
class Frame;
class DOMWrapperWorld;
class JSDOMWindow;
class JSDOMWindowShell;
class JSDOMWindowBasePrivate;
class JSDOMWindowBase : public JSDOMGlobalObject {
typedef JSDOMGlobalObject Base;
protected:
JSDOMWindowBase(JSC::JSGlobalData&, JSC::Structure*, PassRefPtr<DOMWindow>, JSDOMWindowShell*);
void finishCreation(JSC::JSGlobalData&, JSDOMWindowShell*);
public:
void updateDocument();
DOMWindow* impl() const { return m_impl.get(); }
virtual ScriptExecutionContext* scriptExecutionContext() const;
void willRemoveFromWindowShell();
static const JSC::ClassInfo s_info;
static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
{
return JSC::Structure::create(globalData, 0, prototype, JSC::TypeInfo(JSC::GlobalObjectType, StructureFlags), &s_info);
}
virtual JSC::ExecState* globalExec();
static const JSC::GlobalObjectMethodTable s_globalObjectMethodTable;
static bool supportsProfiling(const JSC::JSGlobalObject*);
static bool supportsRichSourceInfo(const JSC::JSGlobalObject*);
static bool shouldInterruptScript(const JSC::JSGlobalObject*);
bool allowsAccessFrom(JSC::ExecState*) const;
bool allowsAccessFromNoErrorMessage(JSC::ExecState*) const;
bool allowsAccessFrom(JSC::ExecState*, String& message) const;
void printErrorMessage(const String&) const;
bool allowsAccessFrom(const JSC::JSGlobalObject*) const;
static JSC::JSObject* toThisObject(JSC::JSCell*, JSC::ExecState*);
JSDOMWindowShell* shell() const;
static JSC::JSGlobalData* commonJSGlobalData();
private:
RefPtr<DOMWindow> m_impl;
JSDOMWindowShell* m_shell;
bool allowsAccessFromPrivate(const JSC::JSGlobalObject*) const;
String crossDomainAccessErrorMessage(const JSC::JSGlobalObject*) const;
};
JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, DOMWindow*);
JSC::JSValue toJS(JSC::ExecState*, DOMWindow*);
JSDOMWindow* toJSDOMWindow(Frame*, DOMWrapperWorld*);
JSDOMWindow* toJSDOMWindow(JSC::JSValue);
}
#endif // JSDOMWindowBase_h