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

Unified Diff: net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc

Issue 6975027: Add metrics for DHCP WPAD feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 9 years, 7 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
« no previous file with comments | « net/base/net_errors.cc ('k') | net/proxy/dhcp_proxy_script_fetcher_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f09537c256a68e83d8cc264be727e4b22f426e93..df6b46af5aa5c87930c1f2325c4f65291be0c380 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
@@ -5,6 +5,7 @@
#include "net/proxy/dhcp_proxy_script_adapter_fetcher_win.h"
#include "base/message_loop_proxy.h"
+#include "base/metrics/histogram.h"
#include "base/sys_string_conversions.h"
#include "base/task.h"
#include "base/threading/worker_pool.h"
@@ -201,8 +202,12 @@ void DhcpProxyScriptAdapterFetcher::OnFetcherDone(int result) {
void DhcpProxyScriptAdapterFetcher::TransitionToFinish() {
DCHECK(state_ == STATE_WAIT_DHCP || state_ == STATE_WAIT_URL);
state_ = STATE_FINISH;
- callback_->Run(result_);
+ CompletionCallback* callback = callback_;
callback_ = NULL;
+
+ // Be careful not to touch any member state after this, as the client
+ // may delete us during this callback.
+ callback->Run(result_);
}
ProxyScriptFetcher* DhcpProxyScriptAdapterFetcher::ImplCreateScriptFetcher() {
@@ -269,7 +274,8 @@ std::string DhcpProxyScriptAdapterFetcher::GetPacURLFromDhcp(
} while (res == ERROR_MORE_DATA && retry_count <= 3);
if (res != NO_ERROR) {
- NOTREACHED();
+ LOG(INFO) << "Error fetching PAC URL from DHCP: " << res;
+ UMA_HISTOGRAM_COUNTS("Net.DhcpWpadUnhandledDhcpError", 1);
} else if (wpad_params.nBytesData) {
// The result should be ASCII, not wide character.
DCHECK_EQ(strlen(reinterpret_cast<const char*>(wpad_params.Data)) + 1,
« no previous file with comments | « net/base/net_errors.cc ('k') | net/proxy/dhcp_proxy_script_fetcher_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698