summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff options
context:
space:
mode:
authorasvitkine <asvitkine@chromium.org>2015-12-17 18:35:50 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-18 02:36:44 +0000
commit9a2798399231b89c9becb3c9ca016da34550ebd2 (patch)
tree0eb51fa3d4becb0b56ba691e234795a946aaf30f /chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
parentaeb6648f175f95009e0eb10a07aca126ba81a878 (diff)
downloadchromium_src-9a2798399231b89c9becb3c9ca016da34550ebd2.zip
chromium_src-9a2798399231b89c9becb3c9ca016da34550ebd2.tar.gz
chromium_src-9a2798399231b89c9becb3c9ca016da34550ebd2.tar.bz2
Refactor VariationsHttpHeaderProvider.
The goal is to move the bulk of its implementation to the main variations component, so that it can be used by this CL from JNI: https://codereview.chromium.org/1528543003/ Creates variations_http_headers.cc in net that still needs to depend on net, which uses the http header provider internally. Updates callers of the previous API to use the new simpler API that doesn't require going through the singleton by clients. Additionally, also adds variations/synthetic_trials.h and moves the synthetic trials structs from metrics_service.h to the new file. This works around an otherwise circular dependency between metrics and variations, since variations_http_header_provider.cc depends on synthetic trials. TBRs below are for owners of downstream users of the API which is being updated. BUG=530223 TBR=caitkp@chromium.org,thestig@chromium.org Review URL: https://codereview.chromium.org/1530133005 Cr-Commit-Position: refs/heads/master@{#365991}
Diffstat (limited to 'chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc')
-rw-r--r--chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index f552005..a8e6fa8 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -37,7 +37,7 @@
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
#include "components/google/core/browser/google_util.h"
-#include "components/variations/net/variations_http_header_provider.h"
+#include "components/variations/net/variations_http_headers.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/plugin_service.h"
@@ -285,11 +285,9 @@ ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate()
#endif
{
BrowserThread::PostTask(
- BrowserThread::IO,
- FROM_HERE,
+ BrowserThread::IO, FROM_HERE,
base::Bind(content::ServiceWorkerContext::AddExcludedHeadersForFetchEvent,
- variations::VariationsHttpHeaderProvider::GetInstance()
- ->GetVariationHeaderNames()));
+ variations::GetVariationHeaderNames()));
}
ChromeResourceDispatcherHostDelegate::~ChromeResourceDispatcherHostDelegate() {
@@ -371,12 +369,10 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
net::HttpRequestHeaders headers;
headers.CopyFrom(request->extra_request_headers());
bool is_off_the_record = io_data->IsOffTheRecord();
- variations::VariationsHttpHeaderProvider::GetInstance()->
- AppendHeaders(request->url(),
- is_off_the_record,
- !is_off_the_record &&
- io_data->GetMetricsEnabledStateOnIOThread(),
- &headers);
+ variations::AppendVariationHeaders(
+ request->url(), is_off_the_record,
+ !is_off_the_record && io_data->GetMetricsEnabledStateOnIOThread(),
+ &headers);
request->SetExtraRequestHeaders(headers);
}