Skip to content

Commit

Permalink
Remove auth token generation timing histograms.
Browse files Browse the repository at this point in the history
These didn't turn out to be terribly useful, and add some complexity to HttpAuthHandler.

BUG=NONE
TEST=targets build

Review URL: http://codereview.chromium.org/6103003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70740 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
cbentzel@chromium.org committed Jan 7, 2011
1 parent b0be612 commit a473419
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
20 changes: 0 additions & 20 deletions net/http/http_auth_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "net/http/http_auth_handler.h"

#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "net/base/net_errors.h"
Expand All @@ -26,12 +25,6 @@ HttpAuthHandler::HttpAuthHandler()
HttpAuthHandler::~HttpAuthHandler() {
}

//static
std::string HttpAuthHandler::GenerateHistogramNameFromScheme(
const std::string& scheme) {
return base::StringPrintf("Net.AuthGenerateToken_%s", scheme.c_str());
}

bool HttpAuthHandler::InitFromChallenge(
HttpAuth::ChallengeTokenizer* challenge,
HttpAuth::Target target,
Expand All @@ -53,13 +46,6 @@ bool HttpAuthHandler::InitFromChallenge(
DCHECK(!ok || properties_ != -1);
DCHECK(!ok || auth_scheme_ != AUTH_SCHEME_MAX);

if (ok)
histogram_ = base::Histogram::FactoryTimeGet(
GenerateHistogramNameFromScheme(scheme()),
base::TimeDelta::FromMilliseconds(1),
base::TimeDelta::FromSeconds(10), 50,
base::Histogram::kUmaTargetedHistogramFlag);

return ok;
}

Expand Down Expand Up @@ -90,10 +76,8 @@ int HttpAuthHandler::GenerateAuthToken(const string16* username,
DCHECK(username != NULL || AllowsDefaultCredentials());
DCHECK(auth_token != NULL);
DCHECK(original_callback_ == NULL);
DCHECK(histogram_.get());
original_callback_ = callback;
net_log_.BeginEvent(EventTypeFromAuthTarget(target_), NULL);
generate_auth_token_start_ = base::TimeTicks::Now();
int rv = GenerateAuthTokenImpl(username, password, request,
&wrapper_callback_, auth_token);
if (rv != ERR_IO_PENDING)
Expand All @@ -118,10 +102,6 @@ void HttpAuthHandler::OnGenerateAuthTokenComplete(int rv) {

void HttpAuthHandler::FinishGenerateAuthToken() {
// TOOD(cbentzel): Should this be done in OK case only?
DCHECK(histogram_.get());
base::TimeDelta generate_auth_token_duration =
base::TimeTicks::Now() - generate_auth_token_start_;
histogram_->AddTime(generate_auth_token_duration);
net_log_.EndEvent(EventTypeFromAuthTarget(target_), NULL);
original_callback_ = NULL;
}
Expand Down
9 changes: 0 additions & 9 deletions net/http/http_auth_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@
#include <string>

#include "base/string16.h"
#include "base/time.h"
#include "net/base/completion_callback.h"
#include "net/base/net_log.h"
#include "net/http/http_auth.h"

namespace base {
class Histogram;
}

namespace net {

struct HttpRequestInfo;
Expand Down Expand Up @@ -206,13 +201,9 @@ class HttpAuthHandler {
private:
void OnGenerateAuthTokenComplete(int rv);
void FinishGenerateAuthToken();
static std::string GenerateHistogramNameFromScheme(const std::string& scheme);

CompletionCallback* original_callback_;
CompletionCallbackImpl<HttpAuthHandler> wrapper_callback_;
// When GenerateAuthToken was called.
base::TimeTicks generate_auth_token_start_;
scoped_refptr<base::Histogram> histogram_;
};

} // namespace net
Expand Down

0 comments on commit a473419

Please sign in to comment.