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

Side by Side Diff: net/http/http_cache_transaction.cc

Issue 6883102: Add one-time randomization support for FieldTrial, and the ability to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responding to review comments. Fix initialization in browser_main. Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_cache_transaction.h" 5 #include "net/http/http_cache_transaction.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 } 852 }
853 853
854 int HttpCache::Transaction::DoAddToEntryComplete(int result) { 854 int HttpCache::Transaction::DoAddToEntryComplete(int result) {
855 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HTTP_CACHE_ADD_TO_ENTRY, 855 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HTTP_CACHE_ADD_TO_ENTRY,
856 result); 856 result);
857 857
858 const base::TimeDelta entry_lock_wait = 858 const base::TimeDelta entry_lock_wait =
859 base::TimeTicks::Now() - entry_lock_waiting_since_; 859 base::TimeTicks::Now() - entry_lock_waiting_since_;
860 UMA_HISTOGRAM_TIMES("HttpCache.EntryLockWait", entry_lock_wait); 860 UMA_HISTOGRAM_TIMES("HttpCache.EntryLockWait", entry_lock_wait);
861 static const bool prefetching_fieldtrial = 861 static const bool prefetching_fieldtrial =
862 base::FieldTrialList::Find("Prefetch") && 862 base::FieldTrialList::TrialExists("Prefetch");
863 !base::FieldTrialList::Find("Prefetch")->group_name().empty();
864 if (prefetching_fieldtrial) { 863 if (prefetching_fieldtrial) {
865 UMA_HISTOGRAM_TIMES( 864 UMA_HISTOGRAM_TIMES(
866 base::FieldTrial::MakeName("HttpCache.EntryLockWait", "Prefetch"), 865 base::FieldTrial::MakeName("HttpCache.EntryLockWait", "Prefetch"),
867 entry_lock_wait); 866 entry_lock_wait);
868 } 867 }
869 868
870 entry_lock_waiting_since_ = base::TimeTicks(); 869 entry_lock_waiting_since_ = base::TimeTicks();
871 DCHECK(new_entry_); 870 DCHECK(new_entry_);
872 cache_pending_ = false; 871 cache_pending_ = false;
873 872
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 return false; 1994 return false;
1996 1995
1997 return true; 1996 return true;
1998 } 1997 }
1999 1998
2000 void HttpCache::Transaction::OnIOComplete(int result) { 1999 void HttpCache::Transaction::OnIOComplete(int result) {
2001 DoLoop(result); 2000 DoLoop(result);
2002 } 2001 }
2003 2002
2004 } // namespace net 2003 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698