Changeset 267089 in webkit


Ignore:
Timestamp:
Sep 15, 2020 10:04:05 AM (4 years ago)
Author:
weinig@apple.com
Message:

[WebIDL] Update Fetch IDLs to use WindowOrWorkerGlobalScope partial mixin
https://bugs.webkit.org/show_bug.cgi?id=216524

Reviewed by Darin Adler.

Move global fetch() function definition from DOMWindowFetch.idl & WorkerGlobalScopeFetch.idl
to single WindowOrWorkerGlobalScopeFetch.idl, matching the spec.

Also cleanup some comments in other Fetch related IDLs.

  • CMakeLists.txt:
  • DerivedSources-input.xcfilelist:
  • DerivedSources-output.xcfilelist:
  • DerivedSources.make:
  • Modules/fetch/DOMWindowFetch.cpp: Removed.
  • Modules/fetch/DOMWindowFetch.h: Removed.
  • Modules/fetch/DOMWindowFetch.idl: Removed.
  • Modules/fetch/FetchRequest.idl:
  • Modules/fetch/FetchRequestInit.idl:
  • Modules/fetch/FetchResponse.idl:
  • Modules/fetch/WindowOrWorkerGlobalScopeFetch.cpp: Added.

(WebCore::WindowOrWorkerGlobalScopeFetch::fetch):

  • Modules/fetch/WindowOrWorkerGlobalScopeFetch.h: Added.
  • Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl: Added.
  • Modules/fetch/WorkerGlobalScopeFetch.cpp: Removed.
  • Modules/fetch/WorkerGlobalScopeFetch.h: Removed.
  • Modules/fetch/WorkerGlobalScopeFetch.idl: Removed.
  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
Location:
trunk/Source/WebCore
Files:
1 added
6 deleted
10 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r267026 r267089  
    266266    Modules/entriesapi/HTMLInputElementEntriesAPI.idl
    267267
    268     Modules/fetch/DOMWindowFetch.idl
    269268    Modules/fetch/FetchBody.idl
    270269    Modules/fetch/FetchHeaders.idl
     
    277276    Modules/fetch/FetchRequestRedirect.idl
    278277    Modules/fetch/FetchResponse.idl
    279     Modules/fetch/WorkerGlobalScopeFetch.idl
     278    Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl
    280279
    281280    Modules/geolocation/Geolocation.idl
  • trunk/Source/WebCore/ChangeLog

    r267087 r267089  
     12020-09-15  Sam Weinig  <weinig@apple.com>
     2
     3        [WebIDL] Update Fetch IDLs to use WindowOrWorkerGlobalScope partial mixin
     4        https://bugs.webkit.org/show_bug.cgi?id=216524
     5
     6        Reviewed by Darin Adler.
     7
     8        Move global fetch() function definition from DOMWindowFetch.idl & WorkerGlobalScopeFetch.idl
     9        to single WindowOrWorkerGlobalScopeFetch.idl, matching the spec.
     10       
     11        Also cleanup some comments in other Fetch related IDLs.
     12
     13        * CMakeLists.txt:
     14        * DerivedSources-input.xcfilelist:
     15        * DerivedSources-output.xcfilelist:
     16        * DerivedSources.make:
     17        * Modules/fetch/DOMWindowFetch.cpp: Removed.
     18        * Modules/fetch/DOMWindowFetch.h: Removed.
     19        * Modules/fetch/DOMWindowFetch.idl: Removed.
     20        * Modules/fetch/FetchRequest.idl:
     21        * Modules/fetch/FetchRequestInit.idl:
     22        * Modules/fetch/FetchResponse.idl:
     23        * Modules/fetch/WindowOrWorkerGlobalScopeFetch.cpp: Added.
     24        (WebCore::WindowOrWorkerGlobalScopeFetch::fetch):
     25        * Modules/fetch/WindowOrWorkerGlobalScopeFetch.h: Added.
     26        * Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl: Added.
     27        * Modules/fetch/WorkerGlobalScopeFetch.cpp: Removed.
     28        * Modules/fetch/WorkerGlobalScopeFetch.h: Removed.
     29        * Modules/fetch/WorkerGlobalScopeFetch.idl: Removed.
     30        * Sources.txt:
     31        * WebCore.xcodeproj/project.pbxproj:
     32
    1332020-09-15  Zalan Bujtas  <zalan@apple.com>
    234
  • trunk/Source/WebCore/DerivedSources-input.xcfilelist

    r267011 r267089  
    9595$(PROJECT_DIR)/Modules/entriesapi/FileSystemFileEntry.idl
    9696$(PROJECT_DIR)/Modules/entriesapi/HTMLInputElementEntriesAPI.idl
    97 $(PROJECT_DIR)/Modules/fetch/DOMWindowFetch.idl
    9897$(PROJECT_DIR)/Modules/fetch/FetchBody.idl
    9998$(PROJECT_DIR)/Modules/fetch/FetchHeaders.idl
     
    106105$(PROJECT_DIR)/Modules/fetch/FetchRequestRedirect.idl
    107106$(PROJECT_DIR)/Modules/fetch/FetchResponse.idl
    108 $(PROJECT_DIR)/Modules/fetch/WorkerGlobalScopeFetch.idl
     107$(PROJECT_DIR)/Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl
    109108$(PROJECT_DIR)/Modules/gamepad/Gamepad.idl
    110109$(PROJECT_DIR)/Modules/gamepad/GamepadButton.idl
  • trunk/Source/WebCore/DerivedSources-output.xcfilelist

    r267011 r267089  
    491491$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSDOMWindowCaches.cpp
    492492$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSDOMWindowCaches.h
    493 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSDOMWindowFetch.cpp
    494 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSDOMWindowFetch.h
    495493$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSDOMWindowIndexedDatabase.cpp
    496494$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSDOMWindowIndexedDatabase.h
     
    23132311$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWindowOrWorkerGlobalScope.cpp
    23142312$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWindowOrWorkerGlobalScope.h
     2313$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWindowOrWorkerGlobalScopeFetch.cpp
     2314$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWindowOrWorkerGlobalScopeFetch.h
    23152315$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWorker.cpp
    23162316$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWorker.h
     
    23192319$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWorkerGlobalScopeCaches.cpp
    23202320$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWorkerGlobalScopeCaches.h
    2321 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWorkerGlobalScopeFetch.cpp
    2322 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWorkerGlobalScopeFetch.h
    23232321$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWorkerGlobalScopeIndexedDatabase.cpp
    23242322$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWorkerGlobalScopeIndexedDatabase.h
  • trunk/Source/WebCore/DerivedSources.make

    r267011 r267089  
    198198    $(WebCore)/Modules/entriesapi/FileSystemFileEntry.idl \
    199199    $(WebCore)/Modules/entriesapi/HTMLInputElementEntriesAPI.idl \
    200     $(WebCore)/Modules/fetch/DOMWindowFetch.idl \
    201200    $(WebCore)/Modules/fetch/FetchBody.idl \
    202201    $(WebCore)/Modules/fetch/FetchHeaders.idl \
     
    209208    $(WebCore)/Modules/fetch/FetchRequestRedirect.idl \
    210209    $(WebCore)/Modules/fetch/FetchResponse.idl \
    211     $(WebCore)/Modules/fetch/WorkerGlobalScopeFetch.idl \
     210    $(WebCore)/Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl \
    212211    $(WebCore)/Modules/gamepad/Gamepad.idl \
    213212    $(WebCore)/Modules/gamepad/GamepadButton.idl \
  • trunk/Source/WebCore/Modules/fetch/FetchRequest.idl

    r267007 r267089  
    3131typedef (FetchRequest or USVString) RequestInfo;
    3232
    33 typedef (Blob or BufferSource or DOMFormData or URLSearchParams or ReadableStream or USVString) BodyInit;
    34 
    3533[
    3634    ActiveDOMObject,
     
    5553    readonly attribute DOMString integrity;
    5654    [EnabledAtRuntime=FetchAPIKeepAlive] readonly attribute boolean keepalive;
     55    // FIXME: Implement 'isReloadNavigation'.
     56    // readonly attribute boolean isReloadNavigation;
     57    // FIXME: Implement 'isHistoryNavigation'.
     58    // readonly attribute boolean isHistoryNavigation;
    5759    readonly attribute AbortSignal signal;
    5860
  • trunk/Source/WebCore/Modules/fetch/FetchRequestInit.idl

    r241137 r267089  
    4040    DOMString integrity;
    4141    boolean keepalive;
     42    // FIXME: 'signal' should be of type AbortSignal?.
    4243    any signal;
    4344    any window; // can only be set to null
  • trunk/Source/WebCore/Modules/fetch/FetchResponse.idl

    r267007 r267089  
    5858    readonly attribute ByteString statusText;
    5959    readonly attribute FetchHeaders headers; // FIXME: Should be [SameObject].
    60     // FIXME: Add support for trailers.
    61     // readonly attribute Promise<Headers> trailer;
    6260
    6361    [CallWith=ScriptExecutionContext, MayThrowException, NewObject] FetchResponse clone();
  • trunk/Source/WebCore/Modules/fetch/WindowOrWorkerGlobalScopeFetch.h

    r267088 r267089  
    11/*
    2  * Copyright (C) 2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 typedef (sequence<sequence<ByteString>> or record<ByteString, ByteString>) HeadersInit;
     26#pragma once
    2727
    28 typedef (Blob or BufferSource or DOMFormData or URLSearchParams or ReadableStream or USVString) BodyInit;
     28#include "FetchRequest.h"
    2929
    30 dictionary FetchRequestInit {
    31     ByteString method;
    32     HeadersInit headers;
    33     BodyInit? body;
    34     USVString referrer;
    35     FetchReferrerPolicy referrerPolicy;
    36     FetchRequestMode mode;
    37     FetchRequestCredentials credentials;
    38     FetchRequestCache cache;
    39     FetchRequestRedirect redirect;
    40     DOMString integrity;
    41     boolean keepalive;
    42     any signal;
    43     any window; // can only be set to null
     30namespace WebCore {
     31
     32class DOMWindow;
     33class DeferredPromise;
     34class WorkerGlobalScope;
     35
     36class WindowOrWorkerGlobalScopeFetch {
     37public:
     38    static void fetch(DOMWindow&, FetchRequest::Info&&, FetchRequest::Init&&, Ref<DeferredPromise>&&);
     39    static void fetch(WorkerGlobalScope&, FetchRequest::Info&&, FetchRequest::Init&&, Ref<DeferredPromise>&&);
    4440};
     41
     42} // namespace WebCore
  • trunk/Source/WebCore/Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl

    r267088 r267089  
    11/*
    2  * Copyright (C) 2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 typedef (sequence<sequence<ByteString>> or record<ByteString, ByteString>) HeadersInit;
     26typedef (FetchRequest or USVString) RequestInfo;
    2727
    28 typedef (Blob or BufferSource or DOMFormData or URLSearchParams or ReadableStream or USVString) BodyInit;
    29 
    30 dictionary FetchRequestInit {
    31     ByteString method;
    32     HeadersInit headers;
    33     BodyInit? body;
    34     USVString referrer;
    35     FetchReferrerPolicy referrerPolicy;
    36     FetchRequestMode mode;
    37     FetchRequestCredentials credentials;
    38     FetchRequestCache cache;
    39     FetchRequestRedirect redirect;
    40     DOMString integrity;
    41     boolean keepalive;
    42     any signal;
    43     any window; // can only be set to null
     28// https://fetch.spec.whatwg.org/#fetch-method
     29[
     30    EnabledAtRuntime=FetchAPI,
     31    ImplementedBy=WindowOrWorkerGlobalScopeFetch
     32] partial interface mixin WindowOrWorkerGlobalScope {
     33    [NewObject] Promise<FetchResponse> fetch(RequestInfo input, optional FetchRequestInit init);
    4434};
  • trunk/Source/WebCore/Sources.txt

    r267076 r267089  
    4949Modules/entriesapi/FileSystemFileEntry.cpp
    5050Modules/entriesapi/HTMLInputElementEntriesAPI.cpp
    51 Modules/fetch/DOMWindowFetch.cpp
    5251Modules/fetch/FetchBody.cpp
    5352Modules/fetch/FetchBodyConsumer.cpp
     
    5857Modules/fetch/FetchRequest.cpp
    5958Modules/fetch/FetchResponse.cpp
    60 Modules/fetch/WorkerGlobalScopeFetch.cpp
     59Modules/fetch/WindowOrWorkerGlobalScopeFetch.cpp
    6160Modules/geolocation/GeoNotifier.cpp
    6261Modules/geolocation/Geolocation.cpp
     
    28172816JSDOMWindow.cpp
    28182817JSDOMWindowCaches.cpp
    2819 JSDOMWindowFetch.cpp
    28202818JSDOMWindowIndexedDatabase.cpp
    28212819JSDOMWindowQuota.cpp
     
    36583656JSWindowEventHandlers.cpp
    36593657JSWindowOrWorkerGlobalScope.cpp
     3658JSWindowOrWorkerGlobalScopeFetch.cpp
    36603659JSWorker.cpp
    36613660JSWorkerGlobalScope.cpp
    36623661JSWorkerGlobalScopeCaches.cpp
    3663 JSWorkerGlobalScopeFetch.cpp
    36643662JSWorkerGlobalScopeIndexedDatabase.cpp
    36653663JSWorkerLocation.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r267087 r267089  
    76257625                418A06CE133C04D500CD379C /* EventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventDispatcher.h; sourceTree = "<group>"; };
    76267626                418A06CF133C04D500CD379C /* EventDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventDispatcher.cpp; sourceTree = "<group>"; };
    7627                 418C39521C8DAC7B0051C8A3 /* DOMWindowFetch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowFetch.cpp; sourceTree = "<group>"; };
    7628                 418C39531C8DAC7B0051C8A3 /* DOMWindowFetch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowFetch.h; sourceTree = "<group>"; };
    7629                 418C39541C8DAC7B0051C8A3 /* DOMWindowFetch.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindowFetch.idl; sourceTree = "<group>"; };
    7630                 418C39571C8DD6960051C8A3 /* WorkerGlobalScopeFetch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerGlobalScopeFetch.cpp; sourceTree = "<group>"; };
    7631                 418C39581C8DD6960051C8A3 /* WorkerGlobalScopeFetch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerGlobalScopeFetch.h; sourceTree = "<group>"; };
    7632                 418C39591C8DD6960051C8A3 /* WorkerGlobalScopeFetch.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WorkerGlobalScopeFetch.idl; sourceTree = "<group>"; };
    76337627                418C395B1C8F0A610051C8A3 /* ReadableStreamSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamSource.h; sourceTree = "<group>"; };
    76347628                418C395C1C8F0A610051C8A3 /* ReadableStreamSource.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamSource.idl; sourceTree = "<group>"; };
     
    1014010134                7C2D722C2508396300539662 /* GlobalEventHandlersCSSAnimations.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GlobalEventHandlersCSSAnimations.idl; sourceTree = "<group>"; };
    1014110135                7C2D722E25083A3400539662 /* GlobalEventHandlersPointerEvents.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GlobalEventHandlersPointerEvents.idl; sourceTree = "<group>"; };
     10136                7C2E0BCF25106AC4005F3C87 /* WindowOrWorkerGlobalScopeFetch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WindowOrWorkerGlobalScopeFetch.h; sourceTree = "<group>"; };
     10137                7C2E0BD025106AC4005F3C87 /* WindowOrWorkerGlobalScopeFetch.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WindowOrWorkerGlobalScopeFetch.cpp; sourceTree = "<group>"; };
     10138                7C2E0BD125106AC4005F3C87 /* WindowOrWorkerGlobalScopeFetch.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WindowOrWorkerGlobalScopeFetch.idl; sourceTree = "<group>"; };
    1014210139                7C2FA60F1EA95A3200A03108 /* ResourceCryptographicDigest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceCryptographicDigest.cpp; sourceTree = "<group>"; };
    1014310140                7C2FA6101EA95A3200A03108 /* ResourceCryptographicDigest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceCryptographicDigest.h; sourceTree = "<group>"; };
     
    1912219119                        isa = PBXGroup;
    1912319120                        children = (
    19124                                 418C39521C8DAC7B0051C8A3 /* DOMWindowFetch.cpp */,
    19125                                 418C39531C8DAC7B0051C8A3 /* DOMWindowFetch.h */,
    19126                                 418C39541C8DAC7B0051C8A3 /* DOMWindowFetch.idl */,
    1912719121                                41F54F7D1C50C4F600338488 /* FetchBody.cpp */,
    1912819122                                41F54F7E1C50C4F600338488 /* FetchBody.h */,
     
    1915919153                                413015D61C7B570400091C6E /* FetchResponse.h */,
    1916019154                                413015D71C7B570400091C6E /* FetchResponse.idl */,
    19161                                 418C39571C8DD6960051C8A3 /* WorkerGlobalScopeFetch.cpp */,
    19162                                 418C39581C8DD6960051C8A3 /* WorkerGlobalScopeFetch.h */,
    19163                                 418C39591C8DD6960051C8A3 /* WorkerGlobalScopeFetch.idl */,
     19155                                7C2E0BD025106AC4005F3C87 /* WindowOrWorkerGlobalScopeFetch.cpp */,
     19156                                7C2E0BCF25106AC4005F3C87 /* WindowOrWorkerGlobalScopeFetch.h */,
     19157                                7C2E0BD125106AC4005F3C87 /* WindowOrWorkerGlobalScopeFetch.idl */,
    1916419158                        );
    1916519159                        path = fetch;
Note: See TracChangeset for help on using the changeset viewer.