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

Issue 99683006: [Android WebView] Only send extra headers for the main page (Closed)

Created:
7 years ago by mnaganov (inactive)
Modified:
7 years ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, android-webview-reviews_chromium.org
Visibility:
Public.

Description

[Android WebView] Only send extra headers for the main page Unlike Chromium, WebViewClassic has a very narrow set of conditions when extra headers set for a navigation are actually added to requests. To fix that, instead of passing the extra headers from AwContents.loadUrl down to NavigationController, we stash them into our ResourceContext and inject from AwResourceDispatcherHostDelegate when needed. The resulting behavior seems to be compatible with WebViewClassic, except that we also inject headers for back / forward navigations, as this seems to be more consistent with the legacy behavior of injecting them on page reload. BUG=306873 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=239807

Patch Set 1 #

Total comments: 13

Patch Set 2 : Moved reloadSync into AwTestBase #

Total comments: 8

Patch Set 3 : Ben's comments addressed, rebased #

Total comments: 10

Patch Set 4 : Removed unneeded forward ref #

Patch Set 5 : bulach's comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+427 lines, -49 lines) Patch
M android_webview/android_webview.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M android_webview/browser/aw_browser_context.cc View 3 chunks +1 line, -32 lines 0 comments Download
A android_webview/browser/aw_resource_context.h View 1 2 3 4 1 chunk +45 lines, -0 lines 0 comments Download
A android_webview/browser/aw_resource_context.cc View 1 2 3 4 1 chunk +59 lines, -0 lines 0 comments Download
M android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h View 2 chunks +8 lines, -0 lines 0 comments Download
M android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc View 1 2 3 4 4 chunks +40 lines, -0 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 3 chunks +11 lines, -0 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/LoadUrlTest.java View 1 2 3 chunks +214 lines, -16 lines 0 comments Download
M android_webview/native/aw_contents.h View 1 chunk +2 lines, -0 lines 0 comments Download
M android_webview/native/aw_contents.cc View 1 2 2 chunks +13 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/LoadUrlParams.java View 1 2 1 chunk +16 lines, -1 line 0 comments Download

Messages

Total messages: 19 (0 generated)
mnaganov (inactive)
7 years ago (2013-12-06 17:30:18 UTC) #1
sgurun-gerrit only
https://codereview.chromium.org/99683006/diff/1/android_webview/browser/aw_resource_context.cc File android_webview/browser/aw_resource_context.cc (right): https://codereview.chromium.org/99683006/diff/1/android_webview/browser/aw_resource_context.cc#newcode46 android_webview/browser/aw_resource_context.cc:46: extra_headers_.erase(url.spec()); probably I missed it. Once extra headers are ...
7 years ago (2013-12-06 20:08:55 UTC) #2
mnaganov (inactive)
https://codereview.chromium.org/99683006/diff/1/android_webview/browser/aw_resource_context.cc File android_webview/browser/aw_resource_context.cc (right): https://codereview.chromium.org/99683006/diff/1/android_webview/browser/aw_resource_context.cc#newcode46 android_webview/browser/aw_resource_context.cc:46: extra_headers_.erase(url.spec()); On 2013/12/06 20:08:55, sgurun wrote: > probably I ...
7 years ago (2013-12-07 16:10:26 UTC) #3
mkosiba (inactive)
Thanks Mikhail! Out of pure paranoia could I ask you to add a test that ...
7 years ago (2013-12-09 10:54:31 UTC) #4
mnaganov (inactive)
Thanks, Marcin! I'm not sure that adding 'window.location' and 'window.history' tests will add any value ...
7 years ago (2013-12-09 13:58:01 UTC) #5
mnaganov (inactive)
On 2013/12/09 13:58:01, Mikhail Naganov (Chromium) wrote: > ... they should be treated internally the ...
7 years ago (2013-12-09 14:01:36 UTC) #6
mkosiba (inactive)
Thanks Mikhail! The only reason I listed window.location/history was because I think they result in ...
7 years ago (2013-12-09 16:35:56 UTC) #7
mnaganov (inactive)
On 2013/12/09 16:35:56, mkosiba wrote: > Thanks Mikhail! > > The only reason I listed ...
7 years ago (2013-12-09 17:01:17 UTC) #8
mkosiba (inactive)
On 2013/12/09 17:01:17, Mikhail Naganov (Chromium) wrote: > On 2013/12/09 16:35:56, mkosiba wrote: > > ...
7 years ago (2013-12-09 17:04:16 UTC) #9
benm (inactive)
thanks Mikhail! https://codereview.chromium.org/99683006/diff/20001/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc File android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/99683006/diff/20001/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc#newcode448 android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc:448: request->SetExtraRequestHeaderByName(it.name(), it.value(), true); What's the behaviour in ...
7 years ago (2013-12-09 17:49:11 UTC) #10
sgurun-gerrit only
lgtm https://codereview.chromium.org/99683006/diff/1/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc File android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/99683006/diff/1/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc#newcode448 android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc:448: request->SetExtraRequestHeaderByName(it.name(), it.value(), true); I see. missed it. I ...
7 years ago (2013-12-09 18:58:27 UTC) #11
mnaganov (inactive)
Thanks, Ben! An astonishingly useful review -- catched real bugs. https://codereview.chromium.org/99683006/diff/1/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc File android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/99683006/diff/1/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc#newcode448 ...
7 years ago (2013-12-10 11:03:30 UTC) #12
mnaganov (inactive)
bulach@: Can you please take a look at the content/public/android/ change?
7 years ago (2013-12-10 11:05:38 UTC) #13
benm (inactive)
lgtm https://codereview.chromium.org/99683006/diff/40001/android_webview/browser/aw_browser_context.h File android_webview/browser/aw_browser_context.h (right): https://codereview.chromium.org/99683006/diff/40001/android_webview/browser/aw_browser_context.h#newcode32 android_webview/browser/aw_browser_context.h:32: class URLRequestContextGetter; nit: needed?
7 years ago (2013-12-10 14:27:45 UTC) #14
mnaganov (inactive)
Thanks, Ben! Marcus? https://codereview.chromium.org/99683006/diff/40001/android_webview/browser/aw_browser_context.h File android_webview/browser/aw_browser_context.h (right): https://codereview.chromium.org/99683006/diff/40001/android_webview/browser/aw_browser_context.h#newcode32 android_webview/browser/aw_browser_context.h:32: class URLRequestContextGetter; On 2013/12/10 14:27:46, benm ...
7 years ago (2013-12-10 15:16:55 UTC) #15
bulach
lgtm, just some nits.. thanks! https://codereview.chromium.org/99683006/diff/40001/android_webview/browser/aw_resource_context.h File android_webview/browser/aw_resource_context.h (right): https://codereview.chromium.org/99683006/diff/40001/android_webview/browser/aw_resource_context.h#newcode31 android_webview/browser/aw_resource_context.h:31: void SetExtraHeaders(const GURL& url, ...
7 years ago (2013-12-10 15:16:57 UTC) #16
mnaganov (inactive)
Thanks, Marcus! Thanks again, everyone! Your suggestions helped to make tremendous improvements of the patch. ...
7 years ago (2013-12-10 16:00:36 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mnaganov@chromium.org/99683006/80001
7 years ago (2013-12-10 16:01:51 UTC) #18
commit-bot: I haz the power
7 years ago (2013-12-10 18:43:26 UTC) #19
Message was sent while issue was closed.
Change committed as 239807

Powered by Google App Engine
This is Rietveld 408576698