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

Issue 13609002: fix a problem that android cannot download files with basic authentication (Closed)

Created:
7 years, 8 months ago by qinmin
Modified:
7 years, 8 months ago
Reviewers:
asanka, nilesh
CC:
chromium-reviews, cbentzel+watch_chromium.org, joi+watch-content_chromium.org, melevin, samarth+watch_chromium.org, benjhayden+dwatch_chromium.org, dhollowa+watch_chromium.org, dougw+watch_chromium.org, Paweł Hajdan Jr., jam, gideonwald, sreeram, dominich, darin-cc_chromium.org, David Black, rdsmith+dwatch_chromium.org, tfarina, kmadhusu+watch_chromium.org, android-webview-reviews_chromium.org, Jered
Visibility:
Public.

Description

fix a problem that android cannot download files with basic authentication Android download manager does not support authentication headers. This change adds a call to check if a url request contains authentication headers. If so, we fallback to chrome download path instead of using the download manager. BUG=159687 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193318

Patch Set 1 #

Total comments: 4

Patch Set 2 : adding a call in http_transactions to get the auth info #

Total comments: 2

Patch Set 3 : moving hasAuth to httpResponseInfo #

Patch Set 4 : rebase #

Patch Set 5 : nits #

Total comments: 6

Patch Set 6 : addressing comments #

Total comments: 2

Patch Set 7 : removing some redundant code #

Patch Set 8 : nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -1 line) Patch
M chrome/browser/android/intercept_download_resource_throttle.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M net/http/http_network_transaction.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M net/http/http_response_info.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M net/http/http_response_info.cc View 1 2 3 4 5 6 chunks +10 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
qinmin
PTAL
7 years, 8 months ago (2013-04-04 02:08:54 UTC) #1
joth
aw/ lgtm https://codereview.chromium.org/13609002/diff/1/content/public/browser/web_contents_delegate.h File content/public/browser/web_contents_delegate.h (right): https://codereview.chromium.org/13609002/diff/1/content/public/browser/web_contents_delegate.h#newcode226 content/public/browser/web_contents_delegate.h:226: bool has_auth); @jam - in line with ...
7 years, 8 months ago (2013-04-04 03:10:15 UTC) #2
nilesh
I think things will be much simpler if we add an android specific resource throttle ...
7 years, 8 months ago (2013-04-04 03:11:59 UTC) #3
qinmin
You will bypass some calls on the UI thread in download_request_limiter.cc if you return early ...
7 years, 8 months ago (2013-04-04 03:28:22 UTC) #4
benm (inactive)
In the bug, comment #7 suggests that the Classic Browser supports this - it was ...
7 years, 8 months ago (2013-04-04 10:37:44 UTC) #5
Randy Smith (Not in Mondays)
I consider Asanka a better person than I for a Downloads/Auth crossover issue.
7 years, 8 months ago (2013-04-04 15:58:42 UTC) #6
qinmin
On 2013/04/04 10:37:44, benm wrote: > In the bug, comment #7 suggests that the Classic ...
7 years, 8 months ago (2013-04-04 16:19:51 UTC) #7
jam
https://codereview.chromium.org/13609002/diff/1/content/public/browser/web_contents_delegate.h File content/public/browser/web_contents_delegate.h (right): https://codereview.chromium.org/13609002/diff/1/content/public/browser/web_contents_delegate.h#newcode226 content/public/browser/web_contents_delegate.h:226: bool has_auth); On 2013/04/04 03:10:15, joth wrote: > @jam ...
7 years, 8 months ago (2013-04-04 17:13:47 UTC) #8
asanka
It seems the signal you are looking for is whether any authorization headers were added ...
7 years, 8 months ago (2013-04-04 17:20:30 UTC) #9
benm (inactive)
On 2013/04/04 16:19:51, qinmin wrote: > On 2013/04/04 10:37:44, benm wrote: > > In the ...
7 years, 8 months ago (2013-04-04 17:58:34 UTC) #10
qinmin
Added a HasAuth() call in HttpTransaction to check if the request has authentication credentials. This ...
7 years, 8 months ago (2013-04-04 22:34:24 UTC) #11
nilesh
On 2013/04/04 03:28:22, qinmin wrote: > You will bypass some calls on the UI thread ...
7 years, 8 months ago (2013-04-04 23:10:32 UTC) #12
asanka
Have you considered using HttpResponseInfo to indicate whether HTTP authentication was used during the fetch? ...
7 years, 8 months ago (2013-04-05 16:04:50 UTC) #13
qinmin
ok, moved the logic into HttpResponseInfo https://chromiumcodereview.appspot.com/13609002/diff/14001/net/http/http_network_transaction.h File net/http/http_network_transaction.h (right): https://chromiumcodereview.appspot.com/13609002/diff/14001/net/http/http_network_transaction.h#newcode55 net/http/http_network_transaction.h:55: virtual bool HasAuth() ...
7 years, 8 months ago (2013-04-05 17:12:08 UTC) #14
qinmin
rebase after https://codereview.chromium.org/13649009/, asanka, would you please take a look again?
7 years, 8 months ago (2013-04-09 00:00:05 UTC) #15
asanka
https://codereview.chromium.org/13609002/diff/33001/net/http/http_network_transaction.cc File net/http/http_network_transaction.cc (right): https://codereview.chromium.org/13609002/diff/33001/net/http/http_network_transaction.cc#newcode781 net/http/http_network_transaction.cc:781: request_headers_.MergeFrom(request_->extra_headers); I'm sorry I didn't see this earlier. Authorization ...
7 years, 8 months ago (2013-04-09 17:38:50 UTC) #16
qinmin
https://codereview.chromium.org/13609002/diff/33001/net/http/http_network_transaction.cc File net/http/http_network_transaction.cc (right): https://codereview.chromium.org/13609002/diff/33001/net/http/http_network_transaction.cc#newcode781 net/http/http_network_transaction.cc:781: request_headers_.MergeFrom(request_->extra_headers); On 2013/04/09 17:38:51, asanka wrote: > I'm sorry ...
7 years, 8 months ago (2013-04-09 20:19:05 UTC) #17
asanka
https://codereview.chromium.org/13609002/diff/40001/net/http/http_network_transaction.cc File net/http/http_network_transaction.cc (right): https://codereview.chromium.org/13609002/diff/40001/net/http/http_network_transaction.cc#newcode773 net/http/http_network_transaction.cc:773: has_auth = true; These are redundant with the check ...
7 years, 8 months ago (2013-04-09 21:55:13 UTC) #18
qinmin
https://codereview.chromium.org/13609002/diff/40001/net/http/http_network_transaction.cc File net/http/http_network_transaction.cc (right): https://codereview.chromium.org/13609002/diff/40001/net/http/http_network_transaction.cc#newcode773 net/http/http_network_transaction.cc:773: has_auth = true; ah... ok, done On 2013/04/09 21:55:13, ...
7 years, 8 months ago (2013-04-09 22:10:06 UTC) #19
asanka
LGTM
7 years, 8 months ago (2013-04-09 22:41:57 UTC) #20
nilesh
LGTM
7 years, 8 months ago (2013-04-09 22:52:07 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/13609002/47001
7 years, 8 months ago (2013-04-09 22:53:55 UTC) #22
commit-bot: I haz the power
7 years, 8 months ago (2013-04-10 04:18:21 UTC) #23
Message was sent while issue was closed.
Change committed as 193318

Powered by Google App Engine
This is Rietveld 408576698