Bug 1351147 - Use completion instead of prefix in OnClassifyComplete draft
authorThomas Nguyen <tnguyen@mozilla.com>
Mon, 05 Jun 2017 11:18:15 +0800
changeset 621054 5841ff3e98356973c470234513497aaba7f1995f
parent 621053 67ceeae1d5ce30f13bed2a67b265d230c2d5c872
child 621055 436322a60a9862143024fbb8a9f5a31b56d20981
child 621076 5e1845d6eb04da65e24a0975b31205613f310674
push id72237
push userbmo:tnguyen@mozilla.com
push dateFri, 04 Aug 2017 08:05:25 +0000
bugs1351147
milestone57.0a1
Bug 1351147 - Use completion instead of prefix in OnClassifyComplete MozReview-Commit-ID: 5ZPy5ko6VT5
dom/ipc/PURLClassifierInfo.ipdlh
dom/ipc/URLClassifierChild.h
dom/ipc/URLClassifierParent.h
netwerk/base/nsChannelClassifier.cpp
netwerk/base/nsChannelClassifier.h
netwerk/base/nsIClassifiedChannel.idl
netwerk/base/nsIParentChannel.idl
netwerk/base/nsIURIClassifier.idl
netwerk/protocol/data/DataChannelParent.cpp
netwerk/protocol/file/FileChannelParent.cpp
netwerk/protocol/ftp/FTPChannelParent.cpp
netwerk/protocol/http/HttpBackgroundChannelChild.cpp
netwerk/protocol/http/HttpBackgroundChannelParent.cpp
netwerk/protocol/http/HttpBackgroundChannelParent.h
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelChild.h
netwerk/protocol/http/HttpChannelParent.cpp
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
uriloader/exthandler/nsExternalProtocolHandler.cpp
--- a/dom/ipc/PURLClassifierInfo.ipdlh
+++ b/dom/ipc/PURLClassifierInfo.ipdlh
@@ -5,17 +5,17 @@
 using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
 
 namespace mozilla {
 namespace dom {
 
 struct ClassifierInfo {
   nsCString list;
   nsCString provider;
-  nsCString prefix;
+  nsCString completion;
 };
 
 union MaybeInfo {
   ClassifierInfo;
   void_t;
 };
 
 } // namespace dom
--- a/dom/ipc/URLClassifierChild.h
+++ b/dom/ipc/URLClassifierChild.h
@@ -27,17 +27,17 @@ public:
 
   mozilla::ipc::IPCResult Recv__delete__(const MaybeInfo& aInfo,
                                          const nsresult& aResult) override
   {
     MOZ_ASSERT(mCallback);
     if (aInfo.type() == MaybeInfo::TClassifierInfo) {
       mCallback->OnClassifyComplete(aResult, aInfo.get_ClassifierInfo().list(),
                                     aInfo.get_ClassifierInfo().provider(),
-                                    aInfo.get_ClassifierInfo().prefix());
+                                    aInfo.get_ClassifierInfo().completion());
     }
     return IPC_OK();
   }
 
 private:
   ~URLClassifierChildBase() = default;
 
   nsCOMPtr<nsIURIClassifierCallback> mCallback;
--- a/dom/ipc/URLClassifierParent.h
+++ b/dom/ipc/URLClassifierParent.h
@@ -18,22 +18,22 @@ template<typename BaseProtocol>
 class URLClassifierParentBase : public nsIURIClassifierCallback,
                                 public BaseProtocol
 {
 public:
   // nsIURIClassifierCallback.
   NS_IMETHOD OnClassifyComplete(nsresult aErrorCode,
                                 const nsACString& aList,
                                 const nsACString& aProvider,
-                                const nsACString& aPrefix)
+                                const nsACString& aCompletion)
   {
     if (mIPCOpen) {
       ClassifierInfo info = ClassifierInfo(nsCString(aList),
                                            nsCString(aProvider),
-                                           nsCString(aPrefix));
+                                           nsCString(aCompletion));
       Unused << BaseProtocol::Send__delete__(this, info, aErrorCode);
     }
     return NS_OK;
   }
 
   // Custom.
   void ClassificationFailed()
   {
--- a/netwerk/base/nsChannelClassifier.cpp
+++ b/netwerk/base/nsChannelClassifier.cpp
@@ -777,37 +777,37 @@ nsChannelClassifier::SameLoadingURI(nsID
 }
 
 // static
 nsresult
 nsChannelClassifier::SetBlockedContent(nsIChannel *channel,
                                        nsresult aErrorCode,
                                        const nsACString& aList,
                                        const nsACString& aProvider,
-                                       const nsACString& aPrefix)
+                                       const nsACString& aCompletion)
 {
   NS_ENSURE_ARG(!aList.IsEmpty());
-  NS_ENSURE_ARG(!aPrefix.IsEmpty());
+  NS_ENSURE_ARG(!aCompletion.IsEmpty());
 
   // Can be called in EITHER the parent or child process.
   nsCOMPtr<nsIParentChannel> parentChannel;
   NS_QueryNotificationCallbacks(channel, parentChannel);
   if (parentChannel) {
     // This channel is a parent-process proxy for a child process request.
     // Tell the child process channel to do this instead.
-    parentChannel->SetClassifierMatchedInfo(aList, aProvider, aPrefix);
+    parentChannel->SetClassifierMatchedInfo(aList, aProvider, aCompletion);
     return NS_OK;
   }
 
   nsresult rv;
   nsCOMPtr<nsIClassifiedChannel> classifiedChannel = do_QueryInterface(channel, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (classifiedChannel) {
-    classifiedChannel->SetMatchedInfo(aList, aProvider, aPrefix);
+    classifiedChannel->SetMatchedInfo(aList, aProvider, aCompletion);
   }
 
   nsCOMPtr<mozIDOMWindowProxy> win;
   nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
     do_GetService(THIRDPARTYUTIL_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, NS_OK);
   rv = thirdPartyUtil->GetTopWindowForChannel(channel, getter_AddRefs(win));
   NS_ENSURE_SUCCESS(rv, NS_OK);
@@ -887,61 +887,61 @@ NS_IMPL_ISUPPORTS(URIClassifierCallbackB
 // A template class for reusing the code.
 // OnClassifyCompleteInternal will be called to pass the result.
 template<class T>
 class IsTrackerWhitelistedCallback final : public URIClassifierCallbackBase {
 public:
   explicit IsTrackerWhitelistedCallback(T* aClosure,
                                         const nsACString& aList,
                                         const nsACString& aProvider,
-                                        const nsACString& aPrefix,
+                                        const nsACString& aCompletion,
                                         nsIURI* aWhitelistURI)
     : mClosure(aClosure)
     , mWhitelistURI(aWhitelistURI)
     , mList(aList)
     , mProvider(aProvider)
-    , mPrefix(aPrefix)
+    , mCompletion(aCompletion)
   {
   }
 
   NS_IMETHOD OnClassifyComplete(nsresult /*aErrorCode*/,
                                 const nsACString& aLists, // Only this matters.
                                 const nsACString& /*aProvider*/,
-                                const nsACString& /*aPrefix*/) override
+                                const nsACString& /*aCompletion*/) override
   {
     nsresult rv;
     if (aLists.IsEmpty()) {
       if (LOG_ENABLED()) {
         MOZ_ASSERT(mWhitelistURI);
 
         LOG(("nsChannelClassifier[%p]: %s is not in the whitelist",
              mClosure.get(), mWhitelistURI->GetSpecOrDefault().get()));
       }
       rv = NS_ERROR_TRACKING_URI;
     } else {
       LOG(("nsChannelClassifier[%p]:OnClassifyComplete tracker found "
            "in whitelist so we won't block it", mClosure.get()));
       rv = NS_OK;
     }
 
-    rv = mClosure->OnClassifyCompleteInternal(rv, mList, mProvider, mPrefix);
+    rv = mClosure->OnClassifyCompleteInternal(rv, mList, mProvider, mCompletion);
     mClosure = nullptr;
     return rv;
   }
 
 private:
   ~IsTrackerWhitelistedCallback() = default;
 
   RefPtr<T> mClosure;
   nsCOMPtr<nsIURI> mWhitelistURI;
 
   // The following 3 values are for forwarding the callback.
   nsCString mList;
   nsCString mProvider;
-  nsCString mPrefix;
+  nsCString mCompletion;
 };
 
 // This class is designed to get the results of checking blacklist and whitelist.
 // 1. The result of local blacklist will be sent back via
 //    OnClassifyComplete, which is called by nsIURIClassifier service.
 // 2. The result of local whitelist is got via OnClassifyCompleteInternal,
 //    which is called by IsTrackerWhitelistedCallback::OnClassifyComplete.
 class IsTrackerBlacklistedCallback final : public nsIURIClassifierCallback {
@@ -954,63 +954,63 @@ public:
   }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURICLASSIFIERCALLBACK
 
   nsresult OnClassifyCompleteInternal(nsresult aErrorCode,
                                       const nsACString& aList,
                                       const nsACString& aProvider,
-                                      const nsACString& aPrefix);
+                                      const nsACString& aCompletion);
 
 private:
   ~IsTrackerBlacklistedCallback() = default;
 
   RefPtr<nsChannelClassifier> mChannelClassifier;
   nsCOMPtr<nsIURIClassifierCallback> mChannelCallback;
 };
 
 NS_IMPL_ISUPPORTS(IsTrackerBlacklistedCallback, nsIURIClassifierCallback)
 
 /*virtual*/ nsresult
 IsTrackerBlacklistedCallback::OnClassifyComplete(nsresult aErrorCode,
                                                  const nsACString& aLists,
                                                  const nsACString& aProvider,
-                                                 const nsACString& aPrefix)
+                                                 const nsACString& aCompletion)
 {
   nsresult status = aLists.IsEmpty() ? NS_OK : NS_ERROR_TRACKING_URI;
   bool tpEnabled = mChannelClassifier->ShouldEnableTrackingProtection();
 
   LOG(("IsTrackerBlacklistedCallback[%p]:OnClassifyComplete "
        " status=0x%" PRIx32 ", tpEnabled=%d",
        mChannelClassifier.get(), static_cast<uint32_t>(status), tpEnabled));
 
   // If this is not in local blacklist or tracking protection is enabled,
   // directly send the status back.
   // The whitelist will be checked at nsChannelClassifier::OnClassifyComplete
   // when tracking protection is enabled, so we can just return here.
   if (NS_SUCCEEDED(status) || tpEnabled) {
     return mChannelCallback->OnClassifyComplete(
-      status, aLists, aProvider, aPrefix);
+      status, aLists, aProvider, aCompletion);
   }
 
   nsCOMPtr<nsIChannel> channel = mChannelClassifier->GetChannel();
   if (LOG_ENABLED()) {
     nsCOMPtr<nsIURI> uri;
     channel->GetURI(getter_AddRefs(uri));
     LOG(("IsTrackerBlacklistedCallback[%p]:OnClassifyComplete channel [%p] "
          "uri=%s, is in blacklist. Start checking whitelist.",
          mChannelClassifier.get(), channel.get(),
          uri->GetSpecOrDefault().get()));
   }
 
   nsCOMPtr<nsIURI> whitelistURI = mChannelClassifier->CreateWhiteListURI();
   nsCOMPtr<nsIURIClassifierCallback> callback =
     new IsTrackerWhitelistedCallback<IsTrackerBlacklistedCallback>(
-      this, aLists, aProvider, aPrefix, whitelistURI);
+      this, aLists, aProvider, aCompletion, whitelistURI);
 
   // If IsTrackerWhitelisted has failed, it means the uri is not in whitelist.
   if (NS_FAILED(mChannelClassifier->IsTrackerWhitelisted(whitelistURI, callback))) {
     LOG(("IsTrackerBlacklistedCallback[%p]:OnClassifyComplete channel [%p] "
          "IsTrackerWhitelisted has failed.",
          mChannelClassifier.get(), channel.get()));
 
     MOZ_ASSERT(mChannelClassifier->ShouldEnableTrackingAnnotation());
@@ -1021,37 +1021,37 @@ IsTrackerBlacklistedCallback::OnClassify
     }
     SetThrottleableHelper(channel);
 
     // We don't want to disable speculative connection when tracking protection
     // is disabled. So, change the status to NS_OK.
     status = NS_OK;
 
     return mChannelCallback->OnClassifyComplete(
-      status, aLists, aProvider, aPrefix);
+      status, aLists, aProvider, aCompletion);
   }
 
   // OnClassifyCompleteInternal() will be called once we know
   // if the tracker is whitelisted.
   return NS_OK;
 }
 
 nsresult
 IsTrackerBlacklistedCallback::OnClassifyCompleteInternal(nsresult aErrorCode,
                                                          const nsACString& aLists,
                                                          const nsACString& aProvider,
-                                                         const nsACString& aPrefix)
+                                                         const nsACString& aCompletion)
 {
   LOG(("IsTrackerBlacklistedCallback[%p]:OnClassifyCompleteInternal"
        " status=0x%" PRIx32,
        mChannelClassifier.get(), static_cast<uint32_t>(aErrorCode)));
 
   if (NS_SUCCEEDED(aErrorCode)) {
     return mChannelCallback->OnClassifyComplete(
-      aErrorCode, aLists, aProvider, aPrefix);
+      aErrorCode, aLists, aProvider, aCompletion);
   }
 
   MOZ_ASSERT(mChannelClassifier->ShouldEnableTrackingAnnotation());
   MOZ_ASSERT(aErrorCode == NS_ERROR_TRACKING_URI);
 
   nsCOMPtr<nsIChannel> channel = mChannelClassifier->GetChannel();
   if (LOG_ENABLED()) {
     nsCOMPtr<nsIURI> uri;
@@ -1064,17 +1064,17 @@ IsTrackerBlacklistedCallback::OnClassify
 
   SetIsTrackingResourceHelper(channel);
   if (CachedPrefs::GetInstance()->IsLowerNetworkPriority()) {
     LowerPriorityHelper(channel);
   }
   SetThrottleableHelper(channel);
 
   return mChannelCallback->OnClassifyComplete(
-      NS_OK, aLists, aProvider, aPrefix);
+      NS_OK, aLists, aProvider, aCompletion);
 }
 
 } // end of unnamed namespace/
 
 already_AddRefed<nsIURI>
 nsChannelClassifier::CreateWhiteListURI() const
 {
   nsresult rv;
@@ -1140,42 +1140,42 @@ nsChannelClassifier::IsTrackerWhiteliste
 
   return uriClassifier->AsyncClassifyLocalWithTables(aWhiteListURI, trackingWhitelist, aCallback);
 }
 
 NS_IMETHODIMP
 nsChannelClassifier::OnClassifyComplete(nsresult aErrorCode,
                                         const nsACString& aList,
                                         const nsACString& aProvider,
-                                        const nsACString& aPrefix)
+                                        const nsACString& aCompletion)
 {
   // Should only be called in the parent process.
   MOZ_ASSERT(XRE_IsParentProcess());
 
   if (aErrorCode == NS_ERROR_TRACKING_URI) {
     nsCOMPtr<nsIURI> whitelistURI = CreateWhiteListURI();
     nsCOMPtr<nsIURIClassifierCallback> callback =
       new IsTrackerWhitelistedCallback<nsChannelClassifier>(
-        this, aList, aProvider, aPrefix, whitelistURI);
+        this, aList, aProvider, aCompletion, whitelistURI);
     if (whitelistURI &&
         NS_SUCCEEDED(IsTrackerWhitelisted(whitelistURI, callback))) {
       // OnClassifyCompleteInternal() will be called once we know
       // if the tracker is whitelisted.
       return NS_OK;
     }
   }
 
-  return OnClassifyCompleteInternal(aErrorCode, aList, aProvider, aPrefix);
+  return OnClassifyCompleteInternal(aErrorCode, aList, aProvider, aCompletion);
 }
 
 nsresult
 nsChannelClassifier::OnClassifyCompleteInternal(nsresult aErrorCode,
                                                 const nsACString& aList,
                                                 const nsACString& aProvider,
-                                                const nsACString& aPrefix)
+                                                const nsACString& aCompletion)
 {
     if (mSuspendedChannel) {
       nsAutoCString errorName;
       if (LOG_ENABLED()) {
         GetErrorName(aErrorCode, errorName);
         LOG(("nsChannelClassifier[%p]:OnClassifyComplete %s (suspended channel)",
              this, errorName.get()));
       }
@@ -1189,17 +1189,17 @@ nsChannelClassifier::OnClassifyCompleteI
                "with error code %s", this, mChannel.get(),
                uri->GetSpecOrDefault().get(), errorName.get()));
         }
 
         // Channel will be cancelled (page element blocked) due to tracking
         // protection or Safe Browsing.
         // Do update the security state of the document and fire a security
         // change event.
-        SetBlockedContent(mChannel, aErrorCode, aList, aProvider, aPrefix);
+        SetBlockedContent(mChannel, aErrorCode, aList, aProvider, aCompletion);
 
         mChannel->Cancel(aErrorCode);
       }
       LOG(("nsChannelClassifier[%p]: resuming channel %p from "
            "OnClassifyComplete", this, mChannel.get()));
       mChannel->Resume();
     }
 
--- a/netwerk/base/nsChannelClassifier.h
+++ b/netwerk/base/nsChannelClassifier.h
@@ -40,17 +40,17 @@ public:
     nsresult IsTrackerWhitelisted(nsIURI* aWhiteListURI,
                                   nsIURIClassifierCallback* aCallback);
 
     // Called once we actually classified an URI. (An additional whitelist
     // check will be done if the classifier reports the URI is a tracker.)
     nsresult OnClassifyCompleteInternal(nsresult aErrorCode,
                                         const nsACString& aList,
                                         const nsACString& aProvider,
-                                        const nsACString& aPrefix);
+                                        const nsACString& aCompletion);
 
     // Check a tracking URI against the local blacklist and whitelist.
     // Returning NS_OK means the check will be processed
     // and the caller should wait for the result.
     nsresult CheckIsTrackerWithLocalTable(nsIURIClassifierCallback* aCallback);
 
     // Helper function to create a whitelist URL.
     already_AddRefed<nsIURI> CreateWhiteListURI() const;
@@ -91,16 +91,16 @@ private:
     void RemoveShutdownObserver();
 public:
     // If we are blocking content, update the corresponding flag in the respective
     // docshell and call nsISecurityEventSink::onSecurityChange.
     static nsresult SetBlockedContent(nsIChannel *channel,
                                       nsresult aErrorCode,
                                       const nsACString& aList,
                                       const nsACString& aProvider,
-                                      const nsACString& aPrefix);
+                                      const nsACString& aCompletion);
     static nsresult NotifyTrackingProtectionDisabled(nsIChannel *aChannel);
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif
--- a/netwerk/base/nsIClassifiedChannel.idl
+++ b/netwerk/base/nsIClassifiedChannel.idl
@@ -17,31 +17,31 @@ interface nsIClassifiedChannel : nsISupp
 {
   /**
    * Sets matched info of the classified channel.
    *
    * @param aList
    *        Name of the Safe Browsing list that matched (e.g. goog-phish-shavar).
    * @param aProvider
    *        Name of the Safe Browsing provider that matched (e.g. google)
-   * @param aPrefix
-   *        Hash prefix of URL that matched Safe Browsing list.
+   * @param aCompletion
+   *        Completion hash of URL that matched Safe Browsing list.
    */
   void setMatchedInfo(in ACString aList,
                       in ACString aProvider,
-                      in ACString aPrefix);
+                      in ACString aCompletion);
 
   /**
    * Name of the list that matched
    */
   readonly attribute ACString matchedList;
 
   /**
    * Name of provider that matched
    */
   readonly attribute ACString matchedProvider;
 
   /**
-   * Hash prefix of URL that matched
+   * Completion hash of URL that matched
    */
-  readonly attribute ACString matchedPrefix;
+  readonly attribute ACString matchedCompletion;
 
 };
--- a/netwerk/base/nsIParentChannel.idl
+++ b/netwerk/base/nsIParentChannel.idl
@@ -35,22 +35,22 @@ interface nsIParentChannel : nsIStreamLi
   [noscript] void notifyTrackingProtectionDisabled();
 
    /**
    * Called to set matched information when URL matches SafeBrowsing list.
    * @param aList
    *        Name of the list that matched
    * @param aProvider
    *        Name of provider that matched
-   * @param aPrefix
-   *        String represents hash prefix that matched
+   * @param aCompletion
+   *        String represents completion hash that matched
    */
   [noscript] void setClassifierMatchedInfo(in ACString aList,
                                            in ACString aProvider,
-                                           in ACString aPrefix);
+                                           in ACString aCompletion);
 
   /**
    * Called to notify the HttpChannelChild that the resource being loaded
    * is on the tracking protection list.
    */
   [noscript] void notifyTrackingResource();
 
   /**
--- a/netwerk/base/nsIURIClassifier.idl
+++ b/netwerk/base/nsIURIClassifier.idl
@@ -29,23 +29,23 @@ interface nsIURIClassifierCallback : nsI
    *
    * @param aErrorCode
    *        The error code with which the channel should be cancelled, or
    *        NS_OK if the load should continue normally.
    * @param aList
    *        Name of the list that matched
    * @param aProvider
    *        Name of provider that matched
-   * @param aPrefix
-   *        Hash prefix of URL that matched
+   * @param aCompletion
+   *        Completion hash of URL that matched
    */
   void onClassifyComplete(in nsresult aErrorCode,
                           in ACString aList,
                           in ACString aProvider,
-                          in ACString aPrefix);
+                          in ACString aCompletion);
 };
 
 /**
  * The URI classifier service checks a URI against lists of phishing
  * and malware sites.
  */
 [scriptable, uuid(596620cc-76e3-4133-9d90-360e59a794cf)]
 interface nsIURIClassifier : nsISupports
--- a/netwerk/protocol/data/DataChannelParent.cpp
+++ b/netwerk/protocol/data/DataChannelParent.cpp
@@ -47,17 +47,17 @@ DataChannelParent::NotifyTrackingResourc
 {
     // Nothing to do.
     return NS_OK;
 }
 
 NS_IMETHODIMP
 DataChannelParent::SetClassifierMatchedInfo(const nsACString& aList,
                                             const nsACString& aProvider,
-                                            const nsACString& aPrefix)
+                                            const nsACString& aCompletion)
 {
   // nothing to do
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DataChannelParent::Delete()
 {
--- a/netwerk/protocol/file/FileChannelParent.cpp
+++ b/netwerk/protocol/file/FileChannelParent.cpp
@@ -47,17 +47,17 @@ FileChannelParent::NotifyTrackingResourc
 {
   // Nothing to do.
   return NS_OK;
 }
 
 NS_IMETHODIMP
 FileChannelParent::SetClassifierMatchedInfo(const nsACString& aList,
                                             const nsACString& aProvider,
-                                            const nsACString& aPrefix)
+                                            const nsACString& aCompletion)
 {
   // nothing to do
   return NS_OK;
 }
 
 NS_IMETHODIMP
 FileChannelParent::Delete()
 {
--- a/netwerk/protocol/ftp/FTPChannelParent.cpp
+++ b/netwerk/protocol/ftp/FTPChannelParent.cpp
@@ -576,17 +576,17 @@ FTPChannelParent::NotifyTrackingResource
 {
   // One day, this should probably be filled in.
   return NS_OK;
 }
 
 NS_IMETHODIMP
 FTPChannelParent::SetClassifierMatchedInfo(const nsACString& aList,
                                            const nsACString& aProvider,
-                                           const nsACString& aPrefix)
+                                           const nsACString& aCompletion)
 {
   // One day, this should probably be filled in.
   return NS_OK;
 }
 
 NS_IMETHODIMP
 FTPChannelParent::Delete()
 {
--- a/netwerk/protocol/http/HttpBackgroundChannelChild.cpp
+++ b/netwerk/protocol/http/HttpBackgroundChannelChild.cpp
@@ -424,17 +424,19 @@ HttpBackgroundChannelChild::RecvSetClass
   MOZ_ASSERT(OnSocketThread());
 
   if (NS_WARN_IF(!mChannelChild)) {
     return IPC_OK();
   }
 
   // SetClassifierMatchedInfo has no order dependency to OnStartRequest.
   // It this be handled as soon as possible
-  mChannelChild->ProcessSetClassifierMatchedInfo(info.list(), info.provider(), info.prefix());
+  mChannelChild->ProcessSetClassifierMatchedInfo(info.list(),
+                                                 info.provider(),
+                                                 info.completion());
 
   return IPC_OK();
 }
 
 void
 HttpBackgroundChannelChild::ActorDestroy(ActorDestroyReason aWhy)
 {
   LOG(("HttpBackgroundChannelChild::ActorDestroy[this=%p]\n", this));
--- a/netwerk/protocol/http/HttpBackgroundChannelParent.cpp
+++ b/netwerk/protocol/http/HttpBackgroundChannelParent.cpp
@@ -395,20 +395,19 @@ HttpBackgroundChannelParent::OnNotifyTra
 
     return NS_SUCCEEDED(rv);
   }
 
   return SendNotifyTrackingResource();
 }
 
 bool
-HttpBackgroundChannelParent::OnSetClassifierMatchedInfo(
-                                                    const nsACString& aList,
-                                                    const nsACString& aProvider,
-                                                    const nsACString& aPrefix)
+HttpBackgroundChannelParent::OnSetClassifierMatchedInfo(const nsACString& aList,
+                                                        const nsACString& aProvider,
+                                                        const nsACString& aCompletion)
 {
   LOG(("HttpBackgroundChannelParent::OnSetClassifierMatchedInfo [this=%p]\n", this));
   AssertIsInMainProcess();
 
   if (NS_WARN_IF(!mIPCOpened)) {
     return false;
   }
 
@@ -416,27 +415,27 @@ HttpBackgroundChannelParent::OnSetClassi
     MutexAutoLock lock(mBgThreadMutex);
     nsresult rv = mBackgroundThread->Dispatch(
       NewRunnableMethod<const nsCString, const nsCString, const nsCString>(
         "net::HttpBackgroundChannelParent::OnSetClassifierMatchedInfo",
         this,
         &HttpBackgroundChannelParent::OnSetClassifierMatchedInfo,
         aList,
         aProvider,
-        aPrefix),
+        aCompletion),
       NS_DISPATCH_NORMAL);
 
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
 
     return NS_SUCCEEDED(rv);
   }
 
   ClassifierInfo info;
   info.list() = aList;
-  info.prefix() = aPrefix;
+  info.completion() = aCompletion;
   info.provider() = aProvider;
 
   return SendSetClassifierMatchedInfo(info);
 }
 
 void
 HttpBackgroundChannelParent::ActorDestroy(ActorDestroyReason aWhy)
 {
--- a/netwerk/protocol/http/HttpBackgroundChannelParent.h
+++ b/netwerk/protocol/http/HttpBackgroundChannelParent.h
@@ -69,17 +69,17 @@ public:
   bool OnNotifyTrackingProtectionDisabled();
 
   // To send NotifyTrackingResource message over background channel.
   bool OnNotifyTrackingResource();
 
   // To send SetClassifierMatchedInfo message over background channel.
   bool OnSetClassifierMatchedInfo(const nsACString& aList,
                                   const nsACString& aProvider,
-                                  const nsACString& aPrefix);
+                                  const nsACString& aCompletion);
 
 protected:
   void ActorDestroy(ActorDestroyReason aWhy) override;
 
 private:
   virtual ~HttpBackgroundChannelParent();
 
   Atomic<bool> mIPCOpened;
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -3573,31 +3573,31 @@ HttpBaseChannel::GetMatchedList(nsACStri
 NS_IMETHODIMP
 HttpBaseChannel::GetMatchedProvider(nsACString& aProvider)
 {
   aProvider = mMatchedProvider;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HttpBaseChannel::GetMatchedPrefix(nsACString& aPrefix)
+HttpBaseChannel::GetMatchedCompletion(nsACString& aCompletion)
 {
-  aPrefix = mMatchedPrefix;
+  aCompletion = mMatchedCompletion;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpBaseChannel::SetMatchedInfo(const nsACString& aList,
                                 const nsACString& aProvider,
-                                const nsACString& aPrefix) {
+                                const nsACString& aCompletion) {
   NS_ENSURE_ARG(!aList.IsEmpty());
 
   mMatchedList = aList;
   mMatchedProvider = aProvider;
-  mMatchedPrefix = aPrefix;
+  mMatchedCompletion = aCompletion;
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // HttpBaseChannel::nsITimedChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -640,17 +640,17 @@ protected:
   // method.
   uint32_t mLastRedirectFlags;
 
   nsString mIntegrityMetadata;
 
   // Classified channel's matched information
   nsCString mMatchedList;
   nsCString mMatchedProvider;
-  nsCString mMatchedPrefix;
+  nsCString mMatchedCompletion;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(HttpBaseChannel, HTTP_BASE_CHANNEL_IID)
 
 // Share some code while working around C++'s absurd inability to handle casting
 // of member functions between base/derived types.
 // - We want to store member function pointer to call at resume time, but one
 //   such function--HandleAsyncAbort--we want to share between the
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -1149,28 +1149,28 @@ HttpChannelChild::DoOnStopRequest(nsIReq
   // NB: We use aChannelStatus here instead of mStatus because if there was an
   // nsCORSListenerProxy on this request, it will override the tracking
   // protection's return value.
   if (aChannelStatus == NS_ERROR_TRACKING_URI ||
       aChannelStatus == NS_ERROR_MALWARE_URI ||
       aChannelStatus == NS_ERROR_UNWANTED_URI ||
       aChannelStatus == NS_ERROR_BLOCKED_URI ||
       aChannelStatus == NS_ERROR_PHISHING_URI) {
-    nsCString list, provider, prefix;
+    nsCString list, provider, completion;
 
     nsresult rv = GetMatchedList(list);
     NS_ENSURE_SUCCESS_VOID(rv);
 
     rv = GetMatchedProvider(provider);
     NS_ENSURE_SUCCESS_VOID(rv);
 
-    rv = GetMatchedPrefix(prefix);
+    rv = GetMatchedCompletion(completion);
     NS_ENSURE_SUCCESS_VOID(rv);
 
-    nsChannelClassifier::SetBlockedContent(this, aChannelStatus, list, provider, prefix);
+    nsChannelClassifier::SetBlockedContent(this, aChannelStatus, list, provider, completion);
   }
 
   MOZ_ASSERT(!mOnStopRequestCalled,
              "We should not call OnStopRequest twice");
 
   // In theory mListener should not be null, but in practice sometimes it is.
   MOZ_ASSERT(mListener);
   if (mListener) {
@@ -1800,27 +1800,27 @@ HttpChannelChild::FlushedForDiversion()
   mFlushedForDiversion = true;
 
   SendDivertComplete();
 }
 
 void
 HttpChannelChild::ProcessSetClassifierMatchedInfo(const nsCString& aList,
                                                   const nsCString& aProvider,
-                                                  const nsCString& aPrefix)
+                                                  const nsCString& aCompletion)
 {
   LOG(("HttpChannelChild::ProcessSetClassifierMatchedInfo [this=%p]\n", this));
   MOZ_ASSERT(OnSocketThread());
 
   nsCOMPtr<nsIEventTarget> neckoTarget = GetNeckoTarget();
   neckoTarget->Dispatch(
     NewRunnableMethod<const nsCString, const nsCString, const nsCString>
       ("HttpChannelChild::SetMatchedInfo",
        this, &HttpChannelChild::SetMatchedInfo,
-       aList, aProvider, aPrefix),
+       aList, aProvider, aCompletion),
     NS_DISPATCH_NORMAL);
 }
 
 void
 HttpChannelChild::ProcessDivertMessages()
 {
   LOG(("HttpChannelChild::ProcessDivertMessages [this=%p]\n", this));
   MOZ_ASSERT(OnSocketThread());
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -233,17 +233,17 @@ private:
   void ProcessOnProgress(const int64_t& aProgress, const int64_t& aProgressMax);
   void ProcessOnStatus(const nsresult& aStatus);
   void ProcessFlushedForDiversion();
   void ProcessDivertMessages();
   void ProcessNotifyTrackingProtectionDisabled();
   void ProcessNotifyTrackingResource();
   void ProcessSetClassifierMatchedInfo(const nsCString& aList,
                                        const nsCString& aProvider,
-                                       const nsCString& aPrefix);
+                                       const nsCString& aCompletion);
 
 
   void DoOnStartRequest(nsIRequest* aRequest, nsISupports* aContext);
   void DoOnStatus(nsIRequest* aRequest, nsresult status);
   void DoOnProgress(nsIRequest* aRequest, int64_t progress, int64_t progressMax);
   void DoOnDataAvailable(nsIRequest* aRequest, nsISupports* aContext, nsIInputStream* aStream,
                          uint64_t offset, uint32_t count);
   void DoPreOnStopRequest(nsresult aStatus);
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -1717,22 +1717,22 @@ HttpChannelParent::NotifyTrackingProtect
     Unused << mBgParent->OnNotifyTrackingProtectionDisabled();
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpChannelParent::SetClassifierMatchedInfo(const nsACString& aList,
                                             const nsACString& aProvider,
-                                            const nsACString& aPrefix)
+                                            const nsACString& aCompletion)
 {
   LOG(("HttpChannelParent::SetClassifierMatchedInfo [this=%p]\n", this));
   if (!mIPCClosed) {
     MOZ_ASSERT(mBgParent);
-    Unused << mBgParent->OnSetClassifierMatchedInfo(aList, aProvider, aPrefix);
+    Unused << mBgParent->OnSetClassifierMatchedInfo(aList, aProvider, aCompletion);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpChannelParent::NotifyTrackingResource()
 {
   LOG(("HttpChannelParent::NotifyTrackingResource [this=%p]\n", this));
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
@@ -1289,19 +1289,19 @@ nsUrlClassifierLookupCallback::HandleRes
     LOG(("Confirmed result %s from table %s",
          result.PartialHashHex().get(), result.mTableName.get()));
 
     if (tables.IndexOf(result.mTableName) == nsTArray<nsCString>::NoIndex) {
       tables.AppendElement(result.mTableName);
     }
 
     if (classifyCallback) {
-      nsCString prefixString;
-      result.hash.fixedLengthPrefix.ToString(prefixString);
-      classifyCallback->HandleResult(result.mTableName, prefixString);
+      nsCString completionString;
+      result.hash.complete.ToString(completionString);
+      classifyCallback->HandleResult(result.mTableName, completionString);
     }
   }
 
   // Some parts of this gethash request generated no hits at all.
   // Save the prefixes we checked to prevent repeated requests.
   CacheMisses();
 
   if (mCacheResults) {
@@ -1378,17 +1378,17 @@ public:
   explicit nsUrlClassifierClassifyCallback(nsIURIClassifierCallback *c)
     : mCallback(c)
     {}
 
 private:
 
   struct ClassifyMatchedInfo {
     nsCString table;
-    nsCString prefix;
+    nsCString completion;
     Provider provider;
     nsresult errorCode;
   };
 
   ~nsUrlClassifierClassifyCallback() {};
 
   nsCOMPtr<nsIURIClassifierCallback> mCallback;
   nsTArray<ClassifyMatchedInfo> mMatchedArray;
@@ -1413,37 +1413,37 @@ nsUrlClassifierClassifyCallback::HandleE
           (!matchedInfo ||
            matchedInfo->provider.priority < mMatchedArray[i].provider.priority)) {
         matchedInfo = &mMatchedArray[i];
       }
     }
   }
 
   nsCString provider = matchedInfo ? matchedInfo->provider.name : EmptyCString();
-  nsCString prefix = matchedInfo ? matchedInfo->prefix : EmptyCString();
+  nsCString completion = matchedInfo ? matchedInfo->completion : EmptyCString();
   nsCString table = matchedInfo ? matchedInfo->table : EmptyCString();
 
-  mCallback->OnClassifyComplete(response, table, provider, prefix);
+  mCallback->OnClassifyComplete(response, table, provider, completion);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsUrlClassifierClassifyCallback::HandleResult(const nsACString& aTable,
-                                              const nsACString& aPrefix)
+                                              const nsACString& aCompletion)
 {
-  LOG(("nsUrlClassifierClassifyCallback::HandleResult [%p, table %s prefix %s]",
-        this, PromiseFlatCString(aTable).get(), PromiseFlatCString(aPrefix).get()));
+  LOG(("nsUrlClassifierClassifyCallback::HandleResult [%p, table %s completion %s]",
+        this, PromiseFlatCString(aTable).get(), PromiseFlatCString(aCompletion).get()));
 
-  if (NS_WARN_IF(aTable.IsEmpty()) || NS_WARN_IF(aPrefix.IsEmpty())) {
+  if (NS_WARN_IF(aTable.IsEmpty()) || NS_WARN_IF(aCompletion.IsEmpty())) {
     return NS_ERROR_INVALID_ARG;
   }
 
   ClassifyMatchedInfo* matchedInfo = mMatchedArray.AppendElement();
   matchedInfo->table = aTable;
-  matchedInfo->prefix = aPrefix;
+  matchedInfo->completion = aCompletion;
 
   nsCOMPtr<nsIUrlClassifierUtils> urlUtil =
     do_GetService(NS_URLCLASSIFIERUTILS_CONTRACTID);
 
   nsCString provider;
   nsresult rv = urlUtil->GetProvider(aTable, provider);
 
   matchedInfo->provider.name = NS_SUCCEEDED(rv) ? provider : EmptyCString();
--- a/uriloader/exthandler/nsExternalProtocolHandler.cpp
+++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp
@@ -407,17 +407,17 @@ NS_IMETHODIMP nsExtProtocolChannel::SetP
 NS_IMETHODIMP nsExtProtocolChannel::NotifyTrackingProtectionDisabled()
 {
   // nothing to do
   return NS_OK;
 }
 
 NS_IMETHODIMP nsExtProtocolChannel::SetClassifierMatchedInfo(const nsACString& aList,
                                                              const nsACString& aProvider,
-                                                             const nsACString& aPrefix)
+                                                             const nsACString& aCompletion)
 {
   // nothing to do
   return NS_OK;
 }
 
 NS_IMETHODIMP nsExtProtocolChannel::NotifyTrackingResource()
 {
   // nothing to do