Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Issue 436770 Expose the fetch API to Window (and workers)
Starred by 34 users Project Member Reported by yhirano@chromium.org, Nov 26 2014 Back to list
Status: Fixed
Owner:
Closed: Feb 2015
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Feature

Blocked on:
issue 444493

Blocking:
issue 240603



Sign in to add a comment
The API is exposed to service worker.
Let's expose it to window and other workers as well.
 
The first step is to expose it under a runtime enabled flag.

Cc: bashi@chromium.org haraken@chromium.org
Owner: yhirano@chromium.org
Status: Assigned
We need a web IDL new notation, because the API is already exposed to service worker by default, but I would like to expose it to Window in a runtime enabled flag.

I would like to extend the "Exposed" attribute (http://www.chromium.org/blink/webidl/blink-idl-extended-attributes#TOC-Exposed-i-).

 - Allow Exposed=object(flag)
  - That means the interface is exposed to object if flag is enabled.

haraken@, bashi@, what do you think about this idea?

Can't we just use [RuntimeEnabled] on the interface?

Or do you want to make the interface available unconditionally but want to expose the interface onto a window object conditionally? (That seems like a little bit strange requirement though.)

I'd like to expose it to service worker if ServiceWorker is enabled.
I'd like to expose it to window if FetchOnWindow is enabled.

Makes sense, thanks for the clarification!

It sounds reasonable to support the syntax in an [Exposed] IDL attribute. I'm not sure if the [Exposed=object(flag)] syntax is the best, and want to defer the decision to bashi-san.

Comment 6 by bashi@google.com, Nov 26 2014
How about factoring out fetch() from ServiceWorkerGlobalScope to a new interface called GlobalFetch (as the spec says) and use RuntimeEnabled extended attribute in "implements" statement like blow?

[
  Exposed=ServiceWorker,
] interface GlobalFetch {
  [CallWith=ScriptState, RaisesException] Promise<Response> fetch(RequestInfo input, optional Dictionary init);
};

[RuntimeEnabled=FetchOnWindow] Window implements GlobalFetch;
ServiceWorkerGlobalScope implements GlobalFetch;

I might have misunderstand your points, so please let me know if I get wrong idea. (I'm also not sure the current code generator can handle this.)
Comment 7 by horo@chromium.org, Nov 26 2014
We have to expose Request class and Response class to window when 'FetchOnWindow' is enabled.
Comment 8 by bashi@chromium.org, Nov 26 2014
I see. Then introducing a new notation to "Expose" would make sense. Could you keep the current notation as well? (e.g. Exposed=Foo and Exposed=(Foo,Bar)).


Yes, of course!

Project Member Comment 10 by bugdroid1@chromium.org, Dec 3 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=186357

------------------------------------------------------------------
r186357 | yhirano@chromium.org | 2014-12-03T01:25:57.136290Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/templates/methods.cpp?r1=186357&r2=186356&pathrev=186357
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/tests/results/core/V8TestInterface.cpp?r1=186357&r2=186356&pathrev=186357
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/tests/idls/core/TestInterface.idl?r1=186357&r2=186356&pathrev=186357

Fix [Exposed=..., RuntimeEnabled=...] IDL code generation.

Previously RuntimeEnabled extended attribute was ignored when specified with
Exposed. This CL fixes the problem.

This is a preparation for https://crbug.com/436770

BUG= 436770 

Review URL: https://codereview.chromium.org/770253002
-----------------------------------------------------------------
Project Member Comment 11 by bugdroid1@chromium.org, Dec 9 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=186770

------------------------------------------------------------------
r186770 | yhirano@chromium.org | 2014-12-09T10:53:25.573701Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/workers/WorkerGlobalScope.h?r1=186770&r2=186769&pathrev=186770
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchManager.h?r1=186770&r2=186769&pathrev=186770
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/WorkerFetch.idl?r1=186770&r2=186769&pathrev=186770
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/GlobalFetch.cpp?r1=186770&r2=186769&pathrev=186770
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h?r1=186770&r2=186769&pathrev=186770
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt?r1=186770&r2=186769&pathrev=186770
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt?r1=186770&r2=186769&pathrev=186770
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/GlobalFetch.h?r1=186770&r2=186769&pathrev=186770
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/workers/WorkerThread.cpp?r1=186770&r2=186769&pathrev=186770
   M http://src.chromium.org/viewvc/blink/trunk/Source/platform/RuntimeEnabledFeatures.in?r1=186770&r2=186769&pathrev=186770
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-interface-listing-expected.txt?r1=186770&r2=186769&pathrev=186770
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/modules.gypi?r1=186770&r2=186769&pathrev=186770
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchManager.cpp?r1=186770&r2=186769&pathrev=186770
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp?r1=186770&r2=186769&pathrev=186770
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/WindowFetch.idl?r1=186770&r2=186769&pathrev=186770

Expose fetch function to Window and WorkerGlobalScope.

Expose "fetch" function to Window and WorkerGlobalScope under "GlobalFetch"
runtime enabled flag.
This CL doesn't expose other interfaces such as Request, Response and so on.

BUG= 436770 

Review URL: https://codereview.chromium.org/791523002
-----------------------------------------------------------------
Blocking: chromium:240603
Cc: igrigo...@chromium.org
Project Member Comment 14 by bugdroid1@chromium.org, Dec 11 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=186945

------------------------------------------------------------------
r186945 | yhirano@chromium.org | 2014-12-11T11:51:37.900128Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/tests/idls/core/TestInterface.idl?r1=186945&r2=186944&pathrev=186945
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/tests/idls/core/TestInterface2.idl?r1=186945&r2=186944&pathrev=186945
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/scripts/generate_global_constructors.py?r1=186945&r2=186944&pathrev=186945
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/scripts/idl_definitions.py?r1=186945&r2=186944&pathrev=186945
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/scripts/v8_utilities.py?r1=186945&r2=186944&pathrev=186945
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/scripts/utilities.py?r1=186945&r2=186944&pathrev=186945
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/tests/results/core/V8TestInterface.cpp?r1=186945&r2=186944&pathrev=186945

Introduce [Exposed(Arguments)] in IDL code generator.

This CL introduces [Exposed(Arguments)] form to "Exposed" extended attribute
in addition to the existing [Exposed=(Value)] form.
For example, [Exposed(Window f1, Worker f2)] exposes the qualified element to
Window if "f1" is enabled and to Worker if "f2" is enabled.

BUG= 436770 

Review URL: https://codereview.chromium.org/789473002
-----------------------------------------------------------------
Project Member Comment 15 by bugdroid1@chromium.org, Dec 11 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=186953

------------------------------------------------------------------
r186953 | yhirano@chromium.org | 2014-12-11T15:25:53.066553Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/fetch?r1=186953&r2=186952&pathrev=186953
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Response.idl?r1=186953&r2=186952&pathrev=186953
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/fetch/workers/request.html?r1=186953&r2=186952&pathrev=186953
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt?r1=186953&r2=186952&pathrev=186953
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt?r1=186953&r2=186952&pathrev=186953
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/fetch/resources?r1=186953&r2=186952&pathrev=186953
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Request.idl?r1=186953&r2=186952&pathrev=186953
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/fetch/request.html?r1=186953&r2=186952&pathrev=186953
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/fetch/workers?r1=186953&r2=186952&pathrev=186953
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/fetch/resources/request.js?r1=186953&r2=186952&pathrev=186953
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-interface-listing-expected.txt?r1=186953&r2=186952&pathrev=186953
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Headers.idl?r1=186953&r2=186952&pathrev=186953

Expose Fetch API related classes to Window and WorkerGlobalScope.

Expose Request, Response and Headers to Window and WorkerGlobalScope under
"GlobalFetch" runtime enabled flag.

BUG= 436770 

Review URL: https://codereview.chromium.org/771323004
-----------------------------------------------------------------
Project Member Comment 16 by bugdroid1@chromium.org, Dec 17 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=187356

------------------------------------------------------------------
r187356 | yhirano@chromium.org | 2014-12-17T10:11:57.207128Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/ResponseTest.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Request.idl?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/FetchResponseDataTest.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/BodyStreamBuffer.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/FetchHeaderList.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Headers.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/RequestInit.h?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/WindowFetch.idl?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/DEPS?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Request.cpp?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/CacheStorage.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/RequestInit.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/GlobalFetch.h?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchEvent.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/ResponseTest.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Body.idl?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchResponseDataTest.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchHeaderList.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/BodyStreamBuffer.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/WindowFetch.idl?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Body.cpp?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/DEPS?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/FetchHeaderList.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/RequestInit.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/FetchRequestData.h?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/RespondWithObserver.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Response.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/GlobalFetch.h?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/FetchResponseData.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Body.idl?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/BodyStreamBuffer.h?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/GlobalFetch.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Body.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchHeaderList.cpp?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchEvent.h?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Response.idl?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchRequestData.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Response.h?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Cache.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/ResponseInit.h?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/RequestTest.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/FetchManager.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchResponseData.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/BodyStreamBuffer.h?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/FetchRequestData.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/GlobalFetch.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Response.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Headers.idl?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/FetchResponseData.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Body.h?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/BodyStreamBufferTest.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Response.idl?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/WorkerFetch.idl?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Headers.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/ResponseInit.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/RequestTest.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchManager.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchRequestData.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Response.cpp?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/web/ServiceWorkerGlobalScopeProxy.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/FetchManager.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Headers.idl?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Body.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchResponseData.cpp?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/BodyStreamBufferTest.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/OWNERS?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Request.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/WorkerFetch.idl?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Headers.cpp?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/modules.gypi?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/FetchManager.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Request.idl?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Headers.h?r1=187356&r2=187355&pathrev=187356
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/Request.h?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/RequestInit.h?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/CacheTest.cpp?r1=187356&r2=187355&pathrev=187356
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Request.cpp?r1=187356&r2=187355&pathrev=187356
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp?r1=187356&r2=187355&pathrev=187356

Move Fetch API releted code to modules/fetch.

Fetch API related code is located on modules/serviceworkers because of a
historical reason. Now fetch() function is planned to be exposed to
other global scopes and it is natural to have a dedicated directory.

modules/serviceworkers depends on modules/fetch.

BUG= 436770 

Review URL: https://codereview.chromium.org/795323003
-----------------------------------------------------------------
Blockedon: chromium:444493
Labels: -Type-Bug -Pri-2 Type-Feature Pri-1 OWP-Type-NewAPI OWP-Standards-OfficialSpec M-42
Project Member Comment 19 by bugdroid1@chromium.org, Jan 19 2015
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=188602

------------------------------------------------------------------
r188602 | yhirano@chromium.org | 2015-01-19T08:09:59.128062Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/frame/UseCounter.h?r1=188602&r2=188601&pathrev=188602
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/GlobalFetch.cpp?r1=188602&r2=188601&pathrev=188602
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/fetch/Body.cpp?r1=188602&r2=188601&pathrev=188602

Add use counters for Fetch API.

This CL adds two use counters: Fetch and FetchBodyStream. Fetch counts the
number of fetch() function calls. FetchBodyStream is logged when .body
attribute is accessed in Body mixin. Note that both events in SharedWorker and
ServiceWorker are not counted.

BUG= 436770 ,  435393 
R=tyoshino

Review URL: https://codereview.chromium.org/838003006
-----------------------------------------------------------------
Project Member Comment 20 by bugdroid1@chromium.org, Jan 21 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ae1a91dab26b089c244743a4e5cebf8cf9032bcc

commit ae1a91dab26b089c244743a4e5cebf8cf9032bcc
Author: yhirano <yhirano@chromium.org>
Date: Wed Jan 21 13:54:41 2015

Update histograms.xml.

Update histograms.xml using update_use_counter_feature_enum.py.

BUG= 436770 ,  435393 
R=tyoshino

Review URL: https://codereview.chromium.org/852303002

Cr-Commit-Position: refs/heads/master@{#312325}

[modify] http://crrev.com/ae1a91dab26b089c244743a4e5cebf8cf9032bcc/tools/metrics/histograms/histograms.xml

Project Member Comment 21 by bugdroid1@chromium.org, Jan 21 2015
Labels: merge-merged-2283
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ae1a91dab26b089c244743a4e5cebf8cf9032bcc

commit ae1a91dab26b089c244743a4e5cebf8cf9032bcc
Author: yhirano <yhirano@chromium.org>
Date: Wed Jan 21 13:54:41 2015

Update histograms.xml.

Update histograms.xml using update_use_counter_feature_enum.py.

BUG= 436770 ,  435393 
R=tyoshino

Review URL: https://codereview.chromium.org/852303002

Cr-Commit-Position: refs/heads/master@{#312325}

[modify] http://crrev.com/ae1a91dab26b089c244743a4e5cebf8cf9032bcc/tools/metrics/histograms/histograms.xml

Project Member Comment 22 by bugdroid1@chromium.org, Jan 27 2015
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=189008

------------------------------------------------------------------
r189008 | yhirano@chromium.org | 2015-01-27T08:04:59.960980Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/frame/UseCounter.h?r1=189008&r2=189007&pathrev=189008
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/xmlhttprequest/XMLHttpRequest.cpp?r1=189008&r2=189007&pathrev=189008

Add a use counter for async XHR.

Add a use counter for asynchronous XMLHttpRequest.send call.

BUG= 436770 

Review URL: https://codereview.chromium.org/876583002
-----------------------------------------------------------------
Project Member Comment 23 by bugdroid1@chromium.org, Jan 27 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2ab4eb36c5aadf290c0cc2fadf0523111eebe837

commit 2ab4eb36c5aadf290c0cc2fadf0523111eebe837
Author: yhirano <yhirano@chromium.org>
Date: Tue Jan 27 16:30:59 2015

Update histograms.xml.

Update histograms.xml using update_use_counter_feature_enum.py.

BUG= 436770 ,  435393 

Review URL: https://codereview.chromium.org/872403005

Cr-Commit-Position: refs/heads/master@{#313286}

[modify] http://crrev.com/2ab4eb36c5aadf290c0cc2fadf0523111eebe837/tools/metrics/histograms/histograms.xml

Fetch API is exposed (without flags), starting from the following revisions/versions:
Blink Revision: 190119
Chromium Blink roll: revision 316196
Chromium tag/version: 42.0.2305.0 (Available in Canary on win/mac)

Status: Fixed
It would be nice if the Fetch API supported the `chrome-extension` protocol, at least in Chrome. I know that protocol isn't mentioned in the Fetch API specification but it would make some Chrome App operations much more streamlined (e.g. loading app package files) and allow us to move away from XMLHttpRequest entirely.
There is already a bug for that: crbug.com/466876
Thanks Daniel.
Cc: pfar@google.com dmu...@chromium.org
Issue 408041 has been merged into this issue.
Comment 32 by tkent@chromium.org, Nov 27 2015
Labels: -Cr-Blink-XHR Cr-Blink-Network-XHR
Sign in to add a comment