author | Phil Ringnalda <philringnalda@gmail.com> |
Thu, 02 Oct 2014 22:20:04 -0700 | |
changeset 208524 | 16998eb738aa34b9206b8ca47ee35c7c21fd8116 |
parent 208523 | de4f6c938b6aa464dfa739a89ed1b3284d0e33f0 |
child 208525 | 3c8da0709f07151e0447389ad1ff641ec28fff7f |
push id | 1 |
push user | root |
push date | Mon, 20 Oct 2014 17:29:22 +0000 |
bugs | 1017613 |
milestone | 35.0a1 |
backs out | 77b599edbab4ced5d91f6a374d842b56f991e325 f048600cf938f7c72aadb3919e7db6fefb921a09 083a2fb884ed24e7e963810d4daf8c1936c96225 |
--- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -182,17 +182,16 @@ #include "prlog.h" #include "prenv.h" #include "prprf.h" #include "mozilla/dom/MessageChannel.h" #include "mozilla/dom/MessagePort.h" #include "mozilla/dom/MessagePortBinding.h" #include "mozilla/dom/indexedDB/IDBFactory.h" -#include "mozilla/dom/Promise.h" #include "mozilla/dom/StructuredCloneTags.h" #ifdef MOZ_GAMEPAD #include "mozilla/dom/GamepadService.h" #endif #include "nsRefreshDriver.h" @@ -6366,24 +6365,16 @@ NS_IMETHODIMP nsGlobalWindow::Confirm(const nsAString& aString, bool* aReturn) { ErrorResult rv; *aReturn = Confirm(aString, rv); return rv.ErrorCode(); } -already_AddRefed<Promise> -nsGlobalWindow::Fetch(const RequestOrScalarValueString& aInput, - const RequestInit& aInit, ErrorResult& aRv) -{ - aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); - return nullptr; -} - void nsGlobalWindow::Prompt(const nsAString& aMessage, const nsAString& aInitial, nsAString& aReturn, ErrorResult& aError) { // XXX This method is very similar to nsGlobalWindow::AlertOrConfirm, make // sure any modifications here don't need to happen over there! FORWARD_TO_OUTER_OR_THROW(Prompt, (aMessage, aInitial, aReturn, aError), aError, );
--- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -33,20 +33,18 @@ #include "nsIScriptObjectPrincipal.h" #include "nsITimer.h" #include "nsIDOMModalContentWindow.h" #include "mozilla/EventListenerManager.h" #include "nsIPrincipal.h" #include "nsSize.h" #include "mozFlushType.h" #include "prclist.h" -#include "mozilla/dom/RequestBinding.h" #include "mozilla/dom/StorageEvent.h" #include "mozilla/dom/StorageEventBinding.h" -#include "mozilla/dom/UnionTypes.h" #include "nsFrameMessageManager.h" #include "mozilla/LinkedList.h" #include "mozilla/TimeStamp.h" #include "nsWrapperCacheInlines.h" #include "nsIIdleObserver.h" #include "nsIDocument.h" #include "mozilla/dom/EventTarget.h" #include "mozilla/dom/WindowBinding.h" @@ -104,17 +102,16 @@ class BarProp; class Console; class External; class Function; class Gamepad; class MediaQueryList; class MozSelfSupport; class Navigator; class OwningExternalOrWindowProxy; -class Promise; class Selection; class SpeechSynthesis; class WakeLock; namespace indexedDB { class IDBFactory; } // namespace indexedDB } // namespace dom } // namespace mozilla @@ -848,19 +845,16 @@ public: protected: bool AlertOrConfirm(bool aAlert, const nsAString& aMessage, mozilla::ErrorResult& aError); public: void Alert(mozilla::ErrorResult& aError); void Alert(const nsAString& aMessage, mozilla::ErrorResult& aError); bool Confirm(const nsAString& aMessage, mozilla::ErrorResult& aError); - already_AddRefed<mozilla::dom::Promise> Fetch(const mozilla::dom::RequestOrScalarValueString& aInput, - const mozilla::dom::RequestInit& aInit, - mozilla::ErrorResult& aRv); void Prompt(const nsAString& aMessage, const nsAString& aInitial, nsAString& aReturn, mozilla::ErrorResult& aError); void Print(mozilla::ErrorResult& aError); void ShowModalDialog(JSContext* aCx, const nsAString& aUrl, JS::Handle<JS::Value> aArgument, const nsAString& aOptions, JS::MutableHandle<JS::Value> aRetval, mozilla::ErrorResult& aError);
--- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -878,24 +878,16 @@ DOMInterfaces = { '__stringifier': 'ToString' } }, 'Rect': { 'nativeType': 'nsDOMCSSRect', }, -'Request': { - 'binaryNames': { 'headers': 'headers_' }, -}, - -'Response': { - 'binaryNames': { 'headers': 'headers_' }, -}, - 'RGBColor': { 'nativeType': 'nsDOMCSSRGBColor', }, 'Screen': { 'nativeType': 'nsScreen', },
deleted file mode 100644 --- a/dom/fetch/Request.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 "Request.h" - -#include "nsDOMString.h" -#include "nsISupportsImpl.h" -#include "nsIURI.h" -#include "nsPIDOMWindow.h" - -#include "mozilla/dom/Promise.h" - -using namespace mozilla::dom; - -NS_IMPL_CYCLE_COLLECTING_ADDREF(Request) -NS_IMPL_CYCLE_COLLECTING_RELEASE(Request) -NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Request, mOwner, mHeaders) - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Request) - NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -Request::Request(nsISupports* aOwner) - : mOwner(aOwner) - , mHeaders(new Headers(aOwner)) -{ - SetIsDOMBinding(); -} - -Request::~Request() -{ -} - -/*static*/ already_AddRefed<Request> -Request::Constructor(const GlobalObject& global, - const RequestOrScalarValueString& aInput, - const RequestInit& aInit, ErrorResult& rv) -{ - nsRefPtr<Request> request = new Request(global.GetAsSupports()); - return request.forget(); -} - -already_AddRefed<Request> -Request::Clone() const -{ - nsRefPtr<Request> request = new Request(mOwner); - return request.forget(); -} - -already_AddRefed<Promise> -Request::ArrayBuffer(ErrorResult& aRv) -{ - nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject()); - MOZ_ASSERT(global); - nsRefPtr<Promise> promise = Promise::Create(global, aRv); - if (aRv.Failed()) { - return nullptr; - } - - promise->MaybeReject(NS_ERROR_NOT_AVAILABLE); - return promise.forget(); -} - -already_AddRefed<Promise> -Request::Blob(ErrorResult& aRv) -{ - nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject()); - MOZ_ASSERT(global); - nsRefPtr<Promise> promise = Promise::Create(global, aRv); - if (aRv.Failed()) { - return nullptr; - } - - promise->MaybeReject(NS_ERROR_NOT_AVAILABLE); - return promise.forget(); -} - -already_AddRefed<Promise> -Request::Json(ErrorResult& aRv) -{ - nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject()); - MOZ_ASSERT(global); - nsRefPtr<Promise> promise = Promise::Create(global, aRv); - if (aRv.Failed()) { - return nullptr; - } - - promise->MaybeReject(NS_ERROR_NOT_AVAILABLE); - return promise.forget(); -} - -already_AddRefed<Promise> -Request::Text(ErrorResult& aRv) -{ - nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject()); - MOZ_ASSERT(global); - nsRefPtr<Promise> promise = Promise::Create(global, aRv); - if (aRv.Failed()) { - return nullptr; - } - - promise->MaybeReject(NS_ERROR_NOT_AVAILABLE); - return promise.forget(); -} - -bool -Request::BodyUsed() -{ - return false; -}
deleted file mode 100644 --- a/dom/fetch/Request.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 mozilla_dom_Request_h -#define mozilla_dom_Request_h - -#include "nsISupportsImpl.h" -#include "nsWrapperCache.h" - -#include "mozilla/dom/RequestBinding.h" -#include "mozilla/dom/UnionTypes.h" - - -class nsPIDOMWindow; - -namespace mozilla { -namespace dom { - -class Promise; - -class Request MOZ_FINAL : public nsISupports - , public nsWrapperCache -{ - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Request) - -public: - Request(nsISupports* aOwner); - - JSObject* - WrapObject(JSContext* aCx) - { - return RequestBinding::Wrap(aCx, this); - } - - void - GetUrl(DOMString& aUrl) const - { - aUrl.AsAString() = EmptyString(); - } - - void - GetMethod(nsCString& aMethod) const - { - aMethod = EmptyCString(); - } - - RequestMode - Mode() const - { - return RequestMode::Same_origin; - } - - RequestCredentials - Credentials() const - { - return RequestCredentials::Omit; - } - - void - GetReferrer(DOMString& aReferrer) const - { - aReferrer.AsAString() = EmptyString(); - } - - Headers* Headers_() const { return mHeaders; } - - static already_AddRefed<Request> - Constructor(const GlobalObject& aGlobal, const RequestOrScalarValueString& aInput, - const RequestInit& aInit, ErrorResult& rv); - - nsISupports* GetParentObject() const - { - return mOwner; - } - - already_AddRefed<Request> - Clone() const; - - already_AddRefed<Promise> - ArrayBuffer(ErrorResult& aRv); - - already_AddRefed<Promise> - Blob(ErrorResult& aRv); - - already_AddRefed<Promise> - Json(ErrorResult& aRv); - - already_AddRefed<Promise> - Text(ErrorResult& aRv); - - bool - BodyUsed(); -private: - ~Request(); - - nsCOMPtr<nsISupports> mOwner; - nsRefPtr<Headers> mHeaders; -}; - -} // namespace dom -} // namespace mozilla - -#endif // mozilla_dom_Request_h
deleted file mode 100644 --- a/dom/fetch/Response.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 "Response.h" -#include "nsDOMString.h" -#include "nsPIDOMWindow.h" -#include "nsIURI.h" -#include "nsISupportsImpl.h" - -#include "mozilla/ErrorResult.h" - -using namespace mozilla::dom; - -NS_IMPL_CYCLE_COLLECTING_ADDREF(Response) -NS_IMPL_CYCLE_COLLECTING_RELEASE(Response) -NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Response, mOwner) - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Response) - NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -Response::Response(nsISupports* aOwner) - : mOwner(aOwner) - , mHeaders(new Headers(aOwner)) -{ - SetIsDOMBinding(); -} - -Response::~Response() -{ -} - -/* static */ already_AddRefed<Response> -Response::Error(const GlobalObject& aGlobal) -{ - ErrorResult result; - ResponseInit init; - init.mStatus = 0; - Optional<ArrayBufferOrArrayBufferViewOrScalarValueStringOrURLSearchParams> body; - nsRefPtr<Response> r = Response::Constructor(aGlobal, body, init, result); - return r.forget(); -} - -/* static */ already_AddRefed<Response> -Response::Redirect(const GlobalObject& aGlobal, const nsAString& aUrl, - uint16_t aStatus) -{ - ErrorResult result; - ResponseInit init; - Optional<ArrayBufferOrArrayBufferViewOrScalarValueStringOrURLSearchParams> body; - nsRefPtr<Response> r = Response::Constructor(aGlobal, body, init, result); - return r.forget(); -} - -/*static*/ already_AddRefed<Response> -Response::Constructor(const GlobalObject& global, - const Optional<ArrayBufferOrArrayBufferViewOrScalarValueStringOrURLSearchParams>& aBody, - const ResponseInit& aInit, ErrorResult& rv) -{ - nsRefPtr<Response> response = new Response(global.GetAsSupports()); - return response.forget(); -} - -already_AddRefed<Response> -Response::Clone() -{ - nsRefPtr<Response> response = new Response(mOwner); - return response.forget(); -} - -already_AddRefed<Promise> -Response::ArrayBuffer(ErrorResult& aRv) -{ - nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject()); - MOZ_ASSERT(global); - nsRefPtr<Promise> promise = Promise::Create(global, aRv); - if (aRv.Failed()) { - return nullptr; - } - - promise->MaybeReject(NS_ERROR_NOT_AVAILABLE); - return promise.forget(); -} - -already_AddRefed<Promise> -Response::Blob(ErrorResult& aRv) -{ - nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject()); - MOZ_ASSERT(global); - nsRefPtr<Promise> promise = Promise::Create(global, aRv); - if (aRv.Failed()) { - return nullptr; - } - - promise->MaybeReject(NS_ERROR_NOT_AVAILABLE); - return promise.forget(); -} - -already_AddRefed<Promise> -Response::Json(ErrorResult& aRv) -{ - nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject()); - MOZ_ASSERT(global); - nsRefPtr<Promise> promise = Promise::Create(global, aRv); - if (aRv.Failed()) { - return nullptr; - } - - promise->MaybeReject(NS_ERROR_NOT_AVAILABLE); - return promise.forget(); -} - -already_AddRefed<Promise> -Response::Text(ErrorResult& aRv) -{ - nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject()); - MOZ_ASSERT(global); - nsRefPtr<Promise> promise = Promise::Create(global, aRv); - if (aRv.Failed()) { - return nullptr; - } - - promise->MaybeReject(NS_ERROR_NOT_AVAILABLE); - return promise.forget(); -} - -bool -Response::BodyUsed() -{ - return false; -}
deleted file mode 100644 --- a/dom/fetch/Response.h +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 mozilla_dom_Response_h -#define mozilla_dom_Response_h - -#include "nsWrapperCache.h" -#include "nsISupportsImpl.h" - -#include "mozilla/dom/ResponseBinding.h" -#include "mozilla/dom/UnionTypes.h" - -class nsPIDOMWindow; - -namespace mozilla { -namespace dom { - -class Headers; - -class Response MOZ_FINAL : public nsISupports - , public nsWrapperCache -{ - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Response) - -public: - Response(nsISupports* aOwner); - - JSObject* - WrapObject(JSContext* aCx) - { - return ResponseBinding::Wrap(aCx, this); - } - - ResponseType - Type() const - { - return ResponseType::Error; - } - - void - GetUrl(DOMString& aUrl) const - { - aUrl.AsAString() = EmptyString(); - } - - uint16_t - Status() const - { - return 400; - } - - void - GetStatusText(nsCString& aStatusText) const - { - aStatusText = EmptyCString(); - } - - Headers* - Headers_() const { return mHeaders; } - - static already_AddRefed<Response> - Error(const GlobalObject& aGlobal); - - static already_AddRefed<Response> - Redirect(const GlobalObject& aGlobal, const nsAString& aUrl, uint16_t aStatus); - - static already_AddRefed<Response> - Constructor(const GlobalObject& aGlobal, - const Optional<ArrayBufferOrArrayBufferViewOrScalarValueStringOrURLSearchParams>& aBody, - const ResponseInit& aInit, ErrorResult& rv); - - nsISupports* GetParentObject() const - { - return mOwner; - } - - already_AddRefed<Response> - Clone(); - - already_AddRefed<Promise> - ArrayBuffer(ErrorResult& aRv); - - already_AddRefed<Promise> - Blob(ErrorResult& aRv); - - already_AddRefed<Promise> - Json(ErrorResult& aRv); - - already_AddRefed<Promise> - Text(ErrorResult& aRv); - - bool - BodyUsed(); -private: - ~Response(); - - nsCOMPtr<nsISupports> mOwner; - nsRefPtr<Headers> mHeaders; -}; - -} // namespace dom -} // namespace mozilla - -#endif // mozilla_dom_Response_h
--- a/dom/fetch/moz.build +++ b/dom/fetch/moz.build @@ -1,24 +1,20 @@ # -*- Mode: python; c-basic-offset: 4; 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/. EXPORTS.mozilla.dom += [ 'Headers.h', - 'Request.h', - 'Response.h', ] UNIFIED_SOURCES += [ 'Headers.cpp', - 'Request.cpp', - 'Response.cpp', ] LOCAL_INCLUDES += [ '../workers', ] FAIL_ON_WARNINGS = True MSVC_ENABLE_PGO = True
--- a/dom/tests/mochitest/general/test_interfaces.html +++ b/dom/tests/mochitest/general/test_interfaces.html @@ -858,20 +858,16 @@ var interfaceNamesInGlobalScope = "RadioNodeList", // IMPORTANT: Do not change this list without review from a DOM peer! "Range", // IMPORTANT: Do not change this list without review from a DOM peer! "RecordErrorEvent", // IMPORTANT: Do not change this list without review from a DOM peer! "Rect", // IMPORTANT: Do not change this list without review from a DOM peer! - {name: "Request", pref: "dom.fetch.enabled"}, -// IMPORTANT: Do not change this list without review from a DOM peer! - {name: "Response", pref: "dom.fetch.enabled"}, -// IMPORTANT: Do not change this list without review from a DOM peer! "RGBColor", // IMPORTANT: Do not change this list without review from a DOM peer! {name: "RTCDataChannelEvent", pref: "media.peerconnection.enabled"}, // IMPORTANT: Do not change this list without review from a DOM peer! {name: "RTCPeerConnectionIceEvent", pref: "media.peerconnection.enabled"}, // IMPORTANT: Do not change this list without review from a DOM peer! {name: "RTCRtpReceiver", pref: "media.peerconnection.enabled"}, // IMPORTANT: Do not change this list without review from a DOM peer!
deleted file mode 100644 --- a/dom/webidl/Fetch.webidl +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. - * - * The origin of this IDL file is - * http://fetch.spec.whatwg.org/ - */ - -typedef object JSON; -// FIXME(nsm): Bug 1071290: Blobs can't be passed as unions in workers. -// FIXME(nsm): Bug 739173: FormData is not available in workers. -// typedef (ArrayBuffer or ArrayBufferView or Blob or FormData or ScalarValueString or URLSearchParams) BodyInit; -typedef (ArrayBuffer or ArrayBufferView or ScalarValueString or URLSearchParams) BodyInit; - -[NoInterfaceObject, Exposed=(Window,Worker)] -interface Body { - readonly attribute boolean bodyUsed; - [Throws] - Promise<ArrayBuffer> arrayBuffer(); - [Throws] - Promise<Blob> blob(); - // FIXME(nsm): Bug 739173 FormData is not supported in workers. - // Promise<FormData> formData(); - [Throws] - Promise<JSON> json(); - [Throws] - Promise<ScalarValueString> text(); -}; - -[NoInterfaceObject, Exposed=(Window,Worker)] -interface GlobalFetch { - [Throws, Func="mozilla::dom::Headers::PrefEnabled"] - Promise<Response> fetch(RequestInfo input, optional RequestInit init); -}; -
deleted file mode 100644 --- a/dom/webidl/Request.webidl +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. - * - * The origin of this IDL file is - * https://fetch.spec.whatwg.org/#request-class - */ - -typedef (Request or ScalarValueString) RequestInfo; - -[Constructor(RequestInfo input, optional RequestInit init), - Exposed=(Window,Worker), - Func="mozilla::dom::Headers::PrefEnabled"] -interface Request { - readonly attribute ByteString method; - readonly attribute ScalarValueString url; - readonly attribute Headers headers; - - readonly attribute DOMString referrer; - readonly attribute RequestMode mode; - readonly attribute RequestCredentials credentials; - - Request clone(); -}; - -Request implements Body; - -dictionary RequestInit { - ByteString method; - HeadersInit headers; - BodyInit body; - RequestMode mode; - RequestCredentials credentials; -}; - -enum RequestMode { "same-origin", "no-cors", "cors" }; -enum RequestCredentials { "omit", "same-origin", "include" };
deleted file mode 100644 --- a/dom/webidl/Response.webidl +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. - * - * The origin of this IDL file is - * https://fetch.spec.whatwg.org/#response-class - */ - -[Constructor(optional BodyInit body, optional ResponseInit init), - Exposed=(Window,Worker), - Func="mozilla::dom::Headers::PrefEnabled"] -interface Response { - static Response error(); - static Response redirect(ScalarValueString url, optional unsigned short status = 302); - - readonly attribute ResponseType type; - - readonly attribute ScalarValueString url; - readonly attribute unsigned short status; - readonly attribute ByteString statusText; - readonly attribute Headers headers; - - Response clone(); -}; - -Response implements Body; - -dictionary ResponseInit { - unsigned short status = 200; - // WebIDL spec doesn't allow default values for ByteString. - ByteString statusText; - HeadersInit headers; -}; - -enum ResponseType { "basic", "cors", "default", "error", "opaque" };
--- a/dom/webidl/Window.webidl +++ b/dom/webidl/Window.webidl @@ -460,9 +460,8 @@ interface ChromeWindow { * * Throws NS_ERROR_NOT_IMPLEMENTED if the OS doesn't support this. */ [Throws, Func="nsGlobalWindow::IsChromeWindow"] void beginWindowMove(Event mouseDownEvent, optional Element? panel = null); }; Window implements ChromeWindow; -Window implements GlobalFetch;
--- a/dom/webidl/WorkerGlobalScope.webidl +++ b/dom/webidl/WorkerGlobalScope.webidl @@ -33,17 +33,16 @@ partial interface WorkerGlobalScope { [Throws] void importScripts(DOMString... urls); readonly attribute WorkerNavigator navigator; }; WorkerGlobalScope implements WindowTimers; WorkerGlobalScope implements WindowBase64; -WorkerGlobalScope implements GlobalFetch; // Not implemented yet: bug 1072107. // WorkerGlobalScope implements FontFaceSource; // Mozilla extensions partial interface WorkerGlobalScope { attribute EventHandler onclose;
--- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -119,17 +119,16 @@ WEBIDL_FILES = [ 'DynamicsCompressorNode.webidl', 'Element.webidl', 'EngineeringMode.webidl', 'Event.webidl', 'EventHandler.webidl', 'EventListener.webidl', 'EventSource.webidl', 'EventTarget.webidl', - 'Fetch.webidl', 'File.webidl', 'FileList.webidl', 'FileMode.webidl', 'FileReader.webidl', 'FileReaderSync.webidl', 'FocusEvent.webidl', 'FontFace.webidl', 'FontFaceSet.webidl', @@ -322,20 +321,18 @@ WEBIDL_FILES = [ 'ProcessingInstruction.webidl', 'ProfileTimelineMarker.webidl', 'Promise.webidl', 'PromiseDebugging.webidl', 'PushManager.webidl', 'RadioNodeList.webidl', 'Range.webidl', 'Rect.webidl', - 'Request.webidl', 'ResourceStats.webidl', 'ResourceStatsManager.webidl', - 'Response.webidl', 'RGBColor.webidl', 'RTCConfiguration.webidl', 'RTCIceCandidate.webidl', 'RTCIdentityAssertion.webidl', 'RTCPeerConnection.webidl', 'RTCPeerConnectionStatic.webidl', 'RTCRtpReceiver.webidl', 'RTCRtpSender.webidl',
--- a/dom/workers/WorkerScope.cpp +++ b/dom/workers/WorkerScope.cpp @@ -298,24 +298,16 @@ WorkerGlobalScope::GetPerformance() if (!mPerformance) { mPerformance = new Performance(mWorkerPrivate); } return mPerformance; } -already_AddRefed<Promise> -WorkerGlobalScope::Fetch(const RequestOrScalarValueString& aInput, - const RequestInit& aInit, ErrorResult& aRv) -{ - aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); - return nullptr; -} - DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(WorkerPrivate* aWorkerPrivate) : WorkerGlobalScope(aWorkerPrivate) { } JSObject* DedicatedWorkerGlobalScope::WrapGlobalObject(JSContext* aCx) {
--- a/dom/workers/WorkerScope.h +++ b/dom/workers/WorkerScope.h @@ -3,18 +3,16 @@ * 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 mozilla_dom_workerscope_h__ #define mozilla_dom_workerscope_h__ #include "Workers.h" #include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/dom/RequestBinding.h" -#include "mozilla/dom/UnionTypes.h" namespace mozilla { namespace dom { class Console; class Function; class Promise; @@ -117,19 +115,16 @@ public: IMPL_EVENT_HANDLER(online) IMPL_EVENT_HANDLER(offline) IMPL_EVENT_HANDLER(close) void Dump(const Optional<nsAString>& aString) const; Performance* GetPerformance(); - - already_AddRefed<Promise> - Fetch(const RequestOrScalarValueString& aInput, const RequestInit& aInit, ErrorResult& aRv); }; class DedicatedWorkerGlobalScope MOZ_FINAL : public WorkerGlobalScope { ~DedicatedWorkerGlobalScope() { } public: explicit DedicatedWorkerGlobalScope(WorkerPrivate* aWorkerPrivate);
--- a/dom/workers/moz.build +++ b/dom/workers/moz.build @@ -81,16 +81,15 @@ include('/ipc/chromium/chromium-config.m FINAL_LIBRARY = 'xul' TEST_DIRS += [ 'test/extensions/bootstrap', 'test/extensions/traditional', ] MOCHITEST_MANIFESTS += [ - 'test/fetch/mochitest.ini', 'test/mochitest.ini', 'test/serviceworkers/mochitest.ini', ] MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini'] XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
deleted file mode 100644 --- a/dom/workers/test/fetch/mochitest.ini +++ /dev/null @@ -1,5 +0,0 @@ -[DEFAULT] -support-files = - worker_interfaces.js - -[test_interfaces.html]
deleted file mode 100644 --- a/dom/workers/test/fetch/moz.build +++ /dev/null @@ -1,7 +0,0 @@ -# -*- Mode: python; c-basic-offset: 4; 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/. - -MOCHITEST_MANIFESTS += ['mochitest.ini']
deleted file mode 100644 --- a/dom/workers/test/fetch/test_interfaces.html +++ /dev/null @@ -1,48 +0,0 @@ -<!-- - Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ ---> -<!DOCTYPE HTML> -<html> -<head> - <title>Bug 1017613 - Test fetch API interfaces</title> - <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> - <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> -</head> -<body> -<p id="display"></p> -<div id="content" style="display: none"></div> -<pre id="test"></pre> -<script class="testbody" type="text/javascript"> - - function checkEnabled() { - var worker = new Worker("worker_interfaces.js"); - worker.onmessage = function(event) { - - if (event.data.type == 'finish') { - SimpleTest.finish(); - } else if (event.data.type == 'status') { - ok(event.data.status, event.data.msg); - } - } - - worker.onerror = function(event) { - ok(false, "Worker had an error: " + event.data); - SimpleTest.finish(); - }; - - worker.postMessage(true); - } - - SimpleTest.waitForExplicitFinish(); - - SpecialPowers.pushPrefEnv({"set": [ - ["dom.fetch.enabled", true] - ]}, function() { - checkEnabled(); - }); -</script> -</pre> -</body> -</html> -
deleted file mode 100644 --- a/dom/workers/test/fetch/worker_interfaces.js +++ /dev/null @@ -1,12 +0,0 @@ -function ok(a, msg) { - dump("OK: " + !!a + " => " + a + " " + msg + "\n"); - postMessage({type: 'status', status: !!a, msg: a + ": " + msg }); -} - -onmessage = function() { - ok(typeof Headers === "function", "Headers should be defined"); - ok(typeof Request === "function", "Request should be defined"); - ok(typeof Response === "function", "Response should be defined"); - ok(typeof fetch === "function", "fetch() should be defined"); - postMessage({ type: 'finish' }); -}