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

Issue 1142383006: CrNet: add pauseable NSURLProtocol and switch to using it (Closed)

Created:
5 years, 7 months ago by Elly Fong-Jones
Modified:
5 years, 6 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

CrNet: add pauseable NSURLProtocol and switch to using it On iOS 8 with NSURLProtocol, CFNetwork appears to treat |-startLoading| as meaning "start or resume" and |-stopLoading| as "pause", and may deliver many such notifications over the lifetime of a request. The old CRNHTTPProtocolHandler is not designed for this behavior, so this change adds a separate NSURLProtocol implementation that can defer sending callbacks until the request is "resumed". This change should not affect the behavior of Chromium on iOS in any way, since Chromium will continue using the old NSURLProtocol implementation with the old behavior. The new NSURLProtocol ought to be safe to use in the same situations, but demonstrating this conclusively is difficult. Also, replace crnet_consumer with a non-graphical app with its own NSURLSession delegate to make testing behavior easier. BUG= Committed: https://crrev.com/7d0f7a2bc58307ec844f5d82c03a333117d74f2b Cr-Commit-Position: refs/heads/master@{#334168}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Fold PauseableProxy into Proxy #

Total comments: 12

Patch Set 3 : Major refactor #

Patch Set 4 : Fixes #

Total comments: 21

Patch Set 5 : Documentation and refactors #

Total comments: 14

Patch Set 6 : doc fixes #

Patch Set 7 : main.m -> main.mm & format #

Unified diffs Side-by-side diffs Delta from patch set Stats (+392 lines, -60 lines) Patch
M ios/crnet/crnet_consumer/crnet_consumer.gyp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M ios/crnet/crnet_consumer/main.m View 1 2 3 4 5 6 1 chunk +0 lines, -15 lines 0 comments Download
A ios/crnet/crnet_consumer/main.mm View 1 2 3 4 5 6 1 chunk +126 lines, -0 lines 0 comments Download
M ios/crnet/crnet_environment.mm View 1 2 3 4 5 2 chunks +4 lines, -3 lines 0 comments Download
M ios/net/crn_http_protocol_handler.h View 1 1 chunk +9 lines, -0 lines 0 comments Download
M ios/net/crn_http_protocol_handler.mm View 1 2 3 4 5 2 chunks +147 lines, -6 lines 0 comments Download
M ios/net/crn_http_protocol_handler_proxy.h View 1 2 3 4 1 chunk +9 lines, -1 line 0 comments Download
M ios/net/crn_http_protocol_handler_proxy_with_client_thread.mm View 1 2 3 4 5 6 chunks +96 lines, -34 lines 0 comments Download

Messages

Total messages: 21 (3 generated)
Elly Fong-Jones
marq, stuart: PTAL? This CL is a draft, currently: TODO: unit tests TODO: documentation TODO: ...
5 years, 7 months ago (2015-05-22 16:20:50 UTC) #2
marq (ping after 24h)
I think this is OK as a design; as discussed it seems 100% safe for ...
5 years, 7 months ago (2015-05-22 16:56:53 UTC) #3
Elly Fong-Jones
https://codereview.chromium.org/1142383006/diff/1/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/1142383006/diff/1/ios/net/crn_http_protocol_handler.mm#newcode966 ios/net/crn_http_protocol_handler.mm:966: // TODO(ellyjones): restructure so that is not true. On ...
5 years, 7 months ago (2015-05-26 21:16:09 UTC) #4
droger
https://codereview.chromium.org/1142383006/diff/20001/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/1142383006/diff/20001/ios/net/crn_http_protocol_handler.mm#newcode1002 ios/net/crn_http_protocol_handler.mm:1002: - (void)dealloc { I am concerned that dealloc might ...
5 years, 7 months ago (2015-05-27 17:09:01 UTC) #6
stuartmorgan
I'll defer to marq and droger on this unless there's something you specifically want my ...
5 years, 6 months ago (2015-05-28 13:49:40 UTC) #7
Elly Fong-Jones
droger: ptal? https://codereview.chromium.org/1142383006/diff/20001/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/1142383006/diff/20001/ios/net/crn_http_protocol_handler.mm#newcode1002 ios/net/crn_http_protocol_handler.mm:1002: - (void)dealloc { On 2015/05/27 17:09:00, droger ...
5 years, 6 months ago (2015-06-10 17:06:36 UTC) #8
Elly Fong-Jones
droger: ptal?
5 years, 6 months ago (2015-06-10 17:06:37 UTC) #9
droger
Looks fine from a threading perspective, I don't see any major issue. Minor issues: https://codereview.chromium.org/1142383006/diff/60001/ios/net/crn_http_protocol_handler.mm ...
5 years, 6 months ago (2015-06-11 08:56:20 UTC) #10
droger
https://codereview.chromium.org/1142383006/diff/60001/ios/net/crn_http_protocol_handler_proxy.h File ios/net/crn_http_protocol_handler_proxy.h (right): https://codereview.chromium.org/1142383006/diff/60001/ios/net/crn_http_protocol_handler_proxy.h#newcode18 ios/net/crn_http_protocol_handler_proxy.h:18: // Called from the client thread. On 2015/06/11 08:56:19, ...
5 years, 6 months ago (2015-06-11 08:58:36 UTC) #11
droger
https://codereview.chromium.org/1142383006/diff/60001/ios/net/crn_http_protocol_handler_proxy.h File ios/net/crn_http_protocol_handler_proxy.h (right): https://codereview.chromium.org/1142383006/diff/60001/ios/net/crn_http_protocol_handler_proxy.h#newcode18 ios/net/crn_http_protocol_handler_proxy.h:18: // Called from the client thread. On 2015/06/11 08:58:36, ...
5 years, 6 months ago (2015-06-11 09:01:21 UTC) #12
Elly Fong-Jones
ptal? https://codereview.chromium.org/1142383006/diff/60001/ios/net/crn_http_protocol_handler.mm File ios/net/crn_http_protocol_handler.mm (right): https://codereview.chromium.org/1142383006/diff/60001/ios/net/crn_http_protocol_handler.mm#newcode884 ios/net/crn_http_protocol_handler.mm:884: _core.swap(core); On 2015/06/11 08:56:19, droger wrote: > Nit: ...
5 years, 6 months ago (2015-06-11 13:49:34 UTC) #13
Elly Fong-Jones
ptal?
5 years, 6 months ago (2015-06-11 13:49:35 UTC) #14
droger
https://codereview.chromium.org/1142383006/diff/80001/ios/crnet/crnet_consumer/main.m File ios/crnet/crnet_consumer/main.m (right): https://codereview.chromium.org/1142383006/diff/80001/ios/crnet/crnet_consumer/main.m#newcode1 ios/crnet/crnet_consumer/main.m:1: // Copyright 2014 The Chromium Authors. All rights reserved. ...
5 years, 6 months ago (2015-06-11 15:45:57 UTC) #15
Elly Fong-Jones
https://codereview.chromium.org/1142383006/diff/80001/ios/crnet/crnet_consumer/main.m File ios/crnet/crnet_consumer/main.m (right): https://codereview.chromium.org/1142383006/diff/80001/ios/crnet/crnet_consumer/main.m#newcode1 ios/crnet/crnet_consumer/main.m:1: // Copyright 2014 The Chromium Authors. All rights reserved. ...
5 years, 6 months ago (2015-06-12 15:03:00 UTC) #16
droger
lgtm
5 years, 6 months ago (2015-06-12 15:13:15 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1142383006/120001
5 years, 6 months ago (2015-06-12 15:14:47 UTC) #19
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 6 months ago (2015-06-12 15:30:08 UTC) #20
commit-bot: I haz the power
5 years, 6 months ago (2015-06-12 15:31:13 UTC) #21
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/7d0f7a2bc58307ec844f5d82c03a333117d74f2b
Cr-Commit-Position: refs/heads/master@{#334168}

Powered by Google App Engine
This is Rietveld 408576698