More TODOs in the the plugin stream code, use the NullableString mechanisms which were invented after this landed.

This commit is contained in:
Benjamin Smedberg 2009-11-25 10:34:59 -05:00
parent f7eb5c27ab
commit 3815e2f045
2 changed files with 10 additions and 12 deletions

View File

@ -61,19 +61,17 @@ BrowserStreamChild::BrowserStreamChild(PluginInstanceChild* instance,
memset(&mStream, 0, sizeof(mStream));
mStream.ndata = static_cast<AStream*>(this);
if (!mURL.IsEmpty())
mStream.url = mURL.get();
mStream.url = NullableStringGet(mURL);
mStream.end = length;
mStream.lastmodified = lastmodified;
if (notifyData)
mStream.notifyData =
static_cast<const StreamNotifyChild*>(notifyData)->mClosure;
if (!mHeaders.IsEmpty())
mStream.headers = mHeaders.get();
mStream.headers = NullableStringGet(mHeaders);
*rv = mInstance->mPluginIface->newstream(&mInstance->mData,
const_cast<char*>(mimeType.get()),
&mStream, seekable, stype);
*rv = mInstance->mPluginIface->newstream(
&mInstance->mData, const_cast<char*>(NullableStringGet(mimeType)),
&mStream, seekable, stype);
if (*rv != NPERR_NO_ERROR)
mClosed = true;
}

View File

@ -472,18 +472,18 @@ PluginInstanceParent::NPP_NewStream(NPMIMEType type, NPStream* stream,
NPBool seekable, uint16_t* stype)
{
_MOZ_LOG(__FUNCTION__);
BrowserStreamParent* bs = new BrowserStreamParent(this, stream);
NPError err;
// TODO are any of these strings nullable?
if (!CallPBrowserStreamConstructor(bs,
nsCString(stream->url),
NullableString(stream->url),
stream->end,
stream->lastmodified,
static_cast<PStreamNotifyParent*>(stream->notifyData),
nsCString(stream->headers),
nsCString(type), seekable, &err, stype))
NullableString(stream->headers),
NullableString(type), seekable,
&err, stype))
return NPERR_GENERIC_ERROR;
if (NPERR_NO_ERROR != err)