本文整理汇总了C++中JSDOMWindow::globalObject方法的典型用法代码示例。如果您正苦于以下问题:C++ JSDOMWindow::globalObject方法的具体用法?C++ JSDOMWindow::globalObject怎么用?C++ JSDOMWindow::globalObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSDOMWindow
的用法示例。
在下文中一共展示了JSDOMWindow::globalObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsDOMWindowWebKit
static EncodedJSValue jsDOMWindowWebKit(ExecState* exec, EncodedJSValue thisValue, PropertyName)
{
JSDOMWindow* castedThis = toJSDOMWindow(JSValue::decode(thisValue));
if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->wrapped()))
return JSValue::encode(jsUndefined());
return JSValue::encode(toJS(exec, castedThis->globalObject(), castedThis->wrapped().webkitNamespace()));
}
示例2: setWindow
void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
{
// Replacing JSDOMWindow via telling JSDOMWindowShell to use the same DOMWindow it already uses makes no sense,
// so we'd better never try to.
ASSERT(!window() || domWindow.get() != &window()->impl());
// Explicitly protect the global object's prototype so it isn't collected
// when we allocate the global object. (Once the global object is fully
// constructed, it can mark its own prototype.)
//VMOLAB
//printf("JSDOMWindowShell::setWindow Called\n");
VM& vm = JSDOMWindow::commonVM();
Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(vm, 0, jsNull());
Strong<JSDOMWindowPrototype> prototype(vm, JSDOMWindowPrototype::create(vm, 0, prototypeStructure));
Structure* structure = JSDOMWindow::createStructure(vm, 0, prototype.get());
JSDOMWindow* jsDOMWindow = JSDOMWindow::create(vm, structure, domWindow, this);
prototype->structure()->setGlobalObject(vm, jsDOMWindow);
setWindow(vm, jsDOMWindow);
ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
ASSERT(prototype->globalObject() == jsDOMWindow);
#if ENABLE(VMOLAB)
vm.setInParallelParseLoad(true);
#endif
}
示例3: setWindow
void JSDOMWindowShell::setWindow(RefPtr<DOMWindow>&& domWindow)
{
// Replacing JSDOMWindow via telling JSDOMWindowShell to use the same DOMWindow it already uses makes no sense,
// so we'd better never try to.
ASSERT(!window() || domWindow.get() != &window()->wrapped());
// Explicitly protect the global object's prototype so it isn't collected
// when we allocate the global object. (Once the global object is fully
// constructed, it can mark its own prototype.)
VM& vm = JSDOMWindow::commonVM();
Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(vm, 0, jsNull());
Strong<JSDOMWindowPrototype> prototype(vm, JSDOMWindowPrototype::create(vm, 0, prototypeStructure));
Structure* structure = JSDOMWindow::createStructure(vm, 0, prototype.get());
JSDOMWindow* jsDOMWindow = JSDOMWindow::create(vm, structure, *domWindow, this);
prototype->structure()->setGlobalObject(vm, jsDOMWindow);
Structure* windowPropertiesStructure = JSDOMWindowProperties::createStructure(vm, jsDOMWindow, JSEventTarget::prototype(vm, jsDOMWindow));
JSDOMWindowProperties* windowProperties = JSDOMWindowProperties::create(windowPropertiesStructure, *jsDOMWindow);
prototype->structure()->setPrototypeWithoutTransition(vm, windowProperties);
setWindow(vm, jsDOMWindow);
ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
ASSERT(prototype->globalObject() == jsDOMWindow);
}
示例4: setWindow
void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
{
// Replacing JSDOMWindow via telling JSDOMWindowShell to use the same DOMWindow it already uses makes no sense,
// so we'd better never try to.
ASSERT(!window() || domWindow.get() != window()->impl());
// Explicitly protect the global object's prototype so it isn't collected
// when we allocate the global object. (Once the global object is fully
// constructed, it can mark its own prototype.)
Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(*JSDOMWindow::commonVM(), 0, jsNull());
Strong<JSDOMWindowPrototype> prototype(*JSDOMWindow::commonVM(), JSDOMWindowPrototype::create(*JSDOMWindow::commonVM(), 0, prototypeStructure));
Structure* structure = JSDOMWindow::createStructure(*JSDOMWindow::commonVM(), 0, prototype.get());
JSDOMWindow* jsDOMWindow = JSDOMWindow::create(*JSDOMWindow::commonVM(), structure, domWindow, this);
prototype->structure()->setGlobalObject(*JSDOMWindow::commonVM(), jsDOMWindow);
setWindow(*JSDOMWindow::commonVM(), jsDOMWindow);
ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
ASSERT(prototype->globalObject() == jsDOMWindow);
}