Bug 932418: Don't create and throw away prompt when setting cookie string. r=bz

This commit is contained in:
Ben Kelly
2013-12-02 12:47:57 -05:00
parent 2af428d702
commit 7bd04bd92e
5 changed files with 4 additions and 51 deletions

View File

@@ -2678,15 +2678,12 @@ _setvalueforurl(NPP instance, NPNURLVariable variable, const char *url,
if (NS_FAILED(rv))
return NPERR_GENERIC_ERROR;
nsCOMPtr<nsIPrompt> prompt;
nsPluginHost::GetPrompt(nullptr, getter_AddRefs(prompt));
nsCOMPtr<nsIChannel> channel = GetChannelFromNPP(instance);
char *cookie = (char*)value;
char c = cookie[len];
cookie[len] = '\0';
rv = cookieService->SetCookieString(uriIn, prompt, cookie, channel);
rv = cookieService->SetCookieString(uriIn, nullptr, cookie, channel);
cookie[len] = c;
if (NS_SUCCEEDED(rv))
return NPERR_NO_ERROR;