Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Issue 177733003: ServiceWorker request intercept plan 1: Create per-request URLRequestContext (Closed)

Created:
6 years, 10 months ago by kinuko
Modified:
6 years, 9 months ago
CC:
chromium-reviews, tzik, jam, nhiroki, joi+watch-content_chromium.org, darin-cc_chromium.org, horo+watch_chromium.org, kinuko+watch, serviceworker-reviews
Visibility:
Public.

Description

Implement custom URLRequestJobFactory to intercept requests for ServiceWorker This change adds new ServiceWorkerRequestContext class, which: - inherits from URLRequestContext - provides custom URLRequestJobFactory to handle requests for ServiceWorker - is to be created per each request to provide pre-request customization To ensure that ServiceWorkerRequestContext is valid during the lifetime of URLRequest, it's attached to URLRequest via SupportsUserData API. BUG=285976

Patch Set 1 #

Patch Set 2 : minimize #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -0 lines) Patch
A content/browser/service_worker/service_worker_request_context.h View 1 1 chunk +30 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_request_context.cc View 1 1 chunk +55 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
kinuko
This is a new attempt to handle requests with ServiceWorker via URLRequestContext::set_job_factory(factory). Can you take ...
6 years, 10 months ago (2014-02-24 13:16:29 UTC) #1
michaeln
I think the place to do this is probably somewhere in the neighborhood of chrome/browser/profile/profile_io_data.cc. ...
6 years, 9 months ago (2014-02-25 23:51:57 UTC) #2
kinuko
(This patch may not go anywhere, but continue discussion for exploration) I think this could ...
6 years, 9 months ago (2014-02-26 02:49:16 UTC) #3
mmenke
On 2014/02/26 02:49:16, kinuko wrote: > (This patch may not go anywhere, but continue discussion ...
6 years, 9 months ago (2014-02-26 19:08:56 UTC) #4
michaeln
I think i have a URLRequest feature request to help with this. Currently the caller ...
6 years, 9 months ago (2014-02-26 19:31:15 UTC) #5
kinuko
(Per offline discussion I assume it's worth pursuing this direction more) On 2014/02/26 19:31:15, michaeln ...
6 years, 9 months ago (2014-02-28 04:06:07 UTC) #6
mmenke
On 2014/02/28 04:06:07, kinuko wrote: > (Per offline discussion I assume it's worth pursuing this ...
6 years, 9 months ago (2014-02-28 20:09:16 UTC) #7
michaeln
> 1) Create a RequestContext for each request from a frame This feels wrong and ...
6 years, 9 months ago (2014-02-28 21:27:00 UTC) #8
mmenke
On 2014/02/28 21:27:00, michaeln wrote: > > 1) Create a RequestContext for each request from ...
6 years, 9 months ago (2014-02-28 21:36:50 UTC) #9
michaeln
> I rather agree with you in eliminating 1 and 4 (I just listed 4 ...
6 years, 9 months ago (2014-02-28 22:18:28 UTC) #10
kinuko
I do like to eliminate 4 too, while I don't see why 1 is particularly ...
6 years, 9 months ago (2014-03-03 04:12:23 UTC) #11
kinuko
I took rough attempts to compare three options: Plan 1: this CL (https://codereview.chromium.org/177733003/) Plan 2: ...
6 years, 9 months ago (2014-03-03 12:45:14 UTC) #12
mmenke
About approach 1: The URLRequest can't own the context. The context has to be destroyed ...
6 years, 9 months ago (2014-03-03 15:57:03 UTC) #13
kinuko
On 2014/03/03 15:57:03, mmenke wrote: > About approach 1: The URLRequest can't own the context. ...
6 years, 9 months ago (2014-03-04 04:52:38 UTC) #14
mmenke
On 2014/03/04 04:52:38, kinuko wrote: > On 2014/03/03 15:57:03, mmenke wrote: > > About approach ...
6 years, 9 months ago (2014-03-04 17:51:34 UTC) #15
kinuko
6 years, 9 months ago (2014-03-05 04:38:29 UTC) #16
> As completely hideous as all the boilerplate is, I still think we should go
with
> 3.  I don't like adding yet another way of doing things for 2, and I think
we'd
> also want another class to do it right (I think we'd want another
> interceptor-type class, rather than a class that wraps either its own or a new
> URLRequestJobFactory).

O...key, sure we can go with plan 3, and hopefully other content consumers can
reuse the same pattern when necessayr.

> I suggest landing all the boilerplate separate from the
> service_worker_request_interceptor class.  Since it goes through a bunch of
> classes, can send that out quickly, which should hopefully minimize the pain.

Makes sense, will split the patch and re-upload for reviews.

Powered by Google App Engine
This is Rietveld 408576698