mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1677718 - Completely remove AppCache API implementation r=necko-reviewers,emilio,jesup
Depends on D179337 Differential Revision: https://phabricator.services.mozilla.com/D179420
This commit is contained in:
parent
61e187c022
commit
ffa99d7088
@ -3,8 +3,6 @@ support-files=
|
||||
head.js
|
||||
dummy.js
|
||||
dummy_page.html
|
||||
prefs=
|
||||
browser.cache.offline.enable=true
|
||||
|
||||
[browser_cookiePermission.js]
|
||||
[browser_cookiePermission_aboutURL.js]
|
||||
|
@ -48,19 +48,6 @@ method PushSubscription.unsubscribe
|
||||
// window.sidebar
|
||||
attribute Window.sidebar
|
||||
|
||||
// AppCache API
|
||||
method OfflineResourceList.swapCache
|
||||
method OfflineResourceList.update
|
||||
attribute OfflineResourceList.status
|
||||
attribute OfflineResourceList.onchecking
|
||||
attribute OfflineResourceList.onerror
|
||||
attribute OfflineResourceList.onnoupdate
|
||||
attribute OfflineResourceList.ondownloading
|
||||
attribute OfflineResourceList.onprogress
|
||||
attribute OfflineResourceList.onupdateready
|
||||
attribute OfflineResourceList.oncached
|
||||
attribute OfflineResourceList.onobsolete
|
||||
|
||||
// DataTransfer API (gecko-only methods)
|
||||
method DataTransfer.addElement
|
||||
attribute DataTransfer.mozItemCount
|
||||
|
@ -209,7 +209,6 @@
|
||||
#include "nsCycleCollectionNoteChild.h"
|
||||
#include "nsCycleCollectionTraversalCallback.h"
|
||||
#include "nsDOMNavigationTiming.h"
|
||||
#include "nsDOMOfflineResourceList.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsDeviceContext.h"
|
||||
#include "nsDocShell.h"
|
||||
@ -1181,12 +1180,6 @@ void nsGlobalWindowInner::FreeInnerObjects() {
|
||||
// Remove our reference to the document and the document principal.
|
||||
mFocusedElement = nullptr;
|
||||
|
||||
if (mApplicationCache) {
|
||||
static_cast<nsDOMOfflineResourceList*>(mApplicationCache.get())
|
||||
->Disconnect();
|
||||
mApplicationCache = nullptr;
|
||||
}
|
||||
|
||||
if (mIndexedDB) {
|
||||
mIndexedDB->DisconnectFromGlobal(this);
|
||||
mIndexedDB = nullptr;
|
||||
@ -1408,7 +1401,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGlobalWindowInner)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSharedWorkers)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLocalStorage)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSessionStorage)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mApplicationCache)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIndexedDB)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocumentPrincipal)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocumentCookiePrincipal)
|
||||
@ -1520,11 +1512,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindowInner)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mLocalStorage)
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSessionStorage)
|
||||
if (tmp->mApplicationCache) {
|
||||
static_cast<nsDOMOfflineResourceList*>(tmp->mApplicationCache.get())
|
||||
->Disconnect();
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mApplicationCache)
|
||||
}
|
||||
if (tmp->mIndexedDB) {
|
||||
tmp->mIndexedDB->DisconnectFromGlobal(tmp);
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mIndexedDB)
|
||||
@ -3338,38 +3325,6 @@ bool nsGlobalWindowInner::CachesEnabled(JSContext* aCx, JSObject*) {
|
||||
return true;
|
||||
}
|
||||
|
||||
nsDOMOfflineResourceList* nsGlobalWindowInner::GetApplicationCache(
|
||||
ErrorResult& aError) {
|
||||
if (!mApplicationCache) {
|
||||
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(GetDocShell()));
|
||||
if (!webNav || !mDoc) {
|
||||
aError.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
aError = webNav->GetCurrentURI(getter_AddRefs(uri));
|
||||
if (aError.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> manifestURI;
|
||||
nsContentUtils::GetOfflineAppManifest(mDoc, getter_AddRefs(manifestURI));
|
||||
|
||||
RefPtr<nsDOMOfflineResourceList> applicationCache =
|
||||
new nsDOMOfflineResourceList(manifestURI, uri, mDoc->NodePrincipal(),
|
||||
this);
|
||||
|
||||
mApplicationCache = applicationCache;
|
||||
}
|
||||
|
||||
return mApplicationCache;
|
||||
}
|
||||
|
||||
nsDOMOfflineResourceList* nsGlobalWindowInner::GetApplicationCache() {
|
||||
return GetApplicationCache(IgnoreErrors());
|
||||
}
|
||||
|
||||
Crypto* nsGlobalWindowInner::GetCrypto(ErrorResult& aError) {
|
||||
if (!mCrypto) {
|
||||
mCrypto = new Crypto(this);
|
||||
@ -5447,18 +5402,6 @@ nsresult nsGlobalWindowInner::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aTopic, "offline-cache-update-added")) {
|
||||
if (mApplicationCache) return NS_OK;
|
||||
|
||||
// Instantiate the application object now. It observes update belonging to
|
||||
// this window's document and correctly updates the applicationCache object
|
||||
// state.
|
||||
nsCOMPtr<nsIObserver> observer = GetApplicationCache();
|
||||
if (observer) observer->Observe(aSubject, aTopic, aData);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aTopic, PERMISSION_CHANGED_TOPIC)) {
|
||||
nsCOMPtr<nsIPermission> perm(do_QueryInterface(aSubject));
|
||||
if (!perm) {
|
||||
@ -6151,11 +6094,6 @@ StorageAccess nsGlobalWindowInner::GetStorageAccess() {
|
||||
}
|
||||
|
||||
nsresult nsGlobalWindowInner::FireDelayedDOMEvents(bool aIncludeSubWindows) {
|
||||
if (mApplicationCache) {
|
||||
static_cast<nsDOMOfflineResourceList*>(mApplicationCache.get())
|
||||
->FirePendingEvents();
|
||||
}
|
||||
|
||||
// Fires an offline status event if the offline status has changed
|
||||
FireOfflineStatusEventIfChanged();
|
||||
|
||||
|
@ -57,7 +57,6 @@ class nsIContent;
|
||||
class nsICSSDeclaration;
|
||||
class nsIDocShellTreeOwner;
|
||||
class nsIDOMWindowUtils;
|
||||
class nsDOMOfflineResourceList;
|
||||
class nsIScrollableFrame;
|
||||
class nsIControllers;
|
||||
class nsIScriptContext;
|
||||
@ -651,9 +650,6 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
|
||||
mozilla::dom::Nullable<mozilla::dom::WindowProxyHolder> Open(
|
||||
const nsAString& aUrl, const nsAString& aName, const nsAString& aOptions,
|
||||
mozilla::ErrorResult& aError);
|
||||
nsDOMOfflineResourceList* GetApplicationCache(mozilla::ErrorResult& aError);
|
||||
nsDOMOfflineResourceList* GetApplicationCache() override;
|
||||
|
||||
int16_t Orientation(mozilla::dom::CallerType aCallerType);
|
||||
|
||||
already_AddRefed<mozilla::dom::Console> GetConsole(JSContext* aCx,
|
||||
@ -1504,8 +1500,6 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
|
||||
nsCOMPtr<nsIURI> mLastOpenedURI;
|
||||
#endif
|
||||
|
||||
RefPtr<nsDOMOfflineResourceList> mApplicationCache;
|
||||
|
||||
RefPtr<mozilla::dom::IDBFactory> mIndexedDB;
|
||||
|
||||
// This flag keeps track of whether this window is currently
|
||||
|
@ -26,7 +26,6 @@
|
||||
#define DOM_WINDOW_FROZEN_TOPIC "dom-window-frozen"
|
||||
#define DOM_WINDOW_THAWED_TOPIC "dom-window-thawed"
|
||||
|
||||
class nsDOMOfflineResourceList;
|
||||
class nsGlobalWindowInner;
|
||||
class nsGlobalWindowOuter;
|
||||
class nsIArray;
|
||||
@ -614,8 +613,6 @@ class nsPIDOMWindowInner : public mozIDOMWindow {
|
||||
mozilla::dom::Element& aElt, const nsAString& aPseudoElt,
|
||||
mozilla::ErrorResult& aError) = 0;
|
||||
|
||||
virtual nsDOMOfflineResourceList* GetApplicationCache() = 0;
|
||||
|
||||
virtual bool GetFullScreen() = 0;
|
||||
|
||||
virtual nsresult Focus(mozilla::dom::CallerType aCallerType) = 0;
|
||||
|
@ -611,10 +611,6 @@ DOMInterfaces = {
|
||||
'nativeType': 'mozilla::dom::AudioContext',
|
||||
},
|
||||
|
||||
'OfflineResourceList': {
|
||||
'nativeType': 'nsDOMOfflineResourceList',
|
||||
},
|
||||
|
||||
'OffscreenCanvasRenderingContext2D': {
|
||||
'implicitJSContext': [
|
||||
'createImageData', 'getImageData', 'isPointInPath', 'isPointInStroke'
|
||||
|
@ -58,7 +58,6 @@ DIRS += [
|
||||
"media",
|
||||
"midi",
|
||||
"notification",
|
||||
"offline",
|
||||
"power",
|
||||
"push",
|
||||
"quota",
|
||||
|
@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
|
||||
try {
|
||||
navigator.pendingOfflineLoads[0];
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
try {
|
||||
navigator.pendingOfflineLoads[1000];
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
try {
|
||||
navigator.pendingOfflineLoads[-1];
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
@ -1 +0,0 @@
|
||||
load 408431-1.html
|
@ -1,22 +0,0 @@
|
||||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Core", "Networking")
|
||||
|
||||
EXPORTS += [
|
||||
"nsDOMOfflineResourceList.h",
|
||||
]
|
||||
UNIFIED_SOURCES += [
|
||||
"nsDOMOfflineResourceList.cpp",
|
||||
]
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
"/dom/base",
|
||||
"/uriloader/prefetch",
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = "xul"
|
@ -1,160 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsDOMOfflineResourceList.h"
|
||||
#include "nsError.h"
|
||||
#include "mozilla/Components.h"
|
||||
#include "mozilla/dom/DOMStringList.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsICookieJarSettings.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/OfflineResourceListBinding.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/BasePrincipal.h"
|
||||
#include "mozilla/StaticPrefs_browser.h"
|
||||
|
||||
#include "nsXULAppAPI.h"
|
||||
#define IS_CHILD_PROCESS() (GeckoProcessType_Default != XRE_GetProcessType())
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
//
|
||||
// nsDOMOfflineResourceList
|
||||
//
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WEAK_INHERITED(nsDOMOfflineResourceList,
|
||||
DOMEventTargetHelper)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMOfflineResourceList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsDOMOfflineResourceList, DOMEventTargetHelper)
|
||||
NS_IMPL_RELEASE_INHERITED(nsDOMOfflineResourceList, DOMEventTargetHelper)
|
||||
|
||||
nsDOMOfflineResourceList::nsDOMOfflineResourceList(
|
||||
nsIURI* aManifestURI, nsIURI* aDocumentURI, nsIPrincipal* aLoadingPrincipal,
|
||||
nsPIDOMWindowInner* aWindow)
|
||||
: DOMEventTargetHelper(aWindow) {}
|
||||
|
||||
nsDOMOfflineResourceList::~nsDOMOfflineResourceList() { ClearCachedKeys(); }
|
||||
|
||||
JSObject* nsDOMOfflineResourceList::WrapObject(
|
||||
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
|
||||
return OfflineResourceList_Binding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
void nsDOMOfflineResourceList::Disconnect() {}
|
||||
|
||||
already_AddRefed<DOMStringList> nsDOMOfflineResourceList::GetMozItems(
|
||||
ErrorResult& aRv) {
|
||||
if (IS_CHILD_PROCESS()) {
|
||||
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<DOMStringList> items = new DOMStringList();
|
||||
return items.forget();
|
||||
}
|
||||
|
||||
bool nsDOMOfflineResourceList::MozHasItem(const nsAString& aURI,
|
||||
ErrorResult& aRv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t nsDOMOfflineResourceList::GetMozLength(ErrorResult& aRv) {
|
||||
if (IS_CHILD_PROCESS()) {
|
||||
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void nsDOMOfflineResourceList::MozItem(uint32_t aIndex, nsAString& aURI,
|
||||
ErrorResult& aRv) {
|
||||
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||
}
|
||||
|
||||
void nsDOMOfflineResourceList::IndexedGetter(uint32_t aIndex, bool& aFound,
|
||||
nsAString& aURI,
|
||||
ErrorResult& aRv) {
|
||||
if (IS_CHILD_PROCESS()) {
|
||||
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
|
||||
return;
|
||||
}
|
||||
|
||||
aFound = false;
|
||||
}
|
||||
|
||||
void nsDOMOfflineResourceList::MozAdd(const nsAString& aURI, ErrorResult& aRv) {
|
||||
}
|
||||
|
||||
void nsDOMOfflineResourceList::MozRemove(const nsAString& aURI,
|
||||
ErrorResult& aRv) {}
|
||||
|
||||
uint16_t nsDOMOfflineResourceList::GetStatus(ErrorResult& aRv) {
|
||||
return OfflineResourceList_Binding::UNCACHED;
|
||||
}
|
||||
|
||||
void nsDOMOfflineResourceList::Update(ErrorResult& aRv) {}
|
||||
|
||||
void nsDOMOfflineResourceList::SwapCache(ErrorResult& aRv) {}
|
||||
|
||||
void nsDOMOfflineResourceList::FirePendingEvents() {}
|
||||
|
||||
void nsDOMOfflineResourceList::SendEvent(const nsAString& aEventName) {}
|
||||
|
||||
//
|
||||
// nsDOMOfflineResourceList::nsIObserver
|
||||
//
|
||||
NS_IMETHODIMP
|
||||
nsDOMOfflineResourceList::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
const char16_t* aData) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsDOMOfflineResourceList::GetCacheKey(const nsAString& aURI,
|
||||
nsCString& aKey) {
|
||||
nsCOMPtr<nsIURI> requestedURI;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(requestedURI), aURI);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return GetCacheKey(requestedURI, aKey);
|
||||
}
|
||||
|
||||
nsresult nsDOMOfflineResourceList::GetCacheKey(nsIURI* aURI, nsCString& aKey) {
|
||||
nsresult rv = aURI->GetAsciiSpec(aKey);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// url fragments aren't used in cache keys
|
||||
nsAutoCString::const_iterator specStart, specEnd;
|
||||
aKey.BeginReading(specStart);
|
||||
aKey.EndReading(specEnd);
|
||||
if (FindCharInReadable('#', specStart, specEnd)) {
|
||||
aKey.BeginReading(specEnd);
|
||||
aKey = Substring(specEnd, specStart);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsDOMOfflineResourceList::CacheKeys() { return NS_OK; }
|
||||
|
||||
void nsDOMOfflineResourceList::ClearCachedKeys() {}
|
@ -1,95 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef nsDOMOfflineResourceList_h___
|
||||
#define nsDOMOfflineResourceList_h___
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "mozilla/DOMEventTargetHelper.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
|
||||
namespace mozilla::dom {
|
||||
class DOMStringList;
|
||||
class Event;
|
||||
} // namespace mozilla::dom
|
||||
|
||||
class nsDOMOfflineResourceList final : public mozilla::DOMEventTargetHelper,
|
||||
public nsIObserver,
|
||||
public nsSupportsWeakReference {
|
||||
using ErrorResult = mozilla::ErrorResult;
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIOBSERVER
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMOfflineResourceList,
|
||||
mozilla::DOMEventTargetHelper)
|
||||
|
||||
nsDOMOfflineResourceList(nsIURI* aManifestURI, nsIURI* aDocumentURI,
|
||||
nsIPrincipal* aLoadingPrincipal,
|
||||
nsPIDOMWindowInner* aWindow);
|
||||
|
||||
void FirePendingEvents();
|
||||
void Disconnect();
|
||||
|
||||
nsPIDOMWindowInner* GetParentObject() const { return GetOwner(); }
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
uint16_t GetStatus(ErrorResult& aRv);
|
||||
|
||||
void Update(ErrorResult& aRv);
|
||||
|
||||
void SwapCache(ErrorResult& aRv);
|
||||
|
||||
IMPL_EVENT_HANDLER(checking)
|
||||
IMPL_EVENT_HANDLER(error)
|
||||
IMPL_EVENT_HANDLER(noupdate)
|
||||
IMPL_EVENT_HANDLER(downloading)
|
||||
IMPL_EVENT_HANDLER(progress)
|
||||
IMPL_EVENT_HANDLER(cached)
|
||||
IMPL_EVENT_HANDLER(updateready)
|
||||
IMPL_EVENT_HANDLER(obsolete)
|
||||
|
||||
already_AddRefed<mozilla::dom::DOMStringList> GetMozItems(ErrorResult& aRv);
|
||||
bool MozHasItem(const nsAString& aURI, ErrorResult& aRv);
|
||||
uint32_t GetMozLength(ErrorResult& aRv);
|
||||
void MozItem(uint32_t aIndex, nsAString& aURI, ErrorResult& aRv);
|
||||
void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aURI,
|
||||
ErrorResult& aRv);
|
||||
uint32_t Length() {
|
||||
mozilla::IgnoredErrorResult rv;
|
||||
uint32_t length = GetMozLength(rv);
|
||||
return rv.Failed() ? 0 : length;
|
||||
}
|
||||
void MozAdd(const nsAString& aURI, ErrorResult& aRv);
|
||||
void MozRemove(const nsAString& aURI, ErrorResult& aRv);
|
||||
|
||||
protected:
|
||||
virtual ~nsDOMOfflineResourceList();
|
||||
|
||||
private:
|
||||
void SendEvent(const nsAString& aEventName);
|
||||
|
||||
nsresult GetCacheKey(const nsAString& aURI, nsCString& aKey);
|
||||
nsresult GetCacheKey(nsIURI* aURI, nsCString& aKey);
|
||||
|
||||
nsresult CacheKeys();
|
||||
void ClearCachedKeys();
|
||||
};
|
||||
|
||||
#endif
|
@ -893,12 +893,6 @@ let interfaceNamesInGlobalScope = [
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{ name: "OfflineAudioContext", insecureContext: true },
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{
|
||||
name: "OfflineResourceList",
|
||||
insecureContext: false,
|
||||
disabled: isEarlyBetaOrEarlier,
|
||||
},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{ name: "OffscreenCanvas", insecureContext: true },
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{ name: "OffscreenCanvasRenderingContext2D", insecureContext: true },
|
||||
|
@ -1,124 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
[SecureContext, Pref="browser.cache.offline.enable",
|
||||
Exposed=Window]
|
||||
interface OfflineResourceList : EventTarget {
|
||||
/**
|
||||
* State of the application cache this object is associated with.
|
||||
*/
|
||||
|
||||
/* This object is not associated with an application cache. */
|
||||
const unsigned short UNCACHED = 0;
|
||||
|
||||
/* The application cache is not being updated. */
|
||||
const unsigned short IDLE = 1;
|
||||
|
||||
/* The manifest is being fetched and checked for updates */
|
||||
const unsigned short CHECKING = 2;
|
||||
|
||||
/* Resources are being downloaded to be added to the cache */
|
||||
const unsigned short DOWNLOADING = 3;
|
||||
|
||||
/* There is a new version of the application cache available */
|
||||
const unsigned short UPDATEREADY = 4;
|
||||
|
||||
/* The application cache group is now obsolete. */
|
||||
const unsigned short OBSOLETE = 5;
|
||||
|
||||
[Throws, UseCounter]
|
||||
readonly attribute unsigned short status;
|
||||
|
||||
/**
|
||||
* Begin the application update process on the associated application cache.
|
||||
*/
|
||||
[Throws, UseCounter]
|
||||
undefined update();
|
||||
|
||||
/**
|
||||
* Swap in the newest version of the application cache, or disassociate
|
||||
* from the cache if the cache group is obsolete.
|
||||
*/
|
||||
[Throws, UseCounter]
|
||||
undefined swapCache();
|
||||
|
||||
/* Events */
|
||||
[UseCounter]
|
||||
attribute EventHandler onchecking;
|
||||
[UseCounter]
|
||||
attribute EventHandler onerror;
|
||||
[UseCounter]
|
||||
attribute EventHandler onnoupdate;
|
||||
[UseCounter]
|
||||
attribute EventHandler ondownloading;
|
||||
[UseCounter]
|
||||
attribute EventHandler onprogress;
|
||||
[UseCounter]
|
||||
attribute EventHandler onupdateready;
|
||||
[UseCounter]
|
||||
attribute EventHandler oncached;
|
||||
[UseCounter]
|
||||
attribute EventHandler onobsolete;
|
||||
};
|
||||
|
||||
// Mozilla extensions.
|
||||
partial interface OfflineResourceList {
|
||||
/**
|
||||
* Get the list of dynamically-managed entries.
|
||||
*/
|
||||
[Throws]
|
||||
readonly attribute DOMStringList mozItems;
|
||||
|
||||
/**
|
||||
* Check that an entry exists in the list of dynamically-managed entries.
|
||||
*
|
||||
* @param uri
|
||||
* The resource to check.
|
||||
*/
|
||||
[Throws]
|
||||
boolean mozHasItem(DOMString uri);
|
||||
|
||||
/**
|
||||
* Get the number of dynamically-managed entries.
|
||||
* @status DEPRECATED
|
||||
* Clients should use the "items" attribute.
|
||||
*/
|
||||
[Throws]
|
||||
readonly attribute unsigned long mozLength;
|
||||
|
||||
/**
|
||||
* Get the URI of a dynamically-managed entry.
|
||||
* @status DEPRECATED
|
||||
* Clients should use the "items" attribute.
|
||||
*/
|
||||
[Throws]
|
||||
getter DOMString mozItem(unsigned long index);
|
||||
|
||||
/**
|
||||
* We need a "length" to actually be valid Web IDL, given that we have an
|
||||
* indexed getter.
|
||||
*/
|
||||
readonly attribute unsigned long length;
|
||||
|
||||
/**
|
||||
* Add an item to the list of dynamically-managed entries. The resource
|
||||
* will be fetched into the application cache.
|
||||
*
|
||||
* @param uri
|
||||
* The resource to add.
|
||||
*/
|
||||
[Throws]
|
||||
undefined mozAdd(DOMString uri);
|
||||
|
||||
/**
|
||||
* Remove an item from the list of dynamically-managed entries. If this
|
||||
* was the last reference to a URI in the application cache, the cache
|
||||
* entry will be removed.
|
||||
*
|
||||
* @param uri
|
||||
* The resource to remove.
|
||||
*/
|
||||
[Throws]
|
||||
undefined mozRemove(DOMString uri);
|
||||
};
|
@ -25,15 +25,11 @@ interface XULControllers;
|
||||
interface nsIDOMWindowUtils;
|
||||
interface nsIPrintSettings;
|
||||
|
||||
typedef OfflineResourceList ApplicationCache;
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/
|
||||
[Global, LegacyUnenumerableNamedProperties, NeedResolve,
|
||||
Exposed=Window,
|
||||
InstrumentedProps=(AbsoluteOrientationSensor,
|
||||
Accelerometer,
|
||||
ApplicationCache,
|
||||
ApplicationCacheErrorEvent,
|
||||
Atomics,
|
||||
AudioParamMap,
|
||||
AudioWorklet,
|
||||
@ -248,7 +244,6 @@ typedef OfflineResourceList ApplicationCache;
|
||||
readonly attribute Navigator clientInformation;
|
||||
|
||||
[Replaceable] readonly attribute External external;
|
||||
[Throws, SecureContext, Pref="browser.cache.offline.enable"] readonly attribute ApplicationCache applicationCache;
|
||||
|
||||
// user prompts
|
||||
[Throws, NeedsSubjectPrincipal] undefined alert();
|
||||
|
@ -756,7 +756,6 @@ WEBIDL_FILES = [
|
||||
"NotificationEvent.webidl",
|
||||
"NotifyPaintEvent.webidl",
|
||||
"OfflineAudioContext.webidl",
|
||||
"OfflineResourceList.webidl",
|
||||
"OffscreenCanvas.webidl",
|
||||
"OffscreenCanvasRenderingContext2D.webidl",
|
||||
"OscillatorNode.webidl",
|
||||
|
@ -40,7 +40,6 @@ LOCAL_INCLUDES += [
|
||||
"/dom/html",
|
||||
"/dom/jsurl",
|
||||
"/dom/media",
|
||||
"/dom/offline",
|
||||
"/dom/storage",
|
||||
"/dom/xslt/base",
|
||||
"/dom/xslt/xml",
|
||||
|
@ -968,11 +968,6 @@
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
- name: browser.cache.offline.enable
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
- name: browser.cache.disk.enable
|
||||
type: RelaxedAtomicBool
|
||||
value: true
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
interface nsICacheStorage;
|
||||
interface nsILoadContextInfo;
|
||||
interface nsIApplicationCache;
|
||||
interface nsIEventTarget;
|
||||
interface nsICacheStorageConsumptionObserver;
|
||||
interface nsICacheStorageVisitor;
|
||||
|
@ -338,7 +338,6 @@ struct HttpChannelOpenArgs
|
||||
bool uploadStreamHasHeaders;
|
||||
bool allowSTS;
|
||||
bool resumeAt;
|
||||
bool chooseApplicationCache;
|
||||
bool allowSpdy;
|
||||
bool allowHttp3;
|
||||
bool allowAltSvc;
|
||||
|
@ -166,7 +166,6 @@ function run_test() {
|
||||
httpserver.registerPathHandler("/bug650995", handler);
|
||||
httpserver.start(-1);
|
||||
|
||||
prefService.setBoolPref("browser.cache.offline.enable", false);
|
||||
prefService.setBoolPref("network.http.rcwn.enabled", false);
|
||||
|
||||
nextTest();
|
||||
|
@ -25,7 +25,6 @@ include ../../dom/media/webvtt/test/crashtests/crashtests.list
|
||||
skip-if(!webrtc) include ../../dom/media/tests/crashtests/crashtests.list
|
||||
skip-if(!webrtc) include ../../dom/media/webrtc/tests/crashtests/crashtests.list
|
||||
include ../../dom/media/webspeech/synth/crashtests/crashtests.list
|
||||
include ../../dom/offline/crashtests/crashtests.list
|
||||
include ../../dom/plugins/test/crashtests/crashtests.list
|
||||
include ../../dom/security/test/crashtests/crashtests.list
|
||||
include ../../dom/serializers/crashtests/crashtests.list
|
||||
|
@ -69,8 +69,6 @@ user_pref("widget.disable-dark-scrollbar", true);
|
||||
// be confusing for tests that send click events before the first paint.
|
||||
user_pref("nglayout.initialpaint.unsuppress_with_no_background", true);
|
||||
user_pref("media.block-autoplay-until-in-foreground", false);
|
||||
// Enable AppCache globally for now whilst it's being removed in Bug 1584984
|
||||
user_pref("browser.cache.offline.enable", true);
|
||||
// Force a light color scheme unless explicitly overriden by pref.
|
||||
user_pref("layout.css.prefers-color-scheme.content-override", 1);
|
||||
// Force OffscreenCanvas support
|
||||
|
@ -1 +1,2 @@
|
||||
disabled: true
|
||||
lsan-allowed: [Alloc, AllocateProtoAndIfaceCache, Malloc, Realloc, mozilla::detail::HashTable, mozilla::dom::Console::CreateInstance, mozilla::dom::Performance::CreateForMainThread, mozilla::dom::PerformanceMainThread::CreateNavigationTimingEntry, mozilla::dom::ProtoAndIfaceCache::PageTableCache::EntrySlotOrCreate, mozilla::net::nsStandardURL::TemplatedMutator, nsGlobalWindowInner::GetApplicationCache, nsSupportsWeakReference::GetWeakReference]
|
||||
|
@ -1,2 +0,0 @@
|
||||
[api_status_checking-manual.html]
|
||||
prefs: [browser.cache.offline.enable:true]
|
@ -1,2 +0,0 @@
|
||||
[api_status_downloading-manual.html]
|
||||
prefs: [browser.cache.offline.enable:true]
|
@ -1,2 +0,0 @@
|
||||
[api_status_obsolete-manual.html]
|
||||
prefs: [browser.cache.offline.enable:true]
|
@ -1,2 +0,0 @@
|
||||
[api_status_updateready-manual.html]
|
||||
prefs: [browser.cache.offline.enable:true]
|
@ -1,2 +0,0 @@
|
||||
[api_swapcache-manual.html]
|
||||
prefs: [browser.cache.offline.enable:true]
|
@ -1,5 +1,4 @@
|
||||
[clients-get.https.html]
|
||||
prefs: [browser.cache.offline.enable:true]
|
||||
disabled:
|
||||
if debug and (os == "mac"): https://bugzilla.mozilla.org/show_bug.cgi?id=1586420
|
||||
expected:
|
||||
|
@ -11,7 +11,6 @@
|
||||
pref("browser.dom.window.dump.enabled", true);
|
||||
pref("devtools.console.stdout.chrome", true);
|
||||
|
||||
pref("browser.cache.offline.enable", false);
|
||||
pref("browser.cache.disk.enable", false);
|
||||
pref("permissions.memory_only", true);
|
||||
|
||||
|
@ -223,7 +223,6 @@ const DEFAULT_ENVIRONMENT_PREFS = new Map([
|
||||
["browser.cache.disk.enable", { what: RECORD_PREF_VALUE }],
|
||||
["browser.cache.disk.capacity", { what: RECORD_PREF_VALUE }],
|
||||
["browser.cache.memory.enable", { what: RECORD_PREF_VALUE }],
|
||||
["browser.cache.offline.enable", { what: RECORD_PREF_VALUE }],
|
||||
["browser.formfill.enable", { what: RECORD_PREF_VALUE }],
|
||||
["browser.fixup.alternate.enabled", { what: RECORD_DEFAULTPREF_VALUE }],
|
||||
["browser.migrate.interactions.bookmarks", { what: RECORD_PREF_VALUE }],
|
||||
|
Loading…
Reference in New Issue
Block a user