|
|
Created:
4 years, 1 month ago by Charlie Harrison Modified:
4 years, 1 month ago Reviewers:
Nate Chapin CC:
chromium-reviews, Yoav Weiss, tyoshino+watch_chromium.org, loading-reviews_chromium.org, gavinp+loader_chromium.org, blink-reviews, Nate Chapin Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionApply user agent exactly once for requests from Blink.
For most regular fetches, we apply the user agent twice:
- addAdditionalRequestHeaders
- prepareRequest
This patch changes FrameLoader::applyUserAgent to
FrameLoader::applyUserAgentIfNeeded which first checks if the user agent
is set. This avoids going to the embedder to calculate the override twice.
BUG=348655
Committed: https://crrev.com/068d63ed251f23d4d3cbd06c5d702abae09c7ce9
Cr-Commit-Position: refs/heads/master@{#427180}
Patch Set 1 #Patch Set 2 : remove applyUserAgent in addAdditionalRequestHeaders #Messages
Total messages: 24 (13 generated)
The CQ bit was checked by csharrison@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...)
csharrison@chromium.org changed reviewers: + japhet@chromium.org
japhet, PTAL?
LGTM I guess, but do we really need the user agent set in both those functions? Can we remove one of those calls?
On 2016/10/24 17:26:46, Nate Chapin wrote: > LGTM I guess, but do we really need the user agent set in both those functions? > Can we remove one of those calls? I can't remove it from addAdditionalRequestHeaders, because PingLoader needs it (we'd need something like applyUserAgent to FetchContext). I could remove it from prepareRequest and just add it specifically for redirects in FrameFetchContext::dispatchWillSendRequest. That's arguably a better solution than this one, so I'll try it.
The CQ bit was checked by csharrison@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Actually, pings end up calling prepareRequest via willStartLoadingResource, so let's try removing it from addAdditionalRequestHeaders. Current PS does that, hopefully bots agree with me :)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
On 2016/10/24 17:53:38, Charlie Harrison wrote: > Actually, pings end up calling prepareRequest via willStartLoadingResource, so > let's try removing it from addAdditionalRequestHeaders. > > Current PS does that, hopefully bots agree with me :) Bots seem fine (ish). The failures look unrelated. Mind taking another pass?
LGTM, thanks!
The CQ bit was checked by csharrison@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...)
The CQ bit was checked by csharrison@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== Apply user agent exactly once for requests from Blink. For most regular fetches, we apply the user agent twice: - addAdditionalRequestHeaders - prepareRequest This patch changes FrameLoader::applyUserAgent to FrameLoader::applyUserAgentIfNeeded which first checks if the user agent is set. This avoids going to the embedder to calculate the override twice. BUG=348655 ========== to ========== Apply user agent exactly once for requests from Blink. For most regular fetches, we apply the user agent twice: - addAdditionalRequestHeaders - prepareRequest This patch changes FrameLoader::applyUserAgent to FrameLoader::applyUserAgentIfNeeded which first checks if the user agent is set. This avoids going to the embedder to calculate the override twice. BUG=348655 Committed: https://crrev.com/068d63ed251f23d4d3cbd06c5d702abae09c7ce9 Cr-Commit-Position: refs/heads/master@{#427180} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/068d63ed251f23d4d3cbd06c5d702abae09c7ce9 Cr-Commit-Position: refs/heads/master@{#427180} |