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

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

Issue 2649043005: Make DiskCacheBasedQuicServerInfo release buffers when no longer needed (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 282
283 return OK; 283 return OK;
284 } 284 }
285 285
286 int DiskCacheBasedQuicServerInfo::DoReadComplete(int rv) { 286 int DiskCacheBasedQuicServerInfo::DoReadComplete(int rv) {
287 if (rv > 0) 287 if (rv > 0)
288 data_.assign(read_buffer_->data(), rv); 288 data_.assign(read_buffer_->data(), rv);
289 else if (rv < 0) 289 else if (rv < 0)
290 RecordQuicServerInfoFailure(READ_FAILURE); 290 RecordQuicServerInfoFailure(READ_FAILURE);
291 291
292 read_buffer_ = nullptr;
292 state_ = WAIT_FOR_DATA_READY_DONE; 293 state_ = WAIT_FOR_DATA_READY_DONE;
293 return OK; 294 return OK;
294 } 295 }
295 296
296 int DiskCacheBasedQuicServerInfo::DoWriteComplete(int rv) { 297 int DiskCacheBasedQuicServerInfo::DoWriteComplete(int rv) {
297 if (rv < 0) 298 if (rv < 0)
298 RecordQuicServerInfoFailure(WRITE_FAILURE); 299 RecordQuicServerInfoFailure(WRITE_FAILURE);
300 write_buffer_ = nullptr;
299 state_ = SET_DONE; 301 state_ = SET_DONE;
300 return OK; 302 return OK;
301 } 303 }
302 304
303 int DiskCacheBasedQuicServerInfo::DoCreateOrOpenComplete(int rv) { 305 int DiskCacheBasedQuicServerInfo::DoCreateOrOpenComplete(int rv) {
304 if (rv != OK) { 306 if (rv != OK) {
305 RecordQuicServerInfoFailure(CREATE_OR_OPEN_FAILURE); 307 RecordQuicServerInfoFailure(CREATE_OR_OPEN_FAILURE);
306 state_ = SET_DONE; 308 state_ = SET_DONE;
307 } else { 309 } else {
308 if (!entry_) { 310 if (!entry_) {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } else if (backend_->GetCacheType() == MEMORY_CACHE) { 430 } else if (backend_->GetCacheType() == MEMORY_CACHE) {
429 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.MemoryCache", 431 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.MemoryCache",
430 failure, NUM_OF_FAILURES); 432 failure, NUM_OF_FAILURES);
431 } else { 433 } else {
432 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.DiskCache", 434 UMA_HISTOGRAM_ENUMERATION("Net.QuicDiskCache.FailureReason.DiskCache",
433 failure, NUM_OF_FAILURES); 435 failure, NUM_OF_FAILURES);
434 } 436 }
435 } 437 }
436 438
437 } // namespace net 439 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698