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

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

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/disk_cache_based_quic_server_info.h" 5 #include "net/http/disk_cache_based_quic_server_info.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (!wait_for_ready_callback_.is_null()) { 94 if (!wait_for_ready_callback_.is_null()) {
95 RecordQuicServerInfoFailure(WAIT_FOR_DATA_READY_INVALID_ARGUMENT_FAILURE); 95 RecordQuicServerInfoFailure(WAIT_FOR_DATA_READY_INVALID_ARGUMENT_FAILURE);
96 return ERR_INVALID_ARGUMENT; 96 return ERR_INVALID_ARGUMENT;
97 } 97 }
98 wait_for_ready_callback_ = callback; 98 wait_for_ready_callback_ = callback;
99 } 99 }
100 100
101 return ERR_IO_PENDING; 101 return ERR_IO_PENDING;
102 } 102 }
103 103
104 void DiskCacheBasedQuicServerInfo::ResetWaitForDataReadyCallback() {
105 DCHECK(CalledOnValidThread());
106 wait_for_ready_callback_.Reset();
107 }
108
104 void DiskCacheBasedQuicServerInfo::CancelWaitForDataReadyCallback() { 109 void DiskCacheBasedQuicServerInfo::CancelWaitForDataReadyCallback() {
105 DCHECK(CalledOnValidThread()); 110 DCHECK(CalledOnValidThread());
106 111
107 RecordQuicServerInfoStatus(QUIC_SERVER_INFO_WAIT_FOR_DATA_READY_CANCEL); 112 RecordQuicServerInfoStatus(QUIC_SERVER_INFO_WAIT_FOR_DATA_READY_CANCEL);
108 if (!wait_for_ready_callback_.is_null()) { 113 if (!wait_for_ready_callback_.is_null()) {
109 RecordLastFailure(); 114 RecordLastFailure();
110 wait_for_ready_callback_.Reset(); 115 wait_for_ready_callback_.Reset();
111 } 116 }
112 } 117 }
113 118
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 } else if (backend_->GetCacheType() == net::MEMORY_CACHE) { 494 } else if (backend_->GetCacheType() == net::MEMORY_CACHE) {
490 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.MemoryCache", 495 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.MemoryCache",
491 failure, NUM_OF_FAILURES); 496 failure, NUM_OF_FAILURES);
492 } else { 497 } else {
493 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.DiskCache", 498 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.DiskCache",
494 failure, NUM_OF_FAILURES); 499 failure, NUM_OF_FAILURES);
495 } 500 }
496 } 501 }
497 502
498 } // namespace net 503 } // namespace net
OLDNEW
« no previous file with comments | « net/http/disk_cache_based_quic_server_info.h ('k') | net/http/disk_cache_based_quic_server_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698