Commit c234467f authored by Sorin Jianu's avatar Sorin Jianu Committed by Commit Bot

make the updater network use proxy settings by default

Bug: 938527
Change-Id: I0814a5078cca8ee25d96a68a64a42fcfcf3be62a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504053
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637822}
parent e3add48b
...@@ -134,7 +134,8 @@ class Observer : public update_client::UpdateClient::Observer { ...@@ -134,7 +134,8 @@ class Observer : public update_client::UpdateClient::Observer {
void InitLogging(const base::CommandLine& command_line) { void InitLogging(const base::CommandLine& command_line) {
logging::LoggingSettings settings; logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; settings.logging_dest = logging::LOG_TO_ALL;
settings.log_file = FILE_PATH_LITERAL("updater.log");
logging::InitLogging(settings); logging::InitLogging(settings);
logging::SetLogItems(true, // enable_process_id logging::SetLogItems(true, // enable_process_id
true, // enable_thread_id true, // enable_thread_id
......
...@@ -26,6 +26,8 @@ class NetworkFetcherFactory : public update_client::NetworkFetcherFactory { ...@@ -26,6 +26,8 @@ class NetworkFetcherFactory : public update_client::NetworkFetcherFactory {
~NetworkFetcherFactory() override; ~NetworkFetcherFactory() override;
private: private:
static scoped_hinternet CreateSessionHandle();
THREAD_CHECKER(thread_checker_); THREAD_CHECKER(thread_checker_);
scoped_hinternet session_handle_; scoped_hinternet session_handle_;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/win/windows_version.h"
#include "chrome/updater/win/net/network.h" #include "chrome/updater/win/net/network.h"
#include "chrome/updater/win/net/network_winhttp.h" #include "chrome/updater/win/net/network_winhttp.h"
...@@ -73,13 +74,19 @@ void NetworkFetcher::DownloadToFileComplete() { ...@@ -73,13 +74,19 @@ void NetworkFetcher::DownloadToFileComplete() {
} }
NetworkFetcherFactory::NetworkFetcherFactory() NetworkFetcherFactory::NetworkFetcherFactory()
: session_handle_(::WinHttpOpen(L"Chrome Updater", : session_handle_(CreateSessionHandle()) {}
WINHTTP_ACCESS_TYPE_NO_PROXY,
WINHTTP_NO_PROXY_NAME,
WINHTTP_NO_PROXY_BYPASS,
WINHTTP_FLAG_ASYNC)) {}
NetworkFetcherFactory::~NetworkFetcherFactory() = default; NetworkFetcherFactory::~NetworkFetcherFactory() = default;
scoped_hinternet NetworkFetcherFactory::CreateSessionHandle() {
const auto* os_info = base::win::OSInfo::GetInstance();
const uint32_t access_type = os_info->version() >= base::win::VERSION_WIN8_1
? WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY
: WINHTTP_ACCESS_TYPE_NO_PROXY;
return scoped_hinternet(
::WinHttpOpen(L"Chrome Updater", access_type, WINHTTP_NO_PROXY_NAME,
WINHTTP_NO_PROXY_BYPASS, WINHTTP_FLAG_ASYNC));
}
std::unique_ptr<update_client::NetworkFetcher> NetworkFetcherFactory::Create() std::unique_ptr<update_client::NetworkFetcher> NetworkFetcherFactory::Create()
const { const {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
......
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