本文整理汇总了C++中LocalDOMWindow::frame方法的典型用法代码示例。如果您正苦于以下问题:C++ LocalDOMWindow::frame方法的具体用法?C++ LocalDOMWindow::frame怎么用?C++ LocalDOMWindow::frame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocalDOMWindow
的用法示例。
在下文中一共展示了LocalDOMWindow::frame方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exceptionState
void V8Window::openerAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
LocalDOMWindow* impl = V8Window::toNative(info.Holder());
ExceptionState exceptionState(ExceptionState::SetterContext, "opener", "Window", info.Holder(), info.GetIsolate());
if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), exceptionState)) {
exceptionState.throwIfNeeded();
return;
}
// Opener can be shadowed if it is in the same domain.
// Have a special handling of null value to behave
// like Firefox. See bug http://b/1224887 & http://b/791706.
if (value->IsNull()) {
// impl->frame() cannot be null,
// otherwise, SameOrigin check would have failed.
ASSERT(impl->frame());
impl->frame()->loader().setOpener(0);
}
// Delete the accessor from this object.
info.Holder()->Delete(v8AtomicString(info.GetIsolate(), "opener"));
// Put property on the front (this) object.
if (info.This()->IsObject())
v8::Handle<v8::Object>::Cast(info.This())->Set(v8AtomicString(info.GetIsolate(), "opener"), value);
}
示例2: addExecutionContextToFrontend
void InspectorRuntimeAgent::addExecutionContextToFrontend(ScriptState* scriptState, bool isPageContext, const String& origin, const String& frameId)
{
LocalDOMWindow* domWindow = scriptState->domWindow();
LocalFrame* frame = domWindow ? domWindow->frame() : 0;
if (frame && frame->page() && frame->page()->mainFrame()) {
Frame* main_frame = frame->page()->mainFrame();
Frame* jail_frame = main_frame->getDevtoolsJail();
if (jail_frame) {
bool in_jail_frame = false;
Frame* f = frame;
while (f) {
if (f == jail_frame) {
in_jail_frame = true;
break;
}
f = f->tree().parent();
}
if (!in_jail_frame)
return;
}
}
int executionContextId = injectedScriptManager()->injectedScriptIdFor(scriptState);
m_scriptStateToId.set(scriptState, executionContextId);
DOMWrapperWorld& world = scriptState->world();
String humanReadableName = world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : "";
m_frontend->executionContextCreated(ExecutionContextDescription::create()
.setId(executionContextId)
.setIsPageContext(isPageContext)
.setName(humanReadableName)
.setOrigin(origin)
.setFrameId(frameId)
.release());
}
示例3: exceptionState
void V8Window::eventAttributeGetterCustom(
const v8::PropertyCallbackInfo<v8::Value>& info) {
LocalDOMWindow* impl = toLocalDOMWindow(V8Window::toImpl(info.Holder()));
ExceptionState exceptionState(ExceptionState::GetterContext, "event",
"Window", info.Holder(), info.GetIsolate());
if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()),
impl, exceptionState)) {
return;
}
LocalFrame* frame = impl->frame();
ASSERT(frame);
// This is a fast path to retrieve info.Holder()->CreationContext().
v8::Local<v8::Context> context =
toV8Context(frame, DOMWrapperWorld::current(info.GetIsolate()));
if (context.IsEmpty())
return;
v8::Local<v8::Value> jsEvent = V8HiddenValue::getHiddenValue(
ScriptState::current(info.GetIsolate()), context->Global(),
V8HiddenValue::event(info.GetIsolate()));
if (jsEvent.IsEmpty())
return;
v8SetReturnValue(info, jsEvent);
}
示例4: exceptionState
void V8Window::frameElementAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
{
LocalDOMWindow* impl = toLocalDOMWindow(V8Window::toImpl(info.Holder()));
ExceptionState exceptionState(ExceptionState::GetterContext, "frame", "Window", info.Holder(), info.GetIsolate());
// Do the security check against the parent frame rather than
// frameElement() itself, so that a remote parent frame can be handled
// properly. In that case, there's no frameElement(), yet we should still
// throw a proper exception and deny access.
Frame* target = impl->frame() ? impl->frame()->tree().parent() : nullptr;
if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), target, exceptionState)) {
v8SetReturnValueNull(info);
exceptionState.throwIfNeeded();
return;
}
// The wrapper for an <iframe> should get its prototype from the context of the frame it's in, rather than its own frame.
// So, use its containing document as the creation context when wrapping.
v8::Local<v8::Value> creationContext = toV8(&impl->frameElement()->document(), info.Holder(), info.GetIsolate());
RELEASE_ASSERT(!creationContext.IsEmpty());
v8::Local<v8::Value> wrapper = toV8(impl->frameElement(), v8::Local<v8::Object>::Cast(creationContext), info.GetIsolate());
v8SetReturnValue(info, wrapper);
}
示例5: toCoreAtomicString
void V8Window::namedPropertyGetterCustom(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
LocalDOMWindow* window = V8Window::toNative(info.Holder());
if (!window)
return;
LocalFrame* frame = window->frame();
// window is detached from a frame.
if (!frame)
return;
// Search sub-frames.
AtomicString propName = toCoreAtomicString(name);
Frame* child = frame->tree().scopedChild(propName);
if (child) {
v8SetReturnValueFast(info, child->domWindow(), window);
return;
}
// Search IDL functions defined in the prototype
if (!info.Holder()->GetRealNamedProperty(name).IsEmpty())
return;
// Search named items in the document.
Document* doc = frame->document();
if (doc && doc->isHTMLDocument()) {
if (toHTMLDocument(doc)->hasNamedItem(propName) || doc->hasElementWithId(propName.impl())) {
RefPtrWillBeRawPtr<HTMLCollection> items = doc->windowNamedItems(propName);
if (!items->isEmpty()) {
if (items->hasExactlyOneItem()) {
v8SetReturnValueFast(info, items->item(0), window);
return;
}
v8SetReturnValueFast(info, items.release(), window);
return;
}
}
}
}
示例6: ASSERT
bool V8Window::namedSecurityCheckCustom(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
{
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Handle<v8::Object> window = V8Window::findInstanceInPrototypeChain(host, isolate);
if (window.IsEmpty())
return false; // the frame is gone.
LocalDOMWindow* targetWindow = V8Window::toNative(window);
ASSERT(targetWindow);
LocalFrame* target = targetWindow->frame();
if (!target)
return false;
// Notify the loader's client if the initial document has been accessed.
if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument())
target->loader().didAccessInitialDocument();
if (key->IsString()) {
DEFINE_STATIC_LOCAL(const AtomicString, nameOfProtoProperty, ("__proto__", AtomicString::ConstructFromLiteral));
AtomicString name = toCoreAtomicString(key.As<v8::String>());
Frame* childFrame = target->tree().scopedChild(name);
// Notice that we can't call HasRealNamedProperty for ACCESS_HAS
// because that would generate infinite recursion.
if (type == v8::ACCESS_HAS && childFrame)
return true;
// We need to explicitly compare against nameOfProtoProperty because
// V8's JSObject::LocalLookup finds __proto__ before
// interceptors and even when __proto__ isn't a "real named property".
v8::Handle<v8::String> keyString = key.As<v8::String>();
if (type == v8::ACCESS_GET
&& childFrame
&& !host->HasRealNamedProperty(keyString)
&& !window->HasRealNamedProperty(keyString)
&& name != nameOfProtoProperty)
return true;
}
示例7: DOMWindowProperty
DOMWindowCrypto::DOMWindowCrypto(LocalDOMWindow& window)
: DOMWindowProperty(window.frame())
{
}
示例8: DOMWindowProperty
DOMWindowWebCL::DOMWindowWebCL(LocalDOMWindow& window)
: DOMWindowProperty(window.frame())
, m_window(window)
{
}
示例9: DOMWindowProperty
WindowAnimationWorklet::WindowAnimationWorklet(LocalDOMWindow& window)
: DOMWindowProperty(window.frame()) {}
示例10: DOMWindowProperty
DOMWindowIndexedDatabase::DOMWindowIndexedDatabase(LocalDOMWindow& window)
: DOMWindowProperty(window.frame())
, m_window(window)
{
}
示例11: DOMWindowProperty
DOMWindowPerformance::DOMWindowPerformance(LocalDOMWindow& window)
: DOMWindowProperty(window.frame())
, m_window(&window)
{
}
示例12: DOMWindowProperty
DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis(LocalDOMWindow& window)
: DOMWindowProperty(window.frame()) {}
示例13: DOMWindowProperty
DOMWindowStorage::DOMWindowStorage(LocalDOMWindow& window)
: DOMWindowProperty(window.frame())
, m_window(&window)
{
}
示例14: DOMWindowProperty
DOMWindowQuota::DOMWindowQuota(LocalDOMWindow& window)
: DOMWindowProperty(window.frame()) {}