Bug 1418076 part 2. Get rid of nsIDOMHTMLDocument's cookie attribute. r=mystor
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 26 Jan 2018 01:00:20 -0500
changeset 748754 ffbb8173065025fea677f9cfa678d376288eb739
parent 748753 e2b9d1d7a5e9672bc7098659648a4854ecbbc29d
child 748755 e0146922d6a1aaf13fd077ea687498f8db98f949
push id97228
push usersfraser@mozilla.com
push dateTue, 30 Jan 2018 10:21:04 +0000
reviewersmystor
bugs1418076
milestone60.0a1
Bug 1418076 part 2. Get rid of nsIDOMHTMLDocument's cookie attribute. r=mystor MozReview-Commit-ID: JLW7dFPbY3m
dom/html/nsHTMLDocument.cpp
dom/interfaces/html/nsIDOMHTMLDocument.idl
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -1173,24 +1173,16 @@ nsIHTMLCollection*
 nsHTMLDocument::Scripts()
 {
   if (!mScripts) {
     mScripts = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::script, nsGkAtoms::script);
   }
   return mScripts;
 }
 
-NS_IMETHODIMP
-nsHTMLDocument::GetCookie(nsAString& aCookie)
-{
-  ErrorResult rv;
-  GetCookie(aCookie, rv);
-  return rv.StealNSResult();
-}
-
 already_AddRefed<nsIChannel>
 nsHTMLDocument::CreateDummyChannelForCookies(nsIURI* aCodebaseURI)
 {
   // The cookie service reads the privacy status of the channel we pass to it in
   // order to determine which cookie database to query.  In some cases we don't
   // have a proper channel to hand it to the cookie service though.  This
   // function creates a dummy channel that is not used to load anything, for the
   // sole purpose of handing it to the cookie service.  DO NOT USE THIS CHANNEL
@@ -1262,24 +1254,16 @@ nsHTMLDocument::GetCookie(nsAString& aCo
     nsCString cookie;
     service->GetCookieString(codebaseURI, channel, getter_Copies(cookie));
     // CopyUTF8toUTF16 doesn't handle error
     // because it assumes that the input is valid.
     UTF_8_ENCODING->DecodeWithoutBOMHandling(cookie, aCookie);
   }
 }
 
-NS_IMETHODIMP
-nsHTMLDocument::SetCookie(const nsAString& aCookie)
-{
-  ErrorResult rv;
-  SetCookie(aCookie, rv);
-  return rv.StealNSResult();
-}
-
 void
 nsHTMLDocument::SetCookie(const nsAString& aCookie, ErrorResult& rv)
 {
   if (mDisableCookieAccess) {
     return;
   }
 
   // If the document's sandboxed origin flag is set, access to write cookies
--- a/dom/interfaces/html/nsIDOMHTMLDocument.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDocument.idl
@@ -11,18 +11,16 @@
  *
  * @see <http://www.whatwg.org/html/>
  */
 interface nsISelection;
 
 [uuid(cd31e61f-cfc2-4b91-9385-17b6a2d0633d)]
 interface nsIDOMHTMLDocument : nsIDOMDocument
 {
-           attribute DOMString            cookie;
-
   readonly attribute nsISupports          head;
 
   // If aContentType is not something supported by nsHTMLDocument and
   // the HTML content sink, trying to write to the document will
   // probably throw.
   // Pass aReplace = true to trigger a replacement of the previous
   // document in session history; pass false for normal history handling.
   [implicit_jscontext, optional_argc]