Commit f66cb726 authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Reland "Send variation headers to sync server"

This is a reland of
https://chromium-review.googlesource.com/c/chromium/src/+/1827368 after
the underlying issues have been resolved in other patches and
FieldTrialList is guaranteed to be instantiated on all platforms.

Original change's description:
> Revert "Send variation headers to sync server"
>
> This reverts commit c305a2ba.
>
> Reason for revert: DCHECK failures observed on ios.
>
> Original change's description:
> > Send variation headers to sync server
> >
> > This information is already sent to other servers such as the one used
> > for omnibox personalization, hence the patch doesn't upload additional
> > information but allows measuring the impact variations have on the sync
> > server and debug errors caused by client-side experiments.
> >
> > Bug: 887521
> > Change-Id: I3358956639bf96260bb5010279012195086eec37
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827368
> > Reviewed-by: Mark Pearson <mpearson@chromium.org>
> > Reviewed-by: Marc Treib <treib@chromium.org>
> > Commit-Queue: Mikel Astiz <mastiz@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#700678}
>
> TBR=mpearson@chromium.org,treib@chromium.org,mastiz@chromium.org
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: 887521, 1011088
> Change-Id: I07fb576d156cf9efd334ce89617e9a823db61662
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1844814
> Reviewed-by: Mikel Astiz <mastiz@chromium.org>
> Commit-Queue: Mikel Astiz <mastiz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#703254}

TBR=mpearson@chromium.org,treib@chromium.org,mastiz@chromium.org

Bug: 887521, 1011088
Change-Id: I1e7ee5d44d1137dfaa5bdc7dd063cfe8bd2b7e55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1950947
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721635}
parent 318d19c3
......@@ -426,6 +426,7 @@ jumbo_static_library("rest_of_sync") {
"//base:i18n",
"//build:branding_buildflags",
"//components/keyed_service/core",
"//components/variations/net",
"//services/network/public/cpp",
"//sql",
"//third_party/cacheinvalidation",
......
include_rules = [
"+components/variations",
"+net",
"+services/network/public/cpp",
"+services/network/test",
......
......@@ -19,6 +19,7 @@
#include "base/strings/stringprintf.h"
#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "components/variations/net/variations_http_headers.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/http/http_cache.h"
......@@ -254,6 +255,10 @@ void HttpBridge::MakeAsynchronousPost() {
resource_request->headers.SetHeader(net::HttpRequestHeaders::kUserAgent,
user_agent_);
variations::AppendVariationsHeader(
url_for_request_, variations::InIncognito::kNo,
variations::SignedIn::kYes, resource_request.get());
fetch_state_.url_loader = network::SimpleURLLoader::Create(
std::move(resource_request), traffic_annotation);
network::SimpleURLLoader* url_loader = fetch_state_.url_loader.get();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment