コード例 #1
0
ファイル: IPCBlobUtils.cpp プロジェクト: artines1/gecko-dev
bool
IPDLParamTraits<mozilla::dom::BlobImpl>::Read(
  const IPC::Message* aMsg, PickleIterator* aIter,
  IProtocol* aActor, RefPtr<mozilla::dom::BlobImpl>* aResult)
{
  *aResult = nullptr;

  bool notnull = false;
  if (!ReadIPDLParam(aMsg, aIter, aActor, &notnull)) {
    return false;
  }
  if (notnull) {
    mozilla::dom::IPCBlob ipcblob;
    if (!ReadIPDLParam(aMsg, aIter, aActor, &ipcblob)) {
      return false;
    }
    *aResult = mozilla::dom::IPCBlobUtils::Deserialize(ipcblob);
  }
  return true;
}
コード例 #2
0
bool IPDLParamTraits<nsDocShellLoadState*>::Read(
    const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
    RefPtr<nsDocShellLoadState>* aResult) {
  DocShellLoadStateInit loadState;
  if (!ReadIPDLParam(aMsg, aIter, aActor, &loadState)) {
    return false;
  }

  // Assert if we somehow don't have a URI in our IPDL type, because we can't
  // construct anything out of it. This mimics the assertion in the constructor
  // for nsDocShellLoadState, but makes it clearer that the
  // DocShellLoadStateInit IPC object can't be clearly converted into a
  // nsDocShellLoadState.
  MOZ_ASSERT(loadState.URI());

  *aResult = new nsDocShellLoadState(loadState);
  return true;
}