diff --git a/netwerk/cookie/Cookie.cpp b/netwerk/cookie/Cookie.cpp index 3ec268119a61..0d5aa0d1f540 100644 --- a/netwerk/cookie/Cookie.cpp +++ b/netwerk/cookie/Cookie.cpp @@ -47,16 +47,16 @@ already_AddRefed Cookie::Create( int64_t aCreationTime, bool aIsSession, bool aIsSecure, bool aIsHttpOnly, const OriginAttributes& aOriginAttributes, int32_t aSameSite, int32_t aRawSameSite) { - mozilla::net::CookieStruct cookieData( - nsCString(aName), nsCString(aValue), nsCString(aHost), nsCString(aPath), - aExpiry, aLastAccessed, aCreationTime, aIsHttpOnly, aIsSession, aIsSecure, - aSameSite, aRawSameSite); + CookieStruct cookieData(nsCString(aName), nsCString(aValue), nsCString(aHost), + nsCString(aPath), aExpiry, aLastAccessed, + aCreationTime, aIsHttpOnly, aIsSession, aIsSecure, + aSameSite, aRawSameSite); return Create(cookieData, aOriginAttributes); } already_AddRefed Cookie::Create( - const mozilla::net::CookieStruct& aCookieData, + const CookieStruct& aCookieData, const OriginAttributes& aOriginAttributes) { RefPtr cookie = new Cookie(aCookieData, aOriginAttributes); @@ -98,8 +98,7 @@ bool Cookie::IsStale() const { int64_t currentTimeInUsec = PR_Now(); return currentTimeInUsec - LastAccessed() > - mozilla::StaticPrefs::network_cookie_staleThreshold() * - PR_USEC_PER_SEC; + StaticPrefs::network_cookie_staleThreshold() * PR_USEC_PER_SEC; } /****************************************************************************** @@ -157,7 +156,7 @@ NS_IMETHODIMP Cookie::GetLastAccessed(int64_t* aTime) { return NS_OK; } NS_IMETHODIMP Cookie::GetSameSite(int32_t* aSameSite) { - if (mozilla::StaticPrefs::network_cookie_sameSite_laxByDefault()) { + if (StaticPrefs::network_cookie_sameSite_laxByDefault()) { *aSameSite = SameSite(); } else { *aSameSite = RawSameSite(); @@ -215,7 +214,7 @@ Cookie::GetExpires(uint64_t* aExpires) { } // static -bool Cookie::ValidateRawSame(const mozilla::net::CookieStruct& aCookieData) { +bool Cookie::ValidateRawSame(const CookieStruct& aCookieData) { return aCookieData.rawSameSite() == aCookieData.sameSite() || aCookieData.rawSameSite() == nsICookie::SAMESITE_NONE; } diff --git a/netwerk/cookie/Cookie.h b/netwerk/cookie/Cookie.h index 930dc39cacb4..535355720d16 100644 --- a/netwerk/cookie/Cookie.h +++ b/netwerk/cookie/Cookie.h @@ -40,13 +40,13 @@ class Cookie final : public nsICookie { private: // for internal use only. see Cookie::Create(). - Cookie(const mozilla::net::CookieStruct& aCookieData, + Cookie(const CookieStruct& aCookieData, const OriginAttributes& aOriginAttributes) : mData(aCookieData), mOriginAttributes(aOriginAttributes) {} public: // Returns false if rawSameSite has an invalid value, compared to sameSite. - static bool ValidateRawSame(const mozilla::net::CookieStruct& aCookieData); + static bool ValidateRawSame(const CookieStruct& aCookieData); // Generate a unique and monotonically increasing creation time. See comment // in Cookie.cpp. @@ -62,7 +62,7 @@ class Cookie final : public nsICookie { int32_t aRawSameSite); static already_AddRefed Create( - const mozilla::net::CookieStruct& aCookieData, + const CookieStruct& aCookieData, const OriginAttributes& aOriginAttributes); size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; @@ -103,7 +103,7 @@ class Cookie final : public nsICookie { bool IsStale() const; - const mozilla::net::CookieStruct& ToIPC() const { return mData; } + const CookieStruct& ToIPC() const { return mData; } protected: virtual ~Cookie() = default; @@ -112,8 +112,8 @@ class Cookie final : public nsICookie { // member variables // // Please update SizeOfIncludingThis if this strategy changes. - mozilla::net::CookieStruct mData; - mozilla::OriginAttributes mOriginAttributes; + CookieStruct mData; + OriginAttributes mOriginAttributes; nsCString mFilePathCache; }; diff --git a/netwerk/cookie/CookieJarSettings.cpp b/netwerk/cookie/CookieJarSettings.cpp index 2a813463f029..c84e4f56caa9 100644 --- a/netwerk/cookie/CookieJarSettings.cpp +++ b/netwerk/cookie/CookieJarSettings.cpp @@ -117,7 +117,7 @@ CookieJarSettings::CookieJarSettings(uint32_t aCookieBehavior, State aState) CookieJarSettings::~CookieJarSettings() { if (!NS_IsMainThread() && !mCookiePermissions.IsEmpty()) { nsCOMPtr systemGroupEventTarget = - mozilla::SystemGroup::EventTargetFor(mozilla::TaskCategory::Other); + SystemGroup::EventTargetFor(TaskCategory::Other); MOZ_ASSERT(systemGroupEventTarget); RefPtr r = new ReleaseCookiePermissions(mCookiePermissions); diff --git a/netwerk/cookie/CookieKey.h b/netwerk/cookie/CookieKey.h index 9c50888cd079..86291a187e24 100644 --- a/netwerk/cookie/CookieKey.h +++ b/netwerk/cookie/CookieKey.h @@ -42,10 +42,10 @@ class CookieKey : public PLDHashEntryHdr { nsAutoCString suffix; aKey->mOriginAttributes.CreateSuffix(suffix); temp.Append(suffix); - return mozilla::HashString(temp); + return HashString(temp); } - size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const { return mBaseDomain.SizeOfExcludingThisIfUnshared(aMallocSizeOf); } diff --git a/netwerk/cookie/CookiePermission.cpp b/netwerk/cookie/CookiePermission.cpp index 6d0cdc6424db..b945144b1ee4 100644 --- a/netwerk/cookie/CookiePermission.cpp +++ b/netwerk/cookie/CookiePermission.cpp @@ -33,7 +33,7 @@ namespace net { static const bool kDefaultPolicy = true; namespace { -mozilla::StaticRefPtr gSingleton; +StaticRefPtr gSingleton; } NS_IMPL_ISUPPORTS(CookiePermission, nsICookiePermission) diff --git a/netwerk/cookie/CookiePersistentStorage.cpp b/netwerk/cookie/CookiePersistentStorage.cpp index 59feef1a62a5..eaa1f3a072b1 100644 --- a/netwerk/cookie/CookiePersistentStorage.cpp +++ b/netwerk/cookie/CookiePersistentStorage.cpp @@ -276,7 +276,7 @@ class InsertCookieDBListener final : public DBListenerErrorHandler { } // This notification is just for testing. - nsCOMPtr os = mozilla::services::GetObserverService(); + nsCOMPtr os = services::GetObserverService(); if (os) { os->NotifyObservers(nullptr, "cookie-saved-on-disk", nullptr); } @@ -394,7 +394,7 @@ void CookiePersistentStorage::NotifyChangedInternal(nsISupports* aSubject, } } - nsCOMPtr os = mozilla::services::GetObserverService(); + nsCOMPtr os = services::GetObserverService(); if (os) { os->NotifyObservers(aSubject, "session-cookie-changed", aData); } @@ -422,8 +422,7 @@ void CookiePersistentStorage::RemoveAllInternal() { void CookiePersistentStorage::WriteCookieToDB( const nsACString& aBaseDomain, const OriginAttributes& aOriginAttributes, - mozilla::net::Cookie* aCookie, - mozIStorageBindingParamsArray* aParamsArray) { + Cookie* aCookie, mozIStorageBindingParamsArray* aParamsArray) { if (mDBConn) { mozIStorageAsyncStatement* stmt = mStmtInsert; nsCOMPtr paramsArray(aParamsArray); @@ -484,8 +483,7 @@ void CookiePersistentStorage::HandleCorruptDB() { } void CookiePersistentStorage::RemoveCookiesWithOriginAttributes( - const mozilla::OriginAttributesPattern& aPattern, - const nsACString& aBaseDomain) { + const OriginAttributesPattern& aPattern, const nsACString& aBaseDomain) { mozStorageTransaction transaction(mDBConn, false); CookieStorage::RemoveCookiesWithOriginAttributes(aPattern, aBaseDomain); @@ -496,7 +494,7 @@ void CookiePersistentStorage::RemoveCookiesWithOriginAttributes( void CookiePersistentStorage::RemoveCookiesFromExactHost( const nsACString& aHost, const nsACString& aBaseDomain, - const mozilla::OriginAttributesPattern& aPattern) { + const OriginAttributesPattern& aPattern) { mozStorageTransaction transaction(mDBConn, false); CookieStorage::RemoveCookiesFromExactHost(aHost, aBaseDomain, aPattern); @@ -1627,7 +1625,7 @@ void CookiePersistentStorage::RebuildCorruptDB() { NS_ASSERTION(mCorruptFlag == CookiePersistentStorage::CLOSING_FOR_REBUILD, "should be in CLOSING_FOR_REBUILD state"); - nsCOMPtr os = mozilla::services::GetObserverService(); + nsCOMPtr os = services::GetObserverService(); mCorruptFlag = CookiePersistentStorage::REBUILDING; @@ -1643,8 +1641,7 @@ void CookiePersistentStorage::RebuildCorruptDB() { nsCOMPtr innerRunnable = NS_NewRunnableFunction( "RebuildCorruptDB.TryInitDBComplete", [self, result] { - nsCOMPtr os = - mozilla::services::GetObserverService(); + nsCOMPtr os = services::GetObserverService(); if (result != RESULT_OK) { // We're done. Reset our DB connection and statements, and // notify of closure. @@ -1716,7 +1713,7 @@ void CookiePersistentStorage::HandleDBClosed() { COOKIE_LOGSTRING(LogLevel::Debug, ("HandleDBClosed(): CookieStorage %p closed", this)); - nsCOMPtr os = mozilla::services::GetObserverService(); + nsCOMPtr os = services::GetObserverService(); switch (mCorruptFlag) { case CookiePersistentStorage::OK: { @@ -1825,7 +1822,7 @@ CookiePersistentStorage::OpenDBResult CookiePersistentStorage::Read() { } // Extract data from a single result row and create an Cookie. -mozilla::UniquePtr CookiePersistentStorage::GetCookieFromRow( +UniquePtr CookiePersistentStorage::GetCookieFromRow( mozIStorageStatement* aRow) { nsCString name, value, host, path; DebugOnly rv = aRow->GetUTF8String(IDX_NAME, name); @@ -1846,9 +1843,9 @@ mozilla::UniquePtr CookiePersistentStorage::GetCookieFromRow( int32_t rawSameSite = aRow->AsInt32(IDX_RAW_SAME_SITE); // Create a new constCookie and assign the data. - return mozilla::MakeUnique( - name, value, host, path, expiry, lastAccessed, creationTime, isHttpOnly, - false, isSecure, sameSite, rawSameSite); + return MakeUnique(name, value, host, path, expiry, lastAccessed, + creationTime, isHttpOnly, false, isSecure, + sameSite, rawSameSite); } void CookiePersistentStorage::EnsureReadComplete() { @@ -1942,9 +1939,9 @@ void CookiePersistentStorage::InitDBConn() { COOKIE_LOGSTRING(LogLevel::Debug, ("InitDBConn(): mInitializedDBConn = true")); - mEndInitDBConn = mozilla::TimeStamp::Now(); + mEndInitDBConn = TimeStamp::Now(); - nsCOMPtr os = mozilla::services::GetObserverService(); + nsCOMPtr os = services::GetObserverService(); if (os) { os->NotifyObservers(nullptr, "cookie-db-read", nullptr); mReadArray.Clear(); diff --git a/netwerk/cookie/CookiePersistentStorage.h b/netwerk/cookie/CookiePersistentStorage.h index ac841df5b4bd..01530ae61c29 100644 --- a/netwerk/cookie/CookiePersistentStorage.h +++ b/netwerk/cookie/CookiePersistentStorage.h @@ -33,12 +33,12 @@ class CookiePersistentStorage final : public CookieStorage { void HandleCorruptDB(); void RemoveCookiesWithOriginAttributes( - const mozilla::OriginAttributesPattern& aPattern, + const OriginAttributesPattern& aPattern, const nsACString& aBaseDomain) override; void RemoveCookiesFromExactHost( const nsACString& aHost, const nsACString& aBaseDomain, - const mozilla::OriginAttributesPattern& aPattern) override; + const OriginAttributesPattern& aPattern) override; void StaleCookies(const nsTArray& aCookieList, int64_t aCurrentTimeInUsec) override; @@ -78,7 +78,7 @@ class CookiePersistentStorage final : public CookieStorage { void WriteCookieToDB(const nsACString& aBaseDomain, const OriginAttributes& aOriginAttributes, - mozilla::net::Cookie* aCookie, + Cookie* aCookie, mozIStorageBindingParamsArray* aParamsArray) override; void RemoveAllInternal() override; @@ -109,7 +109,7 @@ class CookiePersistentStorage final : public CookieStorage { nsresult CreateTableForSchemaVersion6(); nsresult CreateTableForSchemaVersion5(); - mozilla::UniquePtr GetCookieFromRow(mozIStorageStatement* aRow); + UniquePtr GetCookieFromRow(mozIStorageStatement* aRow); nsCOMPtr mThread; nsCOMPtr mStorageService; @@ -119,17 +119,17 @@ class CookiePersistentStorage final : public CookieStorage { struct CookieDomainTuple { CookieKey key; OriginAttributes originAttributes; - mozilla::UniquePtr cookie; + UniquePtr cookie; }; // thread - mozilla::TimeStamp mEndInitDBConn; + TimeStamp mEndInitDBConn; nsTArray mReadArray; - mozilla::Monitor mMonitor; + Monitor mMonitor; - mozilla::Atomic mInitialized; - mozilla::Atomic mInitializedDBConn; + Atomic mInitialized; + Atomic mInitializedDBConn; nsCOMPtr mCookieFile; nsCOMPtr mDBConn; diff --git a/netwerk/cookie/CookiePrivateStorage.h b/netwerk/cookie/CookiePrivateStorage.h index 705027050e88..b019a9abb562 100644 --- a/netwerk/cookie/CookiePrivateStorage.h +++ b/netwerk/cookie/CookiePrivateStorage.h @@ -30,7 +30,7 @@ class CookiePrivateStorage final : public CookieStorage { void WriteCookieToDB(const nsACString& aBaseDomain, const OriginAttributes& aOriginAttributes, - mozilla::net::Cookie* aCookie, + Cookie* aCookie, mozIStorageBindingParamsArray* aParamsArray) override{}; void RemoveAllInternal() override {} diff --git a/netwerk/cookie/CookieServiceChild.cpp b/netwerk/cookie/CookieServiceChild.cpp index 6e0f83648750..a555a411dc7d 100644 --- a/netwerk/cookie/CookieServiceChild.cpp +++ b/netwerk/cookie/CookieServiceChild.cpp @@ -33,7 +33,6 @@ #include "ThirdPartyUtil.h" using namespace mozilla::ipc; -using mozilla::OriginAttributes; namespace mozilla { namespace net { @@ -88,8 +87,7 @@ CookieServiceChild::CookieServiceChild() { PrefChanged(prefBranch); } - nsCOMPtr observerService = - mozilla::services::GetObserverService(); + nsCOMPtr observerService = services::GetObserverService(); if (observerService) { observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false); } @@ -141,7 +139,7 @@ void CookieServiceChild::TrackCookieLoad(nsIChannel* aChannel) { aChannel->GetURI(getter_AddRefs(uri)); nsCOMPtr loadInfo = aChannel->LoadInfo(); - mozilla::OriginAttributes attrs = loadInfo->GetOriginAttributes(); + OriginAttributes attrs = loadInfo->GetOriginAttributes(); StoragePrincipalHelper::PrepareOriginAttributes(aChannel, attrs); URIParams uriParams; SerializeURI(uri, uriParams); @@ -155,13 +153,13 @@ void CookieServiceChild::TrackCookieLoad(nsIChannel* aChannel) { rejectedReason, isSafeTopLevelNav, isSameSiteForeign, attrs); } -mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveAll() { +IPCResult CookieServiceChild::RecvRemoveAll() { mCookiesMap.Clear(); return IPC_OK(); } -mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveCookie( - const CookieStruct& aCookie, const OriginAttributes& aAttrs) { +IPCResult CookieServiceChild::RecvRemoveCookie(const CookieStruct& aCookie, + const OriginAttributes& aAttrs) { nsCString baseDomain; CookieCommons::GetBaseDomainFromHost(mTLDService, aCookie.host(), baseDomain); CookieKey key(baseDomain, aAttrs); @@ -185,8 +183,8 @@ mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveCookie( return IPC_OK(); } -mozilla::ipc::IPCResult CookieServiceChild::RecvAddCookie( - const CookieStruct& aCookie, const OriginAttributes& aAttrs) { +IPCResult CookieServiceChild::RecvAddCookie(const CookieStruct& aCookie, + const OriginAttributes& aAttrs) { RefPtr cookie = Cookie::Create( aCookie.name(), aCookie.value(), aCookie.host(), aCookie.path(), aCookie.expiry(), aCookie.lastAccessed(), aCookie.creationTime(), @@ -196,7 +194,7 @@ mozilla::ipc::IPCResult CookieServiceChild::RecvAddCookie( return IPC_OK(); } -mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveBatchDeletedCookies( +IPCResult CookieServiceChild::RecvRemoveBatchDeletedCookies( nsTArray&& aCookiesList, nsTArray&& aAttrsList) { MOZ_ASSERT(aCookiesList.Length() == aAttrsList.Length()); @@ -207,7 +205,7 @@ mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveBatchDeletedCookies( return IPC_OK(); } -mozilla::ipc::IPCResult CookieServiceChild::RecvTrackCookiesLoad( +IPCResult CookieServiceChild::RecvTrackCookiesLoad( nsTArray&& aCookiesList, const OriginAttributes& aAttrs) { for (uint32_t i = 0; i < aCookiesList.Length(); i++) { RefPtr cookie = Cookie::Create( @@ -254,7 +252,7 @@ void CookieServiceChild::GetCookieStringFromCookieHashTable( nsAutoCString baseDomain; nsCOMPtr loadInfo; - mozilla::OriginAttributes attrs; + OriginAttributes attrs; if (aChannel) { loadInfo = aChannel->LoadInfo(); attrs = loadInfo->GetOriginAttributes(); @@ -356,7 +354,7 @@ uint32_t CookieServiceChild::CountCookiesFromHashTable( } void CookieServiceChild::SetCookieInternal( - const CookieStruct& aCookieData, const mozilla::OriginAttributes& aAttrs, + const CookieStruct& aCookieData, const OriginAttributes& aAttrs, nsIChannel* aChannel, bool aFromHttp, nsICookiePermission* aPermissionService) { int64_t currentTimeInUsec = PR_Now(); @@ -486,7 +484,7 @@ nsresult CookieServiceChild::SetCookieStringInternal( SerializeURI(aHostURI, hostURIParams); Maybe channelURIParams; - mozilla::OriginAttributes attrs; + OriginAttributes attrs; if (aChannel) { nsCOMPtr channelURI; aChannel->GetURI(getter_AddRefs(channelURI)); @@ -590,7 +588,7 @@ CookieServiceChild::Observe(nsISupports* aSubject, const char* aTopic, mCookieTimer = nullptr; } nsCOMPtr observerService = - mozilla::services::GetObserverService(); + services::GetObserverService(); if (observerService) { observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID); } diff --git a/netwerk/cookie/CookieServiceChild.h b/netwerk/cookie/CookieServiceChild.h index 022391b4ba36..1e13253a8922 100644 --- a/netwerk/cookie/CookieServiceChild.h +++ b/netwerk/cookie/CookieServiceChild.h @@ -75,8 +75,8 @@ class CookieServiceChild : public PCookieServiceChild, void RecordDocumentCookie(Cookie* aCookie, const OriginAttributes& aAttrs); void SetCookieInternal(const CookieStruct& aCookieData, - const mozilla::OriginAttributes& aAttrs, - nsIChannel* aChannel, bool aFromHttp, + const OriginAttributes& aAttrs, nsIChannel* aChannel, + bool aFromHttp, nsICookiePermission* aPermissionService); uint32_t CountCookiesFromHashTable(const nsCString& aBaseDomain, diff --git a/netwerk/cookie/CookieServiceParent.cpp b/netwerk/cookie/CookieServiceParent.cpp index bca77e3cca14..75bf2fbd10cf 100644 --- a/netwerk/cookie/CookieServiceParent.cpp +++ b/netwerk/cookie/CookieServiceParent.cpp @@ -21,7 +21,6 @@ using namespace mozilla::ipc; using mozilla::BasePrincipal; using mozilla::OriginAttributes; using mozilla::dom::PContentParent; -using mozilla::net::NeckoParent; namespace { @@ -105,7 +104,7 @@ void CookieServiceParent::TrackCookieLoad(nsIChannel* aChannel) { aChannel->GetURI(getter_AddRefs(uri)); nsCOMPtr loadInfo = aChannel->LoadInfo(); - mozilla::OriginAttributes attrs = loadInfo->GetOriginAttributes(); + OriginAttributes attrs = loadInfo->GetOriginAttributes(); bool isSafeTopLevelNav = NS_IsSafeTopLevelNav(aChannel); bool aIsSameSiteForeign = NS_IsSameSiteForeign(aChannel, uri); @@ -146,7 +145,7 @@ void CookieServiceParent::SerialializeCookieList( } } -mozilla::ipc::IPCResult CookieServiceParent::RecvPrepareCookieList( +IPCResult CookieServiceParent::RecvPrepareCookieList( const URIParams& aHost, const bool& aIsForeign, const bool& aIsThirdPartyTrackingResource, const bool& aIsThirdPartySocialTrackingResource, @@ -176,7 +175,7 @@ void CookieServiceParent::ActorDestroy(ActorDestroyReason aWhy) { // non-refcounted class. } -mozilla::ipc::IPCResult CookieServiceParent::RecvSetCookieString( +IPCResult CookieServiceParent::RecvSetCookieString( const URIParams& aHost, const Maybe& aChannelURI, const Maybe& aLoadInfoArgs, const bool& aIsForeign, const bool& aIsThirdPartyTrackingResource, diff --git a/netwerk/cookie/CookieStorage.cpp b/netwerk/cookie/CookieStorage.cpp index 4e258a3dc44c..ffe15f63341b 100644 --- a/netwerk/cookie/CookieStorage.cpp +++ b/netwerk/cookie/CookieStorage.cpp @@ -245,8 +245,8 @@ const nsTArray>* CookieStorage::GetCookiesFromHost( } void CookieStorage::GetCookiesWithOriginAttributes( - const mozilla::OriginAttributesPattern& aPattern, - const nsACString& aBaseDomain, nsTArray>& aResult) { + const OriginAttributesPattern& aPattern, const nsACString& aBaseDomain, + nsTArray>& aResult) { for (auto iter = mHostTable.Iter(); !iter.Done(); iter.Next()) { CookieEntry* entry = iter.Get(); @@ -286,8 +286,7 @@ void CookieStorage::RemoveCookie(const nsACString& aBaseDomain, } void CookieStorage::RemoveCookiesWithOriginAttributes( - const mozilla::OriginAttributesPattern& aPattern, - const nsACString& aBaseDomain) { + const OriginAttributesPattern& aPattern, const nsACString& aBaseDomain) { // Iterate the hash table of CookieEntry. for (auto iter = mHostTable.Iter(); !iter.Done(); iter.Next()) { CookieEntry* entry = iter.Get(); @@ -320,7 +319,7 @@ void CookieStorage::RemoveCookiesWithOriginAttributes( void CookieStorage::RemoveCookiesFromExactHost( const nsACString& aHost, const nsACString& aBaseDomain, - const mozilla::OriginAttributesPattern& aPattern) { + const OriginAttributesPattern& aPattern) { // Iterate the hash table of CookieEntry. for (auto iter = mHostTable.Iter(); !iter.Done(); iter.Next()) { CookieEntry* entry = iter.Get(); @@ -374,7 +373,7 @@ void CookieStorage::RemoveAll() { // cookies. void CookieStorage::NotifyChanged(nsISupports* aSubject, const char16_t* aData, bool aOldCookieIsSession, bool aFromHttp) { - nsCOMPtr os = mozilla::services::GetObserverService(); + nsCOMPtr os = services::GetObserverService(); if (!os) { return; } diff --git a/netwerk/cookie/CookieStorage.h b/netwerk/cookie/CookieStorage.h index b3175ecbda81..a3932dcd2c9d 100644 --- a/netwerk/cookie/CookieStorage.h +++ b/netwerk/cookie/CookieStorage.h @@ -61,7 +61,7 @@ struct CookieListIter { : entry(aEntry), index(aIndex) {} // get the Cookie * the iterator currently points to. - Cookie* Cookie() const { return entry->GetCookies()[index]; } + mozilla::net::Cookie* Cookie() const { return entry->GetCookies()[index]; } CookieEntry* entry; CookieEntry::IndexType index; @@ -91,9 +91,9 @@ class CookieStorage : public nsIObserver, public nsSupportsWeakReference { const nsTArray>* GetCookiesFromHost( const nsACString& aBaseDomain, const OriginAttributes& aOriginAttributes); - void GetCookiesWithOriginAttributes( - const mozilla::OriginAttributesPattern& aPattern, - const nsACString& aBaseDomain, nsTArray>& aResult); + void GetCookiesWithOriginAttributes(const OriginAttributesPattern& aPattern, + const nsACString& aBaseDomain, + nsTArray>& aResult); void RemoveCookie(const nsACString& aBaseDomain, const OriginAttributes& aOriginAttributes, @@ -101,12 +101,11 @@ class CookieStorage : public nsIObserver, public nsSupportsWeakReference { const nsACString& aPath); virtual void RemoveCookiesWithOriginAttributes( - const mozilla::OriginAttributesPattern& aPattern, - const nsACString& aBaseDomain); + const OriginAttributesPattern& aPattern, const nsACString& aBaseDomain); virtual void RemoveCookiesFromExactHost( const nsACString& aHost, const nsACString& aBaseDomain, - const mozilla::OriginAttributesPattern& aPattern); + const OriginAttributesPattern& aPattern); void RemoveAll(); @@ -133,7 +132,7 @@ class CookieStorage : public nsIObserver, public nsSupportsWeakReference { void AddCookieToList(const nsACString& aBaseDomain, const OriginAttributes& aOriginAttributes, - mozilla::net::Cookie* aCookie, + Cookie* aCookie, mozIStorageBindingParamsArray* aParamsArray, bool aWriteToDB = true); @@ -145,7 +144,7 @@ class CookieStorage : public nsIObserver, public nsSupportsWeakReference { virtual void WriteCookieToDB(const nsACString& aBaseDomain, const OriginAttributes& aOriginAttributes, - mozilla::net::Cookie* aCookie, + Cookie* aCookie, mozIStorageBindingParamsArray* aParamsArray) = 0; virtual void RemoveAllInternal() = 0;