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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc

Issue 2103223002: Adding version info to the client config request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removing leftover headers Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc
index e652b5ce47f83840bdfc2e7ba8f688783b0e72b8..57875b0735246f018550e089c9ec726df5489198 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client.cc
@@ -19,20 +19,21 @@
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_mutable_config_values.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_creator.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_util.h"
#include "components/data_reduction_proxy/proto/client_config.pb.h"
+#include "components/version_info/version_info.h"
#include "net/base/host_port_pair.h"
#include "net/base/load_flags.h"
#include "net/base/load_timing_info.h"
#include "net/base/net_errors.h"
#include "net/http/http_network_session.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h"
#include "net/proxy/proxy_server.h"
#include "net/url_request/url_fetcher.h"
@@ -363,20 +364,28 @@ void DataReductionProxyConfigServiceClient::OnURLFetchComplete(
HandleResponse(response, status, source->GetResponseCode());
}
void DataReductionProxyConfigServiceClient::RetrieveRemoteConfig() {
DCHECK(thread_checker_.CalledOnValidThread());
CreateClientConfigRequest request;
std::string serialized_request;
const std::string& session_key = request_options_->GetSecureSession();
if (!session_key.empty())
request.set_session_key(request_options_->GetSecureSession());
+ data_reduction_proxy::VersionInfo* version_info =
+ request.mutable_version_info();
+ version_info->set_channel(
+ protobuf_parser::ProtoChannelFromChannel(io_data_->channel()));
+ version_info->set_version_number(version_info::GetVersionNumber());
+ version_info->set_product_name(version_info::GetProductName());
+ version_info->set_os_type(version_info::GetOSType());
+ version_info->set_is_official_build(version_info::IsOfficialBuild());
request.SerializeToString(&serialized_request);
std::unique_ptr<net::URLFetcher> fetcher =
GetURLFetcherForConfig(config_service_url_, serialized_request);
if (!fetcher.get()) {
HandleResponse(std::string(),
net::URLRequestStatus::FromError(net::ERR_ABORTED),
net::URLFetcher::RESPONSE_CODE_INVALID);
return;
}

Powered by Google App Engine
This is Rietveld 408576698