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