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

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

Issue 892083006: QUIC - Browser shutdown crash fix. Accessing disk_cache's backend after (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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
« no previous file with comments | « no previous file | net/http/disk_cache_based_quic_server_info_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::CancelWaitForDataReadyCallback() { 104 void DiskCacheBasedQuicServerInfo::CancelWaitForDataReadyCallback() {
105 DCHECK(CalledOnValidThread()); 105 DCHECK(CalledOnValidThread());
106 106
107 RecordQuicServerInfoStatus(QUIC_SERVER_INFO_WAIT_FOR_DATA_READY_CANCEL); 107 // TODO(rtenneti): crbug.com/456524. Implement a better fix. During shutdown,
108 // HttpCache could be deleted and leads to crash because backend_ is deleted.
109 // Temporary weekend fix is to return without collecting data in histograms.
110 // RecordQuicServerInfoStatus(QUIC_SERVER_INFO_WAIT_FOR_DATA_READY_CANCEL);
108 if (!wait_for_ready_callback_.is_null()) { 111 if (!wait_for_ready_callback_.is_null()) {
109 RecordLastFailure(); 112 RecordLastFailure();
110 wait_for_ready_callback_.Reset(); 113 wait_for_ready_callback_.Reset();
111 } 114 }
112 } 115 }
113 116
114 bool DiskCacheBasedQuicServerInfo::IsDataReady() { 117 bool DiskCacheBasedQuicServerInfo::IsDataReady() {
115 return ready_; 118 return ready_;
116 } 119 }
117 120
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 } else if (backend_->GetCacheType() == net::MEMORY_CACHE) { 492 } else if (backend_->GetCacheType() == net::MEMORY_CACHE) {
490 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.MemoryCache", 493 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.MemoryCache",
491 failure, NUM_OF_FAILURES); 494 failure, NUM_OF_FAILURES);
492 } else { 495 } else {
493 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.DiskCache", 496 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.DiskCache",
494 failure, NUM_OF_FAILURES); 497 failure, NUM_OF_FAILURES);
495 } 498 }
496 } 499 }
497 500
498 } // namespace net 501 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | 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