| Index: net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
|
| diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
|
| index 1c1e54b4ab4ddd8719451ed7cd93c9675574bb2e..d033f95861f2f7abe7d59660e7132bdbe6aec8a1 100644
|
| --- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
|
| +++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
|
| @@ -46,8 +46,8 @@ DhcpProxyScriptAdapterFetcher::~DhcpProxyScriptAdapterFetcher() {
|
| Cancel();
|
| }
|
|
|
| -void DhcpProxyScriptAdapterFetcher::Fetch(
|
| - const std::string& adapter_name, const CompletionCallback& callback) {
|
| +void DhcpProxyScriptAdapterFetcher::Fetch(const std::string& adapter_name,
|
| + const CompletionCallback& callback) {
|
| DCHECK(CalledOnValidThread());
|
| DCHECK_EQ(state_, STATE_START);
|
| result_ = ERR_IO_PENDING;
|
| @@ -55,19 +55,19 @@ void DhcpProxyScriptAdapterFetcher::Fetch(
|
| state_ = STATE_WAIT_DHCP;
|
| callback_ = callback;
|
|
|
| - wait_timer_.Start(FROM_HERE, ImplGetTimeout(),
|
| - this, &DhcpProxyScriptAdapterFetcher::OnTimeout);
|
| + wait_timer_.Start(FROM_HERE,
|
| + ImplGetTimeout(),
|
| + this,
|
| + &DhcpProxyScriptAdapterFetcher::OnTimeout);
|
| scoped_refptr<DhcpQuery> dhcp_query(ImplCreateDhcpQuery());
|
| task_runner_->PostTaskAndReply(
|
| FROM_HERE,
|
| - base::Bind(
|
| - &DhcpProxyScriptAdapterFetcher::DhcpQuery::GetPacURLForAdapter,
|
| - dhcp_query.get(),
|
| - adapter_name),
|
| - base::Bind(
|
| - &DhcpProxyScriptAdapterFetcher::OnDhcpQueryDone,
|
| - AsWeakPtr(),
|
| - dhcp_query));
|
| + base::Bind(&DhcpProxyScriptAdapterFetcher::DhcpQuery::GetPacURLForAdapter,
|
| + dhcp_query.get(),
|
| + adapter_name),
|
| + base::Bind(&DhcpProxyScriptAdapterFetcher::OnDhcpQueryDone,
|
| + AsWeakPtr(),
|
| + dhcp_query));
|
| }
|
|
|
| void DhcpProxyScriptAdapterFetcher::Cancel() {
|
| @@ -130,9 +130,8 @@ const std::string& DhcpProxyScriptAdapterFetcher::DhcpQuery::url() const {
|
| return url_;
|
| }
|
|
|
| -std::string
|
| - DhcpProxyScriptAdapterFetcher::DhcpQuery::ImplGetPacURLFromDhcp(
|
| - const std::string& adapter_name) {
|
| +std::string DhcpProxyScriptAdapterFetcher::DhcpQuery::ImplGetPacURLFromDhcp(
|
| + const std::string& adapter_name) {
|
| return DhcpProxyScriptAdapterFetcher::GetPacURLFromDhcp(adapter_name);
|
| }
|
|
|
| @@ -158,7 +157,8 @@ void DhcpProxyScriptAdapterFetcher::OnDhcpQueryDone(
|
| state_ = STATE_WAIT_URL;
|
| script_fetcher_.reset(ImplCreateScriptFetcher());
|
| script_fetcher_->Fetch(
|
| - pac_url_, &pac_script_,
|
| + pac_url_,
|
| + &pac_script_,
|
| base::Bind(&DhcpProxyScriptAdapterFetcher::OnFetcherDone,
|
| base::Unretained(this)));
|
| }
|
| @@ -193,8 +193,8 @@ void DhcpProxyScriptAdapterFetcher::TransitionToFinish() {
|
| callback.Run(result_);
|
| }
|
|
|
| -DhcpProxyScriptAdapterFetcher::State
|
| - DhcpProxyScriptAdapterFetcher::state() const {
|
| +DhcpProxyScriptAdapterFetcher::State DhcpProxyScriptAdapterFetcher::state()
|
| + const {
|
| return state_;
|
| }
|
|
|
| @@ -203,7 +203,7 @@ ProxyScriptFetcher* DhcpProxyScriptAdapterFetcher::ImplCreateScriptFetcher() {
|
| }
|
|
|
| DhcpProxyScriptAdapterFetcher::DhcpQuery*
|
| - DhcpProxyScriptAdapterFetcher::ImplCreateDhcpQuery() {
|
| +DhcpProxyScriptAdapterFetcher::ImplCreateDhcpQuery() {
|
| return new DhcpQuery();
|
| }
|
|
|
| @@ -216,17 +216,17 @@ std::string DhcpProxyScriptAdapterFetcher::GetPacURLFromDhcp(
|
| const std::string& adapter_name) {
|
| EnsureDhcpcsvcInit();
|
|
|
| - std::wstring adapter_name_wide = base::SysMultiByteToWide(adapter_name,
|
| - CP_ACP);
|
| + std::wstring adapter_name_wide =
|
| + base::SysMultiByteToWide(adapter_name, CP_ACP);
|
|
|
| - DHCPCAPI_PARAMS_ARRAY send_params = { 0, NULL };
|
| + DHCPCAPI_PARAMS_ARRAY send_params = {0, NULL};
|
|
|
| - BYTE option_data[] = { 1, 252 };
|
| - DHCPCAPI_PARAMS wpad_params = { 0 };
|
| + BYTE option_data[] = {1, 252};
|
| + DHCPCAPI_PARAMS wpad_params = {0};
|
| wpad_params.OptionId = 252;
|
| wpad_params.IsVendor = FALSE; // Surprising, but intentional.
|
|
|
| - DHCPCAPI_PARAMS_ARRAY request_params = { 0 };
|
| + DHCPCAPI_PARAMS_ARRAY request_params = {0};
|
| request_params.nParams = 1;
|
| request_params.Params = &wpad_params;
|
|
|
| @@ -254,8 +254,10 @@ std::string DhcpProxyScriptAdapterFetcher::GetPacURLFromDhcp(
|
| NULL,
|
| const_cast<LPWSTR>(adapter_name_wide.c_str()),
|
| NULL,
|
| - send_params, request_params,
|
| - result_buffer.get(), &result_buffer_size,
|
| + send_params,
|
| + request_params,
|
| + result_buffer.get(),
|
| + &result_buffer_size,
|
| NULL);
|
| ++retry_count;
|
| } while (res == ERROR_MORE_DATA && retry_count <= 3);
|
| @@ -274,7 +276,8 @@ std::string DhcpProxyScriptAdapterFetcher::GetPacURLFromDhcp(
|
|
|
| // static
|
| std::string DhcpProxyScriptAdapterFetcher::SanitizeDhcpApiString(
|
| - const char* data, size_t count_bytes) {
|
| + const char* data,
|
| + size_t count_bytes) {
|
| // The result should be ASCII, not wide character. Some DHCP
|
| // servers appear to count the trailing NULL in nBytesData, others
|
| // do not. A few (we've had one report, http://crbug.com/297810)
|
|
|