OLD | NEW |
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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 } | 863 } |
864 | 864 |
865 int HttpCache::Transaction::DoAddToEntryComplete(int result) { | 865 int HttpCache::Transaction::DoAddToEntryComplete(int result) { |
866 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HTTP_CACHE_ADD_TO_ENTRY, | 866 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_HTTP_CACHE_ADD_TO_ENTRY, |
867 result); | 867 result); |
868 | 868 |
869 const base::TimeDelta entry_lock_wait = | 869 const base::TimeDelta entry_lock_wait = |
870 base::TimeTicks::Now() - entry_lock_waiting_since_; | 870 base::TimeTicks::Now() - entry_lock_waiting_since_; |
871 UMA_HISTOGRAM_TIMES("HttpCache.EntryLockWait", entry_lock_wait); | 871 UMA_HISTOGRAM_TIMES("HttpCache.EntryLockWait", entry_lock_wait); |
872 static const bool prefetching_fieldtrial = | 872 static const bool prefetching_fieldtrial = |
873 base::FieldTrialList::TrialExists("Prefetch"); | 873 base::FieldTrialList::Find("Prefetch") && |
| 874 !base::FieldTrialList::Find("Prefetch")->group_name().empty(); |
874 if (prefetching_fieldtrial) { | 875 if (prefetching_fieldtrial) { |
875 UMA_HISTOGRAM_TIMES( | 876 UMA_HISTOGRAM_TIMES( |
876 base::FieldTrial::MakeName("HttpCache.EntryLockWait", "Prefetch"), | 877 base::FieldTrial::MakeName("HttpCache.EntryLockWait", "Prefetch"), |
877 entry_lock_wait); | 878 entry_lock_wait); |
878 } | 879 } |
879 | 880 |
880 entry_lock_waiting_since_ = base::TimeTicks(); | 881 entry_lock_waiting_since_ = base::TimeTicks(); |
881 DCHECK(new_entry_); | 882 DCHECK(new_entry_); |
882 cache_pending_ = false; | 883 cache_pending_ = false; |
883 | 884 |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2013 return false; | 2014 return false; |
2014 | 2015 |
2015 return true; | 2016 return true; |
2016 } | 2017 } |
2017 | 2018 |
2018 void HttpCache::Transaction::OnIOComplete(int result) { | 2019 void HttpCache::Transaction::OnIOComplete(int result) { |
2019 DoLoop(result); | 2020 DoLoop(result); |
2020 } | 2021 } |
2021 | 2022 |
2022 } // namespace net | 2023 } // namespace net |
OLD | NEW |