Esempio n. 1
0
void WebFrame::insertAfter(WebFrame* newChild, WebFrame* previousSibling) {
  newChild->m_parent = this;

  WebFrame* next;
  if (!previousSibling) {
    // Insert at the beginning if no previous sibling is specified.
    next = m_firstChild;
    m_firstChild = newChild;
  } else {
    DCHECK_EQ(previousSibling->m_parent, this);
    next = previousSibling->m_nextSibling;
    previousSibling->m_nextSibling = newChild;
    newChild->m_previousSibling = previousSibling;
  }

  if (next) {
    newChild->m_nextSibling = next;
    next->m_previousSibling = newChild;
  } else {
    m_lastChild = newChild;
  }

  toImplBase()->frame()->tree().invalidateScopedChildCount();
  toImplBase()->frame()->host()->incrementSubframeCount();
}
Esempio n. 2
0
void WebFrame::setFrameOwnerSandboxFlags(WebSandboxFlags flags) {
  // At the moment, this is only used to replicate sandbox flags
  // for frames with a remote owner.
  FrameOwner* owner = toImplBase()->frame()->owner();
  DCHECK(owner);
  toRemoteFrameOwner(owner)->setSandboxFlags(static_cast<SandboxFlags>(flags));
}
Esempio n. 3
0
void WebFrame::removeChild(WebFrame* child) {
  child->m_parent = 0;

  if (m_firstChild == child)
    m_firstChild = child->m_nextSibling;
  else
    child->m_previousSibling->m_nextSibling = child->m_nextSibling;

  if (m_lastChild == child)
    m_lastChild = child->m_previousSibling;
  else
    child->m_nextSibling->m_previousSibling = child->m_previousSibling;

  child->m_previousSibling = child->m_nextSibling = 0;

  toImplBase()->frame()->tree().invalidateScopedChildCount();
  toImplBase()->frame()->host()->decrementSubframeCount();
}
Esempio n. 4
0
WebFrame* WebFrame::findChildByName(const WebString& name) const
{
    Frame* frame = toImplBase()->frame();
    if (!frame)
        return 0;
    // FIXME: It's not clear this should ever be called to find a remote frame.
    // Perhaps just disallow that completely?
    return fromFrame(frame->tree().child(name));
}
Esempio n. 5
0
void WebFrame::setFrameOwnerProperties(
    const WebFrameOwnerProperties& properties) {
  // At the moment, this is only used to replicate frame owner properties
  // for frames with a remote owner.
  RemoteFrameOwner* owner = toRemoteFrameOwner(toImplBase()->frame()->owner());
  DCHECK(owner);

  Frame* frame = toImplBase()->frame();
  DCHECK(frame);

  if (frame->isLocalFrame()) {
    toLocalFrame(frame)->document()->willChangeFrameOwnerProperties(
        properties.marginWidth, properties.marginHeight,
        static_cast<ScrollbarMode>(properties.scrollingMode));
  }

  owner->setScrollingMode(properties.scrollingMode);
  owner->setMarginWidth(properties.marginWidth);
  owner->setMarginHeight(properties.marginHeight);
  owner->setAllowFullscreen(properties.allowFullscreen);
  owner->setCsp(properties.requiredCsp);
  owner->setDelegatedpermissions(properties.delegatedPermissions);
}
Esempio n. 6
0
bool WebFrame::isLoading() const {
  if (Frame* frame = toImplBase()->frame())
    return frame->isLoading();
  return false;
}
Esempio n. 7
0
WebFrame* WebFrame::traverseNext() const {
  if (Frame* frame = toImplBase()->frame())
    return fromFrame(frame->tree().traverseNext());
  return nullptr;
}
Esempio n. 8
0
WebInsecureRequestPolicy WebFrame::getInsecureRequestPolicy() const {
  return toImplBase()->frame()->securityContext()->getInsecureRequestPolicy();
}
Esempio n. 9
0
WebSecurityOrigin WebFrame::getSecurityOrigin() const {
  return WebSecurityOrigin(
      toImplBase()->frame()->securityContext()->getSecurityOrigin());
}
Esempio n. 10
0
WebFrame* WebFrame::traverseNext(bool wrap) const
{
    if (Frame* frame = toImplBase()->frame())
        return fromFrame(frame->tree().traverseNextWithWrap(wrap));
    return 0;
}
Esempio n. 11
0
bool WebFrame::shouldEnforceStrictMixedContentChecking() const
{
    return toImplBase()->frame()->securityContext()->shouldEnforceStrictMixedContentChecking();
}