nsDocShellLoadState::nsDocShellLoadState(nsIURI* aURI)
    : mURI(aURI),
      mResultPrincipalURIIsSome(false),
      mKeepResultPrincipalURIIfSet(false),
      mLoadReplace(false),
      mInheritPrincipal(false),
      mPrincipalIsExplicit(false),
      mForceAllowDataURI(false),
      mOriginalFrameSrc(false),
      mLoadType(LOAD_NORMAL),
      mTarget(),
      mSrcdocData(VoidString()),
      mLoadFlags(0),
      mFirstParty(false),
      mTypeHint(VoidCString()),
      mFileName(VoidString()),
      mIsFromProcessingFrameAttributes(false) {
  MOZ_ASSERT(aURI, "Cannot create a LoadState with a null URI!");
}
Exemple #2
0
void InputEvent::GetData(nsAString& aData, CallerType aCallerType) {
  InternalEditorInputEvent* editorInputEvent = mEvent->AsEditorInputEvent();
  MOZ_ASSERT(editorInputEvent);
  // If clipboard event is disabled, user may not want to leak clipboard
  // information via DOM events.  If so, we should return empty string instead.
  if (mEvent->IsTrusted() && aCallerType != CallerType::System &&
      !StaticPrefs::dom_event_clipboardevents_enabled() &&
      ExposesClipboardDataOrDataTransfer(editorInputEvent->mInputType)) {
    aData = editorInputEvent->mData.IsVoid() ? VoidString() : EmptyString();
    return;
  }
  aData = editorInputEvent->mData;
}
Exemple #3
0
NS_IMETHODIMP
nsSHEntry::Create(nsIURI* aURI, const nsAString& aTitle,
                  nsIInputStream* aInputStream,
                  nsILayoutHistoryState* aLayoutHistoryState,
                  nsISupports* aCacheKey, const nsACString& aContentType,
                  nsIPrincipal* aTriggeringPrincipal,
                  nsIPrincipal* aPrincipalToInherit,
                  const nsID& aDocShellID,
                  bool aDynamicCreation)
{
  MOZ_ASSERT(aTriggeringPrincipal,
             "need a valid triggeringPrincipal to create a session history entry");

  mURI = aURI;
  mTitle = aTitle;
  mPostData = aInputStream;

  // Set the LoadType by default to loadHistory during creation
  mLoadType = (uint32_t)nsIDocShellLoadInfo::loadHistory;

  mShared->mCacheKey = aCacheKey;
  mShared->mContentType = aContentType;
  mShared->mTriggeringPrincipal = aTriggeringPrincipal;
  mShared->mPrincipalToInherit = aPrincipalToInherit;
  mShared->mDocShellID = aDocShellID;
  mShared->mDynamicallyCreated = aDynamicCreation;

  // By default all entries are set false for subframe flag.
  // nsDocShell::CloneAndReplace() which creates entries for
  // all subframe navigations, sets the flag to true.
  mShared->mIsFrameNavigation = false;

  // By default we save LayoutHistoryState
  mShared->mSaveLayoutState = true;
  mShared->mLayoutHistoryState = aLayoutHistoryState;

  // By default the page is not expired
  mShared->mExpired = false;

  mIsSrcdocEntry = false;
  mSrcdocData = VoidString();

  mLoadedInThisProcess = true;

  return NS_OK;
}