summaryrefslogtreecommitdiffstats
path: root/net/http/http_cache_transaction.cc
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-10-19 14:37:37 +0100
committerIain Merrick <husky@google.com>2010-10-19 14:37:37 +0100
commit3345a6884c488ff3a535c2c9acdd33d74b37e311 (patch)
tree7784b988ef1698cb6967ea1bdf07616237716c6c /net/http/http_cache_transaction.cc
parentefc8475837ec58186051f23bb03542620424f6ce (diff)
downloadexternal_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.zip
external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.gz
external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.bz2
Merge Chromium at 7.0.540.0 : Initial merge by git
Not including third_party/icu as it contains huge data files that break Gerrit, and aren't actually used. Change-Id: I428a386e70f3b58cacd28677b8cfda282e891e15
Diffstat (limited to 'net/http/http_cache_transaction.cc')
-rw-r--r--net/http/http_cache_transaction.cc30
1 files changed, 23 insertions, 7 deletions
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 9bbf4d1..3129113 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -4,16 +4,21 @@
#include "net/http/http_cache_transaction.h"
-#include "base/compiler_specific.h"
+#include "build/build_config.h"
#if defined(OS_POSIX)
#include <unistd.h>
#endif
+#include <string>
+
+#include "base/compiler_specific.h"
+#include "base/field_trial.h"
#include "base/histogram.h"
#include "base/ref_counted.h"
#include "base/string_util.h"
#include "base/time.h"
+#include "net/base/cert_status_flags.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -223,8 +228,8 @@ int HttpCache::Transaction::RestartWithCertificate(
}
int HttpCache::Transaction::RestartWithAuth(
- const std::wstring& username,
- const std::wstring& password,
+ const string16& username,
+ const string16& password,
CompletionCallback* callback) {
DCHECK(auth_response_.headers);
DCHECK(callback);
@@ -827,8 +832,19 @@ int HttpCache::Transaction::DoAddToEntry() {
int HttpCache::Transaction::DoAddToEntryComplete(int result) {
net_log_.EndEvent(NetLog::TYPE_HTTP_CACHE_WAITING, NULL);
- UMA_HISTOGRAM_TIMES("HttpCache.EntryLockWait",
- base::TimeTicks::Now() - entry_lock_waiting_since_);
+
+ const base::TimeDelta entry_lock_wait =
+ base::TimeTicks::Now() - entry_lock_waiting_since_;
+ UMA_HISTOGRAM_TIMES("HttpCache.EntryLockWait", entry_lock_wait);
+ static const bool prefetching_fieldtrial =
+ FieldTrialList::Find("Prefetch") &&
+ !FieldTrialList::Find("Prefetch")->group_name().empty();
+ if (prefetching_fieldtrial) {
+ UMA_HISTOGRAM_TIMES(
+ FieldTrial::MakeName("HttpCache.EntryLockWait", "Prefetch"),
+ entry_lock_wait);
+ }
+
entry_lock_waiting_since_ = base::TimeTicks();
DCHECK(new_entry_);
cache_pending_ = false;
@@ -1497,8 +1513,8 @@ int HttpCache::Transaction::RestartNetworkRequestWithCertificate(
}
int HttpCache::Transaction::RestartNetworkRequestWithAuth(
- const std::wstring& username,
- const std::wstring& password) {
+ const string16& username,
+ const string16& password) {
DCHECK(mode_ & WRITE || mode_ == NONE);
DCHECK(network_trans_.get());
DCHECK_EQ(STATE_NONE, next_state_);