mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 943414: Assert/warn if non-null prompt passed to nsICookieService. r=ehsan
This commit is contained in:
parent
4de61de388
commit
2d2203105c
@ -52,6 +52,7 @@
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsIAppsService.h"
|
||||
#include "mozIApplication.h"
|
||||
#include "nsIConsoleService.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::net;
|
||||
@ -1577,6 +1578,17 @@ nsCookieService::SetCookieString(nsIURI *aHostURI,
|
||||
const char *aCookieHeader,
|
||||
nsIChannel *aChannel)
|
||||
{
|
||||
// The aPrompt argument is deprecated and unused. Avoid introducing new
|
||||
// code that uses this argument by warning if the value is non-null.
|
||||
MOZ_ASSERT(!aPrompt);
|
||||
if (aPrompt) {
|
||||
nsCOMPtr<nsIConsoleService> aConsoleService =
|
||||
do_GetService("@mozilla.org/consoleservice;1");
|
||||
if (aConsoleService) {
|
||||
aConsoleService->LogStringMessage(
|
||||
NS_LITERAL_STRING("Non-null prompt ignored by nsCookieService.").get());
|
||||
}
|
||||
}
|
||||
return SetCookieStringCommon(aHostURI, aCookieHeader, nullptr, aChannel,
|
||||
false);
|
||||
}
|
||||
@ -1589,6 +1601,17 @@ nsCookieService::SetCookieStringFromHttp(nsIURI *aHostURI,
|
||||
const char *aServerTime,
|
||||
nsIChannel *aChannel)
|
||||
{
|
||||
// The aPrompt argument is deprecated and unused. Avoid introducing new
|
||||
// code that uses this argument by warning if the value is non-null.
|
||||
MOZ_ASSERT(!aPrompt);
|
||||
if (aPrompt) {
|
||||
nsCOMPtr<nsIConsoleService> aConsoleService =
|
||||
do_GetService("@mozilla.org/consoleservice;1");
|
||||
if (aConsoleService) {
|
||||
aConsoleService->LogStringMessage(
|
||||
NS_LITERAL_STRING("Non-null prompt ignored by nsCookieService.").get());
|
||||
}
|
||||
}
|
||||
return SetCookieStringCommon(aHostURI, aCookieHeader, aServerTime, aChannel,
|
||||
true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user