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

Side by Side Diff: chrome/browser/renderer_host/async_resource_handler.cc

Issue 159730: Do not cache an IOBuffer in AsyncResourceHandler if data_ is NULL. (Closed)
Patch Set: Switch to CHECK. Created 11 years, 4 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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/renderer_host/async_resource_handler.h" 5 #include "chrome/browser/renderer_host/async_resource_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/process.h" 8 #include "base/process.h"
9 #include "base/shared_memory.h" 9 #include "base/shared_memory.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 const std::string& security_info) { 134 const std::string& security_info) {
135 receiver_->Send(new ViewMsg_Resource_RequestComplete(routing_id_, 135 receiver_->Send(new ViewMsg_Resource_RequestComplete(routing_id_,
136 request_id, 136 request_id,
137 status, 137 status,
138 security_info)); 138 security_info));
139 139
140 // If we still have a read buffer, then see about caching it for later... 140 // If we still have a read buffer, then see about caching it for later...
141 if (g_spare_read_buffer) { 141 if (g_spare_read_buffer) {
142 read_buffer_ = NULL; 142 read_buffer_ = NULL;
143 } else if (read_buffer_.get()) { 143 } else if (read_buffer_.get()) {
144 // TODO(willchan): Remove after debugging bug 16371.
145 CHECK(read_buffer_->data());
144 read_buffer_.swap(&g_spare_read_buffer); 146 read_buffer_.swap(&g_spare_read_buffer);
145 } 147 }
146 return true; 148 return true;
147 } 149 }
148 150
149 // static 151 // static
150 void AsyncResourceHandler::GlobalCleanup() { 152 void AsyncResourceHandler::GlobalCleanup() {
151 if (g_spare_read_buffer) { 153 if (g_spare_read_buffer) {
152 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer(). 154 // Avoid the CHECK in SharedIOBuffer::~SharedIOBuffer().
153 SharedIOBuffer* tmp = g_spare_read_buffer; 155 SharedIOBuffer* tmp = g_spare_read_buffer;
154 g_spare_read_buffer = NULL; 156 g_spare_read_buffer = NULL;
155 tmp->Release(); 157 tmp->Release();
156 } 158 }
157 } 159 }
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